iddrew1
September 15, 2014, 12:10pm
1
This post was flagged by the community and is temporarily hidden.
jess
September 15, 2014, 1:50pm
2
Hello,
On our SaaS ENV, we use the query cache mechanism which makes an educated decision whether to use the master or slave.
if something was not updated recently it goes to slave, otherwise to master.
Committed a document about this here:
General
=======
The query cache is a generic mechanism for caching the results of database queries using memcache.
The query cache uses a single shared memcache that will be added to each datacenter (not machine local memcaches).
How does it work?
Example:
========
mysql> select * from flavor_asset where entry_id=x and partner_id=y and ...
The first time this query is performed, it will get to the database. After the query completes and the Propel objects are populated, the objects are serialized and stored to the memcache. The key used for caching is a function of the query string: QCQ-<query type>-<md5(serialize($criteria))>, where query type is 'sel' for doSelect and 'cnt' for doCount (we use serialize($criteria) to avoid building the query string unnecessarily). The next time the same query is performed it will return the results from the memcache.
What is the performance gain?
=============================
Complex select queries that have several conditions / count queries will be replaced by a simple retrieveByPK-like query on the memcache.
The query cache stores serialized objects, saving the time of the Propel hydration process.
This file has been truncated. show original
Feel free to try it and let me know if you have issues. For additions to the doc, please make a pull request.
Thanks,
iddrew1
September 16, 2014, 9:55am
3
This post was flagged by the community and is temporarily hidden.