- only a database migration;
- an application-level backfill from data already stored in Postgres; or
- a full blockchain replay in a fresh slot.
Choose a strategy
Option 1: Update the existing slot
Use an in-place update when the existing database is valid and the change is additive or operational.- Add and test an incremental migration locally.
- Back up any non-reconstructable data.
-
Deploy to the existing slot:
-
Confirm that the
initservice applies the migration successfully. - Check processor logs, API queries, and indexing progress.
--hard-reset: it drops and recreates all deployment resources, including the database.
Option 2: Backfill from existing Postgres data
If the new value can be derived from existing tables, run the backfill outside the processor transaction:- Apply the additive schema migration.
- Deploy a separate background job.
- Update rows in bounded batches.
- Store progress so the backfill can resume after a restart.
- Monitor locks, statement duration, and database growth.
- Remove the temporary job when verification is complete.
UPDATE over a large table. It can create long locks, large transactions, and table bloat.
Option 3: Replay in a fresh slot
Use a new slot when correctness depends on replaying historical blocks:-
Keep the current slot tagged
production. -
Deploy the changed code without specifying a slot or tag:
- Wait for the new slot to reach the expected chain height.
- Validate row counts, representative queries, and application behavior through the slot URL.
-
Move the production tag:
- Keep the old slot temporarily for rollback.
-
Remove the old slot only after the observation window:
Parallel slots are independent deployments and are billed independently while
both are running. Estimate the overlap before starting a long replay.
Validate before cutover
At minimum, compare:- processor height and lag;
- entity counts for important tables;
- known records at old, middle, and recent blocks;
- API response shape and latency;
- custom aggregate or materialized-table output;
- error and restart rates.
production-v2 until clients have migrated.
Roll back
If validation fails after moving the tag:- Move
productionback to the old slot. - Stop sending traffic to the new slot.
- Inspect its logs and database without changing the old slot.
- Fix the issue and redeploy to the same new slot, or remove it and start another replay.