From Expensive Queries to Smart Caching: A DBA’s Guide for Rails
summary
Shows concrete fixes: use ProxySQL to front tens of thousands of Rails connections and limit back-end DB sockets, use ReadySet as a CDC-driven smart cache that serves heavy queries at microsecond latency, and keep query rewrites and stats in-place for fast triage. Gives numbers: spikes from 7,000 to 38,000 connections, ReadySet handling ~30,000 reqs/sec and a fleet dropping from 32 cores to ~2 for many workloads. Includes a Docker Compose demo repo and real production wins reducing load and cost.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 2:56Rails and MySQL in production
- 3:38Active Record connection pooling
- 5:23Viral traffic with MySQL
- 6:26Object relation mapping magic frustrations
- 7:52Cache invalidation pain
- 8:54Smart pooling with ProxySQL
- 11:46ProxySQL troubleshooting
- 13:55Slow queries with ProxySQL
- 15:22SQL commenter for Rails
- 16:04ReadySet for smart caching
- 18:31ReadySet reduces load
- 20:19Offloading reads to ReadySet
- 21:03ReadySet handling 30,000 requests per second
- 23:10Demo and resources
- 23:53Q&A
related talks
31mA Rails performance guidebook: from 0 to 1B requests/day
31mSolid Cache: A disk backed Rails cache
33mCache is King: Get the Most Bang for Your Buck From Ruby
14mDatabase Performance at Scale for RoR Applications
29mA Rails Performance Guidebook: from 0 to 1B requests/day
33mWhat the Cache?!
29mScaling Rails to 2M MySQL requests per second
41mUsing Databases to Pull Your Application Weight
