~/talk

The Very Hungry Transaction

Talkat Helvetic Ruby 2024 · on Friday, 2024-05-17· [databases, software-architecture]
slides:none on file

A small order save grows into recurring deadlocks, lock timeouts and exhausted DB connections after inventory updates, background jobs enqueued before commit flood queues with retries, and an external fulfillment HTTP call inside the transaction stalls all database activity. Fixes shown include adding a missing index to avoid slow updates, moving external work out of transactions, swapping after_create for after_create_commit, using transaction instrumentation (Rails 7.1) and upcoming Rails 7.2 enqueue-after-commit behavior, and splitting or sequencing cross‑database work.

AI-written summary · about

  1. 0:00Introduction to Cat’s story
  2. 1:04The growing transaction problem
  3. 3:16Adding inventory checks
  4. 5:01Lock contention in transactions
  5. 10:00Slow transactions and background jobs
  6. 14:13External API calls in transactions
  7. 18:43Database connection exhaustion
  8. 20:08Splitting databases for scale
  9. 24:23Lessons learned from the week
  10. 27:11Fixing the transaction incrementally
  11. 29:00Preventing transaction creep
  12. 31:33Summary and Q&A
~/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.