Beyond CRUD: the PostgreSQL techniques your Rails app is missing.
summary
A production outage drops hourly jobs when redis schedules temporarily vanish and a race crashes the scheduler; the fix moves dynamic schedules into Postgres as the source of truth, uses optimistic concurrency control to get at‑most‑once delivery, applies skip_locked updates to cut P99 lock time from 1.5s to ~100ms, and employs advisory locks for coordinated work. Timeouts, connection-retry patches and a small PG adapter gem round out the changes and the rollout succeeds to all customers.
AI-written summary · about
chapters (6)
- 0:00Start
- 2:49Overview
- 8:18Scheduling an Action
- 15:49Back to first principles
- 17:24New Scheduler System
- 29:21Timeouts, Reconnects and Retries
related talks
30mPuny to Powerful PostgreSQL Rails Apps
43mJust Use Postgres.
46mUse PostgreSQL, not Rails, to make Rails Faster!
51mHow Postgres is misused and abused in the wild
39mPostgres & Rails 6 Multi-DB: Pitfalls, Patterns, Performance
01h 01mNew Approach to Resolve objectrelational impedance mismatch
31mMaking Data Dance
42mPostgres: stories that will scare you
