Selected work

Public reference · Data platform

MongoDB CDC to S3 with Recovery and Backfill

A configurable ingestion service for snapshots, live change streams, scheduled collections, and targeted repairs into partitioned object storage.

Type
CDC and recovery platform
Role
Architect / engineer
Status
Public and runnable
Focus
Durable ingestion, repair, object storage
PythonMongoDBAmazon S3GZIP JSONLChecksumsMultipart uploadsBackfillsStreamlit
System map

The operating path.

A deliberately simplified architecture view. The case study below explains where the important guarantees and decisions live.

  1. 01MongoDB
  2. 02Snapshot + stream
  3. 03Buffered writer
  4. 04GZIP + checksum
  5. 05S3 / local store
  6. 06Validation + recovery state

The problem

Why this system needed to exist.

Moving operational data into object storage is easy in the happy path. The real design work appears when a process stops mid-batch, a resume token gets ahead of the data, a historical range needs to be replayed, or a handful of records need targeted repair.

A useful ingestion platform needs one operational model for snapshot, streaming, scheduled batch, validation, restart, backfill, and patch workflows.

The system

How the pieces work together.

The service supports initial snapshots, continuous MongoDB change streams, scheduled collection loads, and targeted patch commands. Records are buffered into partitioned GZIP JSONL objects and written either to Amazon S3 or a local object store.

Validation metadata and SHA-256 checksums are written with each object. Recovery state advances only after both the data object and its metadata are durable, so a restart can replay from the previous safe boundary.

01

Durable recovery boundary

State is committed after data and validation metadata are written. A process failure can replay records, but it cannot silently acknowledge an object that does not exist.

02

Operations are first-class

Backfill and patch workflows use the same writer and validation path as normal ingestion instead of becoming one-off scripts with different guarantees.

03

Portable storage path

A local object-store mode makes the system inspectable without AWS credentials while the production shape supports standard S3 and compatible endpoints.

Source boundary

This public repository preserves the recovery and operational design of a production system while replacing product names, infrastructure identifiers, and source data with a local synthetic demonstration.

A system like this on your roadmap?

Let’s make the hard parts explicit.

Discuss the project