Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ok - I am using the session to speed up performance - by keeping around an object that is central to a user's workflow for just about every request w/o going back to the db for it.

Are you suggesting that going back to the db each time is more scalable, or that I am better off using some kind of method level cache?

Honestly - just wondering - any good articles on what you are discussing? I guess I just don't quite 'get' it - not having worked on an application that scaled to the point that session access was the bottleneck.



Are you suggesting that going back to the db each time is more scalable, or that I am better off using some kind of method level cache?

Yes and yes.

This is a really long and deep topic. There are all sorts of reasons why sessions are not a good idea. But let's stick to scalability.

If you're using your session as a sort of cache for objects, that's probably okay (although, consider using something designed for this, like memcached). The point is, you ought to be able to reconstruct all the objects you need from just the request parameters.

This is a pretty good article about it all.

"Session State is Evil" -- http://davidvancouvering.blogspot.com/2007/09/session-state-...


Yep, sessions are nice when your site is in the 1-5k visitors per day range, but don't seem to scale much beyond that. (coming from an RoR background here)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: