Design a Change Data Capture Pipeline From Spanner to BigQuery

Last updated: November 29, 2026

Quick Overview

Design a pipeline that streams every insert, update, and delete from a large Spanner database into BigQuery so analysts can query a near-real-time replica and full change history.

Google
System Design
Data Engineer
Google
November 29, 2026
Data Engineer
System Design Round
System Design
Hard

0

0

0 solved


Design a pipeline that streams every insert, update, and delete from a large Spanner database into BigQuery so analysts can query a near-real-time replica and full change history.

A hard data platform question in Google Cloud style. The interviewer probes ordering per key, transactional boundaries, how you apply updates to an append-optimized warehouse, schema changes, and how to bootstrap and verify the replica.

What the Interviewer Expects
  • Read changes via change streams with commit timestamps
  • Preserve per-key ordering and transactional metadata
  • Maintain both a changelog table and a current-state table
  • Bootstrap with a consistent snapshot then switch to the stream
  • Handle schema changes and deletes correctly
  • Verify replica correctness with checksums
Key Topics to Cover
change streams
commit timestamps
merge upserts
snapshot bootstrap
schema evolution
idempotency
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How do you avoid a gap or overlap between the snapshot and the stream?
  • How would you apply updates if BigQuery DML quotas are tight?
  • How do you handle a column type change in Spanner?
  • How would you expose 'state of the table as of yesterday at noon'?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements
  • Source: Spanner with 50 tables, 10 TB, 100k writes/s peak.
  • Targets in BigQuery: a _changelog table per source table (append only) and a _current table mirroring source state.
  • Freshness: chan...
High-Level Design
  1. Spanner change streams emit data change records with commit_timestamp, server_transaction_id, record sequence, modification type, keys, and new (optionally old) values.
  2. Dataflow read...

Submit Your Answer
Markdown supported