~/talk

The Very Hungry Transaction

Talkat Blue Ridge Ruby 2024 · 2024-05-30..05-31· [databases, ruby-on-rails]
slides:none on file

Shows concrete failures and fixes: Rails ActiveRecord save opens a transaction that can deadlock without an index on SKU, thousands-item orders create hundreds or thousands of locks, external HTTP calls (fulfillment) or queueing jobs inside a transaction exhaust DB connections, and after_create enqueues jobs too early — use after_create_commit instead. Demonstrates measurable thresholds (hundreds vs thousands of records, seconds of transaction time), tooling (Rails 7.2 callbacks, isolator gem, DB performance schema) and practical fixes that make the system work again.

AI-written summary · about

  1. 0:00Introduction
  2. 1:52Growing transaction problem
  3. 4:00Lock contention
  4. 8:39Slow transactions cause failures
  5. 11:09Move work out of transactions
  6. 15:22External calls in transactions
  7. 21:35Database overload
  8. 24:49Split transactions across DBs
  9. 27:57Risks of massive transactions
  10. 30:45Writing safe transactions
~/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.