Search across all documentation pages
8 examples to align Node.js deploy frequency with database migration risk - 6 basic and 2 intermediate.
node-pg-migrate)| Layer | Typical cadence | Bottleneck |
|---|---|---|
| Node API image | Multiple per day | Tests, review |
| Worker image | Daily | Queue compatibility |
| Postgres migration | Weekly or biweekly | Expand-contract discipline |
| Shared lib major bump | Monthly | Cross-service coordination |
Related: DORA Metrics for Node Teams - measure delivery health
Expand: Add nullable column or new table - deploy API that writes both old and new.
Contract: Backfill data; switch reads to new shape.
Delete: Remove old column in later release after rollback window closes.
-- Expand (deploy 1)
ALTER TABLE orders ADD COLUMN status_v2 TEXT;
-- Contract (deploy 2) - app writes status_v2, reads with COALESCE
-- Delete (deploy 3)
ALTER TABLE orders DROP COLUMN status;PR pipeline (every push):
lint → typecheck → unit tests → integration (Testcontainers)
Release pipeline (merge to main):
build image → scan → deploy staging → smoke → manual/auto promote prodgitSha, not latestSchema expand migration (staging + prod)
→ deploy API (writes new fields, reads fallback)
→ deploy workers (process new job shape)
→ backfill job (if needed)
→ deploy API (reads new fields only)
→ contract migrationdocs/deploy-order.md per service[ ] Backward-compatible with N-1 API image?
[ ] Backward-compatible with N-1 worker image?
[ ] Index created CONCURRENTLY (Postgres)?
[ ] Lock time estimated for ALTER?
[ ] Rollback path documented (forward-fix vs undo)?
[ ] Staging load test after migration?ALTER TABLE on large tables needs maintenance window or online schema toolmigrate deploy in CI before k8s rolloutfeature branch → PR → main → staging (auto) → production (gated)/health/ready and one critical write/read pathError budget remaining > 50% → normal deploy cadence
Error budget 20-50% → deploys require TL approval
Error budget < 20% → freeze feature deploys; fixes only## orders-api v2.14.0 (2026-07-09)
- Migration: 20260709_add_status_v2 (expand, backward-compatible)
- Deploy order: migrate → API → workers
- Feature flag: new-checkout (default off)
- Rollback: rollout undo to v2.13.2; migration is forward-onlyYes. Code deploys daily behind flags; schema changes weekly in planned windows.
API team proposes; DBA/platform approves lock-risk migrations. Shared calendar.
Yes. Turborepo/Nx affected-graph deploys only changed services, but shared migration repo still gates order.
Stack versions: This page was written for Node.js 24.18.0 (Active LTS), npm 10+, TypeScript 5.6+, Express 5, Fastify 5, and NestJS 11.