Backfill customer IDs with resumable keyset batches
A single UPDATE holds locks too long and cannot explain where to resume if the migration job stops.
- Focused work estimate
- 4h + prerequisites
- Priority in the scenario
- Medium
- Engineering practice
- Backfills · Keyset processing
Estimated field mix
- Database engineering70%
- Performance engineering30%
Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.
Review it, then add it to your workspace.
The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.
Project context
A fictional support platform stores a mutable external account code as its primary relationship key. Renames and imports now break references in several tables.
Setup prerequisites
- Create a disposable database with synthetic customers and dependent records.
- Apply real migration files; never use production db push.
Preceding work
Complete these dependencies, or supply their agreed outputs before taking this ticket.
Acceptance criteria
- Use a stable cursor and bounded batch size.
- Persist progress and count matched, missing and conflicting references.
- Update only rows still lacking the new identity.
Implementation constraints
- Create a synthetic dataset with deliberately unmatched legacy codes.
Verification to include
- Interrupt and resume the backfill without rewriting completed rows.
- Encounter an unmatched code and report it without guessing a customer.
Deliverables
- Backfill command and progress report
Rollout and recovery
Dry-run matching first; pause between batches and retain the checkpoint on errors.
Value of the work
For the engineer: Practice migration ordering, compatibility and referential integrity.
For the team: Review a reversible schema transition with measurable completeness checks.
Evidence boundaries
Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.
Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.