Solid Cache: A disk backed Rails cache
summary
Built a database-backed ActiveSupport cache that runs on MySQL shards, stores hundreds of millions of rows (about 600M records per DB, ~12 TB per datacenter), and replaces Redis for large, cheap caching. Reads average ~1 ms and writes ~1.4 ms versus Redis ~0.7/0.9 ms, storage cost drops to ~25% and cost per million items is ~20× cheaper. Uses FIFO expiry with an ID-window sizing heuristic (background job every 80 writes deletes 100 oldest), flatlining table growth and cutting page load times ~40%.
AI-written summary · about
chapters (11)
- 0:00Introduction to Solid Cache
- 1:50Design goals for Solid Cache
- 8:12Expiry algorithms and trade-offs
- 16:41Real-world performance results
- 20:56Installation and configuration
- 21:3937signals implementation details
- 24:52Performance comparison with Redis
- 26:23Cost savings and storage efficiency
- 27:46Cache miss rate improvements
- 29:09Application speed impact
- 30:14Conclusion and benefits
related talks
36mCache is King
33mWhat the Cache?!
37mCache is King: Get the Most Bang for Your Buck From Ruby
10mHigh Perfmance Caching with Rails
24mFrom Expensive Queries to Smart Caching: A DBA’s Guide for Rails
15mAccelerate Application Response Times with True Cache
34mCache = Cash! 2.0
43mCaching half a billion user transactions
