Skip to content
Preptima
hardDesignScenarioMidSeniorStaff

How would you design a data pipeline you can safely re-run?

Design a safely rerunnable data pipeline by making each output partition a deterministic result of its input partition, overwriting instead of appending, and writing into idempotent sinks that tolerate retries and late events.

6 min readUpdated 2026-08-15

Answer

Short answer

A safely rerunnable data pipeline is idempotent: rerunning the same partition should replace the same output, not append duplicates. Use deterministic partition keys, overwrite or merge by natural key, track watermarks for late events, and make sinks tolerate at-least-once delivery.

Was this answer helpful?

Likely follow-ups

  • A late event arrives for a partition you already closed and reported on downstream. What do you do?
  • How do you make the backfill of 400 partitions safe to run concurrently with the nightly schedule?
  • Where would you put the deduplication key, and what retention does that state need?
  • What changes if the sink is a REST API or a payment system rather than a table?

Related questions

Further reading