Dual-write is a reconciliation strategy, not a migration strategy

source: Apache Iceberg docs — Hive table migration

When we moved the Hadoop warehouse to Iceberg we could not stop the nightly loads, so for each table there was a window where the pipeline wrote to both the old Hive table and the new Iceberg one. It is tempting to call that "the migration". It is not. Dual-write is the thing that lets you prove the migration.

The migration is the one-time copy plus the switch of readers. Dual-write exists so that, during the window, you can run a checksum per table and per partition on both sides every night and show that they agree. The night they stop agreeing is the night you learn something about your pipeline (a type coerced differently, a timezone, a late-arriving partition) that the copy alone would never have surfaced.

What this costs, honestly:

  • Every load runs twice for the length of the window, so compute and the load window both grow. For wide tables that was noticeable.
  • Two writers means two failure modes per night, and a partial failure leaves the sides different until the next run.
  • Somebody has to read the reconciliation report. If nobody does, you are paying for dual-write and getting nothing.

The useful framing is to set the exit condition up front: N consecutive clean reconciliations, then readers switch, then the old writer is removed. Dual-write with no exit condition is just an expensive way to have two warehouses.