Ask YC:how do you do Sessions on EC2?
I have been thinking of implementing a replacement session handler for PHP you can see more here.
http://us3.php.net/session_set_save_handler
my custom version would be for ec2 s3 and or simpleDB so that I can do RRDyDNS and have session state stored between server instances for load balancing.
I was wondering what the crowd thought, and how some of you might be tackling the sessions problem on ec2? DB?
12 comments
[ 2.1 ms ] story [ 19.0 ms ] threadhttp://www.socialtext.net/memcached/index.cgi?sessions
I haven't used simpledb yet, but as far as I understand it seems like it could be a good use case for replacing the replicated database piece.
it looks like a cool path would be:
# support s3
# support some cache (memcache/ThruDB)
# support SimpleDB with cache
Now, assuming you are also hosting your web servers on EC2, I would recommend using neither S3 or SimpleDB for hosting sessions. S3 is more appropriate for static data, and SimpleDB is still in early Beta (as in, the API is subject to change and you have no SLA).
Session data is largely meant to be ephemeral. Consider using a standard MySQL (or similar) session backend with a circular hash for distribution to different nodes. Unless you are doing a ton of traffic, you can get by with a single machine running the session backend. The MySQL backend scales to a lot of concurrent users.