Safely Decomposing a Highly Available Rails App
summary
A 100,000-line legacy Rails monolith gets a new Rails 4.1 API app and is validated by an in-process quackery proxy that dual-calls old and new code so responses can be compared; heavy use of double-writing via rolled-back DB transactions lets non-idempotent endpoints be checked against real state while sharing one PostgreSQL database. Performance work uses PG Bouncer, OJ, rails_api, nginx + unicorn and short caches to hit single-digit millisecond requests. The DB split proceeds with a read‑only mode, leaving only minutes of degraded noncritical UI and jobs.
AI-written summary · about
chapters (12)
- 0:00Start
- 0:36Decomposing a Highly Available Rails App
- 1:18Context
- 3:22High-Level Strategy
- 6:52Connection Overhead
- 8:13Code Correctness
- 8:46Shared Context
- 10:22Proxy Layer
- 15:19Split the Database
- 16:04Db Dump and Reload
- 17:35Optional Auditing and Analytics
- 18:11Read-Only Mode
related talks
32mRefactoring Legacy Apps with APIs and Messages
56mScaling Rails API to Write-Heavy Traffic
36mWorking Compassionately with Legacy Code
27mScaling a Rails Monolith w/Event Driven Microservices
42mHow Rails fosters a diverse and competitive tech ecosystem in the era of big tech
26mMonolith-ifying perfectly good microservices
27mFrom multiple apps to Monolith
32mHow I architected my big Rails app for success!
