In doing some optimization for the back-end of the top selling iPhone application Word with Friends we put Cache-Money a write-through caching library for ActiveRecord to the test. So what exactly does that mean?
Read-Through:
Queries like User.find(:all, :conditions => ...) will first look in Memcached and then look in the database for the results of that query. If there is a cache miss, it will populate the cache.
Write-Through:
As objects are created, updated, and deleted, all of the caches are automatically kept up-to-date and coherent.
Add to this that cache-money also supports multiple query types, multiple indices, ordered indices, window indices, calculations, version numbers, transactions, rollbacks, mocks, locks and local caches, and it gets impressive pretty quick. If you are looking for caching to optimizing. Show me the money.. er cache-money.
I’ve used Cache-Money in the past and KCRUG even video’ed my presentation.
I wonder, though, if it’s maintained or what it would take to port to Rails 3.
If there is no “no-code” solution for Rails 3, that would be a pity.
Do you know answers to either of these?
My videos:
http://www.vimeo.com/4927794 (part 1)
http://www.vimeo.com/4937895 (part 2)
Last week I launched a new write-through-cache gem for Rails 3, see https://github.com/orslumen/record-cache.
The reason I built it, is because we were using cache money and recently migrated to Rails 3. So chances are it may also serve you well.