Design Change Data Capture From Sharded MySQL Into the Warehouse
Last updated: November 29, 2026
Quick Overview
Design a pipeline that streams every insert, update, and delete from thousands of MySQL shards into the data warehouse, so analysts get daily snapshots and near-real-time tables of product data.
Meta
November 29, 20260
0
0 solved
Design a pipeline that streams every insert, update, and delete from thousands of MySQL shards into the data warehouse, so analysts get daily snapshots and near-real-time tables of product data.
Meta's product data lives in sharded MySQL while analytics runs on warehouse tables, and data engineering loops ask how to bridge them without hammering production databases. Interviewers look for binlog tailing, ordering, schema changes, and snapshot reconstruction.
What the Interviewer Expects
- Tail binlogs instead of querying production tables
- Preserve per-row ordering
- Build snapshot tables by merging change logs
- Handle schema changes and backfills
- Verify completeness
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How do you bootstrap a new table that already has 10 billion rows?
- What if a shard fails over to a replica mid-stream?
- How would you serve a 'state as of 3 pm yesterday' query?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: capture all row changes; produce a daily partitioned snapshot per table and a changelog table; optional streaming tables with minute-level latency.
Non-functional: no extra load o...
High-Level Design
- Binlog tailers run next to replicas (not primaries), reading row-based binlog events and recording GTID positions.
- Events go to a stream (Kafka-like) partitioned by
(table, primary key)...