Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Continuous Table Merge into NoSQL

Merge two independently changing hundred-million-row sources into one queryable NoSQL projection without losing snapshot or CDC updates.

Problem statement

For this exercise, assume that a consumer reads a merged record while backfill and live changes from two large source tables continue concurrently. Load an initial consistent snapshot of both source tables without one unbounded query. Consume ordered change events for inserts, updates, and deletes from both sources.

Upsert one deterministic merged NoSQL record and expose its source versions. Detect missing ranges or divergence and refill only affected partitions. Each source contains more than 100 million rows and changes continuously at a combined peak of 50,000 rows per second.

The merged projection should reflect ninety-nine percent of accepted source changes within two minutes. Backfill may run for days, workers may replay events, and a partition or consumer may fail without dropping acknowledged source changes.

Preserve this invariant: an older snapshot row cannot overwrite a newer CDC change, and replaying the same source version is idempotent. Keep unrelated product features and company-specific infrastructure outside the first version.

What to build

  1. Load an initial consistent snapshot of both source tables without one unbounded query.
  2. Consume ordered change events for inserts, updates, and deletes from both sources.
  3. Upsert one deterministic merged NoSQL record and expose its source versions.
  4. Detect missing ranges or divergence and refill only affected partitions.

At scale

  • For this exercise, each source contains more than 100 million rows and changes continuously at a combined peak of 50,000 rows per second.
  • For this exercise, the merged projection should reflect ninety-nine percent of accepted source changes within two minutes.
  • For this exercise, backfill may run for days, workers may replay events, and a partition or consumer may fail without dropping acknowledged source changes.