Beyond synthetic testing: Capturing and replaying real database workloads at Airbnb
Airbnb replaced fragmented per-language client-side query logging with a client-agnostic capture point in ProxySQL, so real production MySQL traffic can be replayed offline. A Log Mover sidecar ships ProxySQL query logs to object storage. A Log Processor splits them per cluster, reassembles transactions, buckets them into five-minute windows and rewrites INSERTs to pin last_insert_id. A queue-driven fleet of replay workers then uses shared start times to reproduce the original concurrency and pacing, at 1x or accelerated speeds. Replay-and-compare runs during the MySQL 5.7→8.0 upgrade caught a 0.03s→2.6s sort regression, duplicate queries the query cache had been hiding, and non-deterministic ORDER BY/LIMIT results. Accelerated replays locate capacity ceilings, for example commit latency rising from 6 ms to 34 ms at 80% more write traffic.
Related posts
- We replaced Redis with MySQL for inventory reservations—and it scaled
Shopify Engineering mediumAdeptShopify moved checkout inventory reservations from Redis to MySQL by modeling one row per sellable unit and using SELECT ... FOR UPDATE SKIP LOCKED, so concurrent checkouts grab different rows without contention while reservations and the inventory ledger share ACID transactions. Key fixes included a bounded pool of 1,000 rows per item/location with locked inline replenishment, a composite primary key that halved row locks, READ COMMITTED to avoid gap/supremum locks, consistent lock ordering to prevent deadlocks, and UNION ALL batching. The real throughput ceiling turned out to be database connection exhaustion from other checkout code, found by tagging SQL with caller comments and measuring hold time in ProxySQL; cleanup cut 50% of reads and 33% of transactions, and raising InnoDB thread concurrency removed the limit. Cutover used dual-write shadow mode with a kill switch and gradual pod-by-pod rollout.
- Rebuilding Linear’s delta sync read path
Linear mediumAdept
Linear moved its delta sync read path, which lets reconnecting local-first clients fetch only changes since their last checkpoint, from a Postgres table to turbopuffer inverted indexes. On Postgres, the reconnect query combined a widening ID range with array-overlap predicates for sync groups and subscriptions, which drove up CPU and made p95/p99 latency volatile. Read replicas didn't help because the per-request intersection work stayed the same. turbopuffer stores per-workspace posting lists of sync action IDs and intersects them directly, fed by a custom CDC pipeline with about 1s p50 replication lag. Reads run as a metadata scan with late payload enrichment from Postgres, Postgres serves an overlapping authoritative head slice with deduplication and fallback, and shadow-mode comparison verified correctness. Tail latency now stays flat as workspaces grow.
- Scale without limits: Multigres, OrioleDB, and dbarena
Supabase easyNoviceSupabase launched three Postgres scaling efforts. Multigres, from the Vitess team, adds built-in connection pooling and automated failover across three availability-zone nodes, using a consensus protocol over synchronous replication so no committed write is lost. It is in private alpha. OrioleDB, in public beta, is a storage engine that replaces heap storage with a page-level undo log, removing bloat and the need for VACUUM, and uses 64-bit transaction IDs to avoid wraparound; it reports up to 1.8x heap throughput on TPC-C-derived benchmarks and can be chosen per table with USING orioledb. dbarena publishes reproducible, cost-normalized benchmarks comparing Supabase, RDS and Cloud SQL.
- Introducing Postgres Query Insights in ClickHouse Cloud
ClickHouse mediumAdept
Postgres Query Insights, now in preview for ClickHouse Cloud Managed Postgres, ranks every normalized query pattern by impact and aggregates per-execution counters (CPU, cache vs disk reads, temp spills, unlaunched parallel workers, WAL) to explain why a pattern is slow. A worked example traces a p99 regression to a sort spilling to disk, confirmed with EXPLAIN (ANALYZE, BUFFERS) and fixed with an index or work_mem tuning. Telemetry comes from pg_stat_ch, an Apache 2.0 extension that normalizes literals at parse-analyze time so values and PII never leave the database. It enqueues raw per-statement events via a non-blocking try-lock on a shared-memory ring buffer at about 3% overhead, dropping events under pressure rather than back-pressuring Postgres.
- Turso 0.8: Concurrent writes without SQLite's single-writer bottleneck
Turso mediumAdeptTurso 0.8 targets SQLite's single-writer bottleneck with BEGIN CONCURRENT, an MVCC mode where transactions start independently and commit in groups. At 1,000 TPS with Poisson arrivals, p99.9 latency is 2.4 ms at 32 connections versus 1.2 s for SQLite, whose lock-retry sleeps inflate tail latency. On disjoint-key inserts, Turso scales to about 9,500 TPS at 64 connections while SQLite stays near 1,370 TPS, though SQLite is faster with a single connection. The release also adds full window function and recursive CTE support, MVCC-compatible full-text search, and optimizer work including correlated subquery unnesting, hash joins and JSON EXPLAIN QUERY PLAN output.