Okay, so I love Rails. But, Rails has an issue with scaling. A fresh install of Rails for instance comes with sessions implemented in the file system. That's all well and good for a development box, the issue arises when you're serving more than a small number of clients.

Serializing data shared by processes in a file is doable. You can use identity stamps and all that jazz, but it slows things down I imagine.

So the alternative is using my favourite ... tables! Or in our case ActiveRecord, the layer of ORDBMS on top of your database.

It's quite simple. All you need to do is find this line in your config/environment.rb and uncomment it.

After this is done, set up the tables by running.

rake db:sessions:create
rake db:migrate

Toggle the code!


Alrightie then, first rule of entrepreneurship, don't believe in technology (hype). Hmmm, so the ActiveRecord method of storing sessions that Rails ships with is not so good.

Rails is excellent to say the least in the development environment, but production on the other hand involves a lot of fun.

Right now, I'm going to settle for a 60GB hard-drive 1GB memory 15 inch wide screen Xubuntu production box.

Also, for production sake, the alternative's to the ActiveRecord method of storing sessions; you could use SQLSessionStore for sessions, or better still the better performing memcached.

I'm reading this article on how to deploy Rails on a mongrel cluster and Apache.