Airbnb Builds a Capture-and-Replay System for Production Database Traffic
Sarah
Airbnb's engineering team has described how it replays real production database workloads to test upgrades and capacity, a signal of how the platform de-risks infrastructure changes.
The problem
Airbnb's earlier query-capture setup was fragmented across Java, Python and Ruby bindings, each with its own logging framework. That meant unclear ownership, poor scalability across its service-oriented architecture, and no reliable way to replay full transactions or verify result consistency. The team wanted one approach for load testing with production traffic, validating query compatibility across database upgrades, and debugging performance.
The approach
The new system captures traffic at ProxySQL, the open-source MySQL proxy already sitting between applications and databases, so no application changes are needed. It has three parts:
- Log Mover: a sidecar that moves ProxySQL's disk logs to cloud storage with minimal performance impact.
- Log Processor: an offline pipeline that parses binary logs, groups queries by backend cluster, reassembles transactions, buckets them by timestamp and rewrites INSERT statements to preserve auto-increment values.
- Log Replayer: an API server (control plane), a replay task scheduler and replay workers that scale horizontally to thousands.
Results
- In a MySQL 5.7 to 8.0 upgrade, replay exposed regressions before production, including one query pattern whose latency rose "from 0.03 to 2.6 seconds, reading 273 MB per join instead of 5 MB". It also surfaced non-deterministic query ordering issues.
- For capacity planning, replaying 80% more write traffic on a large cluster "pushed average commit latency up by almost 500% from about 6 ms to 34 ms", which supports scaling decisions ahead of peak seasons.
The post is authored by Zuofei Wang and Erluo Li.
Source: Airbnb Tech Blog