Pattern community intermediate
Incremental Batch with a Watermark
Full reloads are too slow and too expensive once a table grows past millions of rows.
At a glance
| What | Full reloads are too slow and too expensive once a table grows past millions of rows. |
|---|---|
| When | Append-mostly sources; Cost-sensitive pipelines; Deterministic event/updated timestamps |
| Where | Batch Processing |
Problem
Full reloads are too slow and too expensive once a table grows past millions of rows.
Solution
Process a window that ends at a watermark and starts a lookback before it. scan from (max(watermark) - lookback) to now The lookback absorbs late arrivals; the watermark bounds the work. Write idempotently (partition overwrite or MERGE) so a re-run is safe. Handle deletes explicitly (soft-delete or periodic full refresh) — they don't arrive in an append-only stream.
When not to use
- Little history
- Frequently mutating data without a reliable change marker (use CDC)
Security scan
Last sweep 2026-10-24: 0 finding(s), 0 marked as examples.
Context
A batch pipeline reading an append-mostly source that has an updated_at/event time.
Forces
- Cost grows with history size
- Late-arriving rows must not be lost
- Re-runs must be safe
- Deletes may never be seen
Tradeoffs
| Choose this when | Costs & caveats |
|---|---|
| cost scales with new data, not history | lookback trades correctness for cost; too short loses late rows |
- watch: a naive is_incremental() without a lookback silently drops late data
Diagram
[max(updated_at) - N days] ─────▶ [now]
lookback watermark
Registry stats
| Verification | community · Sep 26, 2026 |
|---|---|
| Completeness | 75 |
| Trust multiplier | ×1.25 |
| Composite | 37.25 · adequate |
| Freshness | 28 days since last source check |
| Difficulty | intermediate |
| Version | 1.2.0 |
| License | CC-BY-4.0 |
| Security flags | none |
Did this solve your problem?
Incremental Batch with a Watermark