~/talk

Oh S***: How to bring a big Rails website down (and how not to)

Talkat LA RubyConf 2010 · 2010-02-19..02-20· [ruby, devops-and-delivery]
links:none on file
slides:none on file

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

  1. 0:00Start
  2. 1:15A bit about Scribd
  3. 2:47Rules of thumb
  4. 6:02The problem with find_in_batches
  5. 10:11The problem with validates_uniqueness_of
  6. 19:33The problem with delete and destroy
  7. 25:46The problem with indexes
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.