Note the ordering in the MultiStore declaration: the SqlAlchemyStore comes last, since it acts as the final persistence layer.
Subsequent ‘get’ requests will attempt process memory, then attempt memcache, and finally check the database.

Also, we can treat the process memory cache and the memcached differently by using different expirations.
For example, you may want process memory to expire quickly, but memcached to last a little longer since
you can actually keep it consistent across multiple machines. This example
forces Foo objects to be expired more aggressively from the local memory than memcached: