Oh S***: How to bring a big Rails website down (and how not to)
summary
Scribd-scale numbers (≈40M monthly users, 50k uploads/day, tens of millions of rows) expose concrete Rails+MySQL failures: a quick change to validates_uniqueness plus lower(login) turns signup validation into a 2‑minute query; find_in_batches breaks on composite primary keys (fixed by a find_in_batches monkey patch); association.delete_all can null FKs instead of removing rows so use ActiveRecord delete_all when you need a SQL DELETE; missing composite indexes (eg. on user_id,deleted_at) forces use of USE INDEX/ FORCE INDEX or a functional index in Postgres; always run EXPLAIN and test on large datasets.
AI-written summary · about
chapters (7)
- 0:00Start
- 1:15A bit about Scribd
- 2:47Rules of thumb
- 6:02The problem with find_in_batches
- 10:11The problem with validates_uniqueness_of
- 19:33The problem with delete and destroy
- 25:46The problem with indexes
related talks
26mBiggish Data With Rails and Postgresql
20mCRUD! The Consequences of Not Understanding How ActiveRecord ...
29mScaling Rails to 2M MySQL requests per second
34mToo Big to Fail
43mSecuring Your Rails App
48mOn the Edge of Rails Performance
31mA RAILS PERFORMANCE GUIDEBOOK
37mCache is King: Get the Most Bang for Your Buck From Ruby
