~/talk

Putting Rails in a corner: Understanding database isolation

Talkat RailsConf 2018 · 2018-04-17..04-19· [ruby-on-rails, databases]
name:Emil Ong
github:emilong
slides:none on file

Explains concrete fixes: Rails 4 lets transactions take an isolation param so databases trade read committed vs repeatable read vs serializable for performance; a race in a “Congrats!” app (Reese signs while Dana removes) shows ActiveJob reading outside a transaction, so pass the card I.D., reload inside the transaction, or add a committed_to_send flag to make sending idempotent. Serialization failures surface as ActiveRecord::StatementInvalid (DB-driver specific). Tests must avoid transactional fixtures to change isolation — use truncation and heavy load or randomized sleeps to reproduce issues.

AI-written summary · about

  1. 0:00Intro
  2. 1:25Who is this talk for
  3. 3:14Context
  4. 6:53Simultaneous events
  5. 9:26Why are we in inconsistent states
  6. 10:20Isolation levels
  7. 11:52Read Committed
  8. 13:44Serializable
  9. 15:43Parameter changes
  10. 16:26Active record
  11. 17:31Active job
  12. 19:38Commit to send
  13. 21:00Loops
  14. 24:35Tests
  15. 26:33Review
  16. 27:10Conclusion
~/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.