i tend to structure applications - python, php, whatever - like this:

- I use multiple Database Handles.  This is always at least a "reader"
and a "writer".  On the database level, the reader is privileged to
only select from databases, while the writer may read and write.  If
the application needs a clustered database, the writer points to
Master while the Reader points to Slaves.  In terms of database
connectivity, "Readers" are also non-transactional, while "Writers"
are transaction safe.

- Whenever visitors deal with "/account" administration, I always read
off the Master and use per-request database queries.  I never use
cached data.

- Whenever visitors deal with consuming content , everything is
sourced from the "reader".

- On login and preference updates, I cache the core user data.  I
prefer to put this in Memcached ( though now exploring MongoDB and
Riak ), and only use the cookie based "Session" for account
identifiers and user-flow logic.  I also time this cached data for
10-20 minutes and then force a refresh.  The reason for this - if
someone is browsing on 2 devices, or home & work, they would have 2
different session ids.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to