An incremental invoice load
Cedar Billing needs an hourly warehouse load of invoices, including corrections to old invoices and soft deletes. Several invoices can share an updated_at timestamp, and a job can stop after writing rows. Design a load that can resume without gaps or duplicate invoices.
Rubric and preparationWhat a mid answer covers · 5 lessons to prepare
Mid standard
- Connect the assumptions, method and result: I need a stable invoice identity and a change position with a tie-breaker or overlapping window because a timestamp alone can miss changes sharing the watermark. I check whether updated_at reflects every mutation, including deletes.
- Test the consequential edge case: I apply changes by mutation time rather than invoice date because an old invoice can be corrected today. I preserve or apply the deletion marker according to the reporting contract and rebuild affected aggregates, retaining the source change audit.
- Explain an owned validation or operating check: I reconcile invoice counts and totals by source partition, track freshness and rejected rows, and test a replayed batch because a successful job exit does not prove completeness. I alert on missing source delivery as well as processing failures.