"ACID's extasy"
summary
Service objects wrap business actions and guarantee rollback to a predictable state by using database transactions and the Rails option requires_new: true for nested calls; after-commit work is deferred via a pub/sub pattern implemented with the whisper gem and an around_action that collects callbacks, avoiding enqueuing jobs inside uncommitted transactions. For external APIs the system plans compensating requests and relies on idempotency keys; prefers explicit success/error flows over blind callbacks.
AI-written summary · about
chapters (15)
- 0:00Introduction and speaker
- 1:28Data inconsistency pitfalls
- 3:00Service objects and business logic
- 5:12Service objects core principles
- 7:24Database transactions basics
- 8:28ACID properties explained
- 9:54Nested transactions
- 11:21Error reporting in transactions
- 13:53Safe zones and pub/sub
- 14:13Background jobs and isolation
- 16:48Handling job failures
- 17:29External API calls and compensation
- 21:47Recap and data consistency
- 22:29Exceptions vs flow control
- 22:52Q&A session
