data engineering

3m read · 526 words

Design

Streaming ingestion

Transactional outbox delivers to CDC

  1. CDC
  2. Idempotent sink
  3. Checkpoint
  4. Dedup in window
  5. Apply watermark (allow late events before closing a window)
  6. DLQ - quarantine records that can't be parsed
  7. Replay and backfill wrong output from retained input

Batch ingestion

Handle

Change merge heavy workloads to append only workloads. It will avoid file rewrites.
Then, create materialized views on the data for read snapshots.

Questions

How to ingest and process over 1 million events per day efficiently?

Napkin math: 1million per day = 10 events/sec (trivial scale)

Design around durability, replayability, batching, cheap storage

Layers

Scenarios

Handling late arriving data

Streaming

Use watermarks. Watermark is a threshold of how long to wait for late data.

Data within watermark is merged into correct time window.

Batch

User MERGE INTO instead of INSERT

TODO: write about early fact / late dimenstion scenario

Colophon 526 words · 3m read
Written as a markdown note in Obsidian. Built into this page by a Python script on 2026-10-02.

Pages