Jun 26

I have been trying to determine strategies for implementing sessions via Ruby on Rails. I am particularly concerned about scalability and session replication across multiple servers in large scale sites. What is the proper choice? Here are some options for session management with Rails:

  1. No session
  2. PStore
  3. ActiveRecordStore
  4. MemCacheStore

Using PStore writes to a local file system, which doesn’t scale across multiple servers unless it is a shared directory visible to them all. This isn’t very practical across multiple data-centers. ActiveRecordStore uses a DB which means each access of the session objects may use DB resources. Again this isn’t scalable.

Thus, MemCacheStore looks like the way to go for most web applications. There is a great discussion of it by Stefan Kaes.

Anybody else using another solution?

One Response to “Rails Session Management”

  1. Lakhan says:

    hi there,
    can i get the code for proper session management in rails, as I’m new to rails.
    Any help is appreciated
    thanks in advance..!!!

Leave a Reply

preload preload preload