ruby on rails - What is the accepted method for a global state? -


i wondering guys consider best way go having simple stuff stored across sessions without using db. i'm looking have having 'modes' website. can in mode or b, , depending on mode, buttons different things.

would using rails.cache.read , write best option ? i've heard has issues heroku if leave cache filesystem, has problems memcache because of multi-threading ?

i'm trying avoid having whole table on db getting used users checking global state of site each request.

in order have "global" state, need create singke dependency each instance of application.

in fact, can't rely on cookies or sessions, client-oriented , not shared between clients.

the database common approach. may able use file system in cases, not heroku there may several different instances of app running under different file systems.

any solution can shared across instances work:

  • memory database redis
  • sql or nosql database
  • cache systems, long not specific 1 instance. memcached may work, it's not persistent (hence may lose state)
  • external storage (such amazon s3)

to me, relational database or memory database such redis seems plausible solution.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -