Commerce CDC
Data engineering
Keeping warehouse history correct when database changes arrive late.
An incremental commerce warehouse with customer history, current orders and a paid-revenue view. It rebuilds affected entities, independently checks published rows and repairs drift from its source journal.
Engineering focus
Source-order history, zero-write replay and atomic publication. An independent Python reconstruction checks the SQL output; an explicit repair rebuilds derived tables without changing the journal.
Technology
Python · SQL window functions · SQLite · SCD Type 2
Evidence & limits
Twelve synthetic deliveries produce nine accepted changes, five history versions and one current order. Paid revenue reconciles to 15,000 AUD cents. Thirteen tests cover replay, late changes, deletes, rollback, drift repair and randomized arrival order. With 2,000 synthetic customers and 2,000 orders, one customer update writes five derived rows; a full rebuild of that state writes 12,002. These are write counts, not a throughput benchmark. This is a local sink for normalized events; no live CDC connector or production-scale benchmark is included.
Public source · Synthetic fixture · Python 3.12+ · No external packages