~/talk

Off to the races

Talkat RailsConf 2023 · 2023-04-24..04-26· [web-performance]
speakerdeck:doliveirakn
slides:none on file

Claim: Rails apps lose increments when two requests do a read modify write on the same row, exemplified by an ideas voting counter that drops votes. Reproducers: add sleeps, use a redis flag to stall one process, or use rspec and wrap original to load an out‑of‑date record. Fixes shown: use atomic operations (SQL increment or redis INCR), optimistic locking via lock_version (raises active record stale object error), pessimistic locking with transaction+lock, or distributed locks like redlock / with_advisory_lock or upsert/rescue ActiveRecord record not unique; each trades latency or complexity.

AI-written summary · about

  1. 0:00Start
  2. 19:52Important note
  3. 29:01Removing the critical section
  4. 30:26Detect and Recover
  5. 31:22Protect critical section
~/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.