Django 1.4 offers several ways to maintain django sessions :
My viewpoint on using :
i) cache only : Not preferable, users sessions may get purged out of memcache.
ii) Db + cache (cached_db
): Preferable , simple and secure solution.
iii) Signed cookie sessions : Preferable, no database hit .
Assuming that the session data is very small i.e. no problem in storing it in cookie. Is there any performance benefit of using signed cookie over a database + memcache driven session engine ? As for N concurrent new users, there would be order of N database hits saved. This will reduce total queries that the database server has to handle per unit time.
UPDATE : We found redis or aerospike as really robust and high throughput session backends for django. We are using redis
as sessions
backend
You must be able to handle N concurrent queries (N - concurrent new users).
You see the difference at a very large scale only. You must be pessimist (server is down, bad buckup, amazon bancrupcy ) and your database must be able to handle all users in rush hours.
I use redis backend (periodic save to disk) with the possibility of switching to a cluster of memcached services.
http://www.icis.com/blogs/icis-chemicals-confidential/files/2011/10/19/goodcheapfast.jpg