Shopify

IdentityCache: Improving Performance one Cached Model at a Time - Shopify

Apr 4, 2013
IdentityCache: Improving Performance one Cached Model at a Time - Shopify
SummaryAI, from the source post

Introduced IdentityCache, an open-sourced library for caching ActiveRecord models in Memcached. IdentityCache acts as a read-through cache, fetching from Memcached first and then the database on a miss, storing the result in Memcached. It automatically handles cache expiration via `after_commit` hooks and supports caching single objects, associations (`cache_has_many`, `cache_has_one`, `cache_belongs_to`), and embedding associations within parent objects. The library allows for defining custom indexes for accessing models and aims to reduce database read operations significantly, as demonstrated by performance improvements during flash sales.

More from the Data Store Selection and Usage trail