DevOps, CI/CD and IaCVol. 8 · Part VIII
0 / 0

Shelves / DevOps, CI/CD and IaC

DL·96

Release Engineering

The discipline of shipping: versioning schemes (Semantic Versioning in full, CalVer, build numbers) and how each ecosystem (Maven, Go modules, Cargo, npm, PyPI) interprets them; automated versioning from Conventional Commits; changelogs and release notes; release branches, trains and support policies; feature flags, canary, blue/green and progressive delivery as one release toolkit; rollback versus roll-forward; and schema migration safety in depth (expand/contract, online DDL patterns for PostgreSQL and MySQL, migration tools), plus deprecation policies.

31 topics · ~19 min read · 32-question quiz
Updated Suggest a correction

Start here: versions people can trust

What release engineering is

Deploying puts code on servers; releasing gives users a change they can rely on and refer to. Release engineering is the discipline around that: version numbers that mean something, changelogs, release processes (trains, tags, branches), artifacts that are built once and promoted, the ability to roll back or forward, safe database changes, and retiring old behaviour gracefully.

Semantic versioning

A version like 2.4.1 is MAJOR.MINOR.PATCH. Under Semantic Versioning (semver), a release that only fixes bugs bumps PATCH, one that adds backwards-compatible features bumps MINOR, and one that breaks compatibility bumps MAJOR. The number becomes a promise: "upgrading from 2.3 to 2.4 is safe; 3.0 needs your attention." Libraries and APIs live by it; applications deployed continuously often use dates or build numbers instead (calendar versioning, or the commit hash).

Versions from commit messages

If every commit message says what kind of change it is, the next version and the changelog can be computed. Conventional Commits does that: fix:, feat:, docs:, an optional scope, and ! (or a BREAKING CHANGE: footer) for incompatible changes.

Text
$ git log --oneline v1.0.0..
e2c45ba fix(menu): show sold-out dishes greyed out
4c2789f docs: explain delivery zones
21e4803 fix: round GST to the nearest rupee
$ git cliff --bumped-version
v1.0.1
after a feat: commit → v1.1.0
after a breaking change (feat!) → v2.0.0
$ git cliff --latest   # changelog for the release
## [2.0.0] - 2026-10-30

### 🚀 Features

- *(orders)* Schedule a tiffin for later
- *(api)* [**breaking**] Orders API returns prices in paise, not rupees

### 🐛 Bug Fixes

- Round GST to the nearest rupee
- *(menu)* Show sold-out dishes greyed out

### 📚 Documentation

- Explain delivery zones

Two fixes since 1.0.0 meant a patch (1.0.1); a new feature made it a minor (1.1.0); changing the API's units, which breaks every client, made it a major (2.0.0), and the changelog called it out. Tools like git-cliff, semantic-release, release-please and Changesets automate exactly this in CI: compute the version, write the changelog, tag, and publish, so releases are routine and consistent rather than a manual chore.

Undoing a release

When a release goes wrong you can roll back (redeploy the previous version) or roll forward (ship a fix quickly). Rolling back is usually fastest, but only if the old version still works with the current state of the world: if the release changed the database schema, a message format, or data written by the new version, the old code may not cope. That's why release engineering cares so much about backward-compatible changes: expand–contract database migrations (add, migrate, then remove in a later release), API versioning, and feature flags that separate deploying code from turning it on.

How deep to go in release engineering

Volume 17 defines six mastery levels. For this chapter they look like this; the chapter aims at L3 everywhere, and its lab at L4.

Level What you can do
L1 Explain semver, changelogs, tags, rollback and roll-forward
L2 Automate versions and changelogs from commits; tag and publish releases from CI
L3 Explain release trains and branches, artifact promotion, migration safety and deprecation
L4 Diagnose failed releases, migration locks, incompatible rollbacks and version conflicts
L5 Design a release process: cadence, gates, compatibility policy and support windows
L6 Run release engineering across many teams and products with policy and tooling

What release engineering covers

Release engineering is everything between "the code is merged" and "users have it, and we can support it": building reproducible, versioned artefacts; communicating changes; rolling them out safely; supporting older versions; and undoing mistakes. Google's SRE book describes release engineers' goals as self-service, high velocity, hermetic builds, and enforced policies. This chapter ties together tools from earlier volumes (Vol. 6 ch. 84 deployment strategies, chapters 93–95 here) into a release process.

Versioning

Why version numbers matter

A version identifies exactly what was released and tells consumers what kind of change to expect. Libraries and APIs need versions that communicate compatibility; deployed services need versions that are traceable to a commit.

Semantic Versioning

SemVer 2.0.0 (semver.org): MAJOR.MINOR.PATCH, optionally with pre-release and build metadata.

Part Increment when Example
MAJOR You make incompatible API changes 1.9.3 → 2.0.0
MINOR You add functionality backward-compatibly (also: deprecations) 1.9.3 → 1.10.0
PATCH You make backward-compatible bug fixes 1.9.3 → 1.9.4
Pre-release -alpha.1, -beta.2, -rc.1: lower precedence than the release 2.0.0-rc.1 < 2.0.0
Build metadata +build.517, +sha.3f9c2e1: ignored for precedence 1.4.2+sha.3f9c2e1
2.4.1-rc.2+sha.3f9c2e1 MAJORbreaking MINORnew, compatible PATCHfixes pre-release< 2.4.1 build metaignored
Anatomy of a semantic version. MAJOR, MINOR and PATCH signal the kind of change; an optional pre-release suffix ranks below the release; build metadata is ignored when comparing versions.

Rules worth remembering:

  • A public API must be defined (documented interface, CLI, wire format). Versions describe changes to it.
  • Once released, a version's contents must not change: fixes get a new version.
  • 0.y.z is initial development: anything may change at any time (in practice ecosystems treat 0.MINOR bumps as breaking).
  • Precedence compares numerically field by field: 1.10.0 > 1.9.0 (string comparison would get this wrong). Pre-release identifiers compare dot-separated parts, numbers numerically.
  • What counts as breaking is subtler than it looks: removing a field, changing a default, tightening validation, changing error types, raising minimum runtime versions, or changing behaviour people rely on (Hyrum's law: with enough users, every observable behaviour will be depended on by somebody).

Version ranges in ecosystems

Ecosystem Syntax and behaviour
npm ^1.4.2 = >=1.4.2 <2.0.0 (and ^0.4.2 = <0.5.0); ~1.4.2 = <1.5.0; lockfile pins exact versions
Cargo "1.4.2" means ^1.4.2 by default; Cargo.lock for applications; MSRV via rust-version
Go modules Minimal version selection (picks the minimum version satisfying all requirements, for reproducibility); major versions ≥ 2 change the import path (module example.com/lib/v2), so v1 and v2 can coexist
Maven / Gradle Exact versions by convention; ranges exist but are discouraged; "nearest wins" (Maven) or "highest wins" (Gradle) conflict resolution; BOMs align related versions; -SNAPSHOT for unreleased builds
Python (PEP 440) ~=1.4.2 (compatible release), >=1.4,<2; pre-releases like 2.0.0rc1; lock with uv.lock/poetry.lock
NuGet Ranges like [1.4,2.0); lowest applicable version by default

Other schemes

  • CalVer (calendar versioning): 2026.10.1, 24.04 (Ubuntu), YYYY.MINOR (pip). Good for products released on a schedule where "compatibility" is less meaningful than "how recent".
  • Build numbers / commit-based: deployed services often don't need SemVer at all: 2026.10.24-517-g3f9c2e1 or just the Git SHA. What matters is traceability (image digest ↔ commit ↔ pipeline run).
  • Marketing versions (product names, "2026 edition") sit on top of technical versions.
  • API versions for services (/v1/, Accept: application/vnd.acme.v2+json, date-based versions like Stripe's 2026-09-30) are separate from the deployment version (Vol. 3 covers API versioning).

Automating versions and changelogs

Conventional Commits

Conventional Commits gives commit messages machine-readable meaning:

Text
feat(orders): support partial refunds
fix(payments): retry on idempotent 409 responses
perf(search): cache facet counts
docs: explain retry configuration
feat(api)!: remove deprecated /v1/carts endpoints

BREAKING CHANGE: clients must use /v2/carts.

fix → PATCH, feat → MINOR, ! or BREAKING CHANGE: footer → MAJOR. Enforce with a commit-msg hook (commitlint) and a PR-title check when squash-merging.

Release automation tools

Tool How it works
release-please (Google) Maintains a release PR that accumulates changes, bumps versions and updates CHANGELOG.md; merging it tags the release and creates a GitHub release. Supports many languages and monorepos
semantic-release Fully automated: on merge to the release branch, computes the next version from commits, tags, publishes packages and release notes
Changesets Contributors add small changeset files describing the change and bump type; popular in JS monorepos
GoReleaser Builds, packages, signs and publishes Go (and Rust, Zig) binaries for many platforms from a tag, with SBOMs and checksums
JReleaser Release automation for Java (and others): publishing to Maven Central, GitHub releases, package managers, signing, announcements
cargo-release, cargo-dist, release-plz Rust crate releases and binary distribution
Maven Release Plugin, Gradle Axion/Reckon Version and tag management for JVM builds
YAML
# .github/workflows/release.yml: release-please maintains a release PR; merging it tags and releases
on:
  push:
    branches: [main]
permissions: { contents: write, pull-requests: write }
jobs:
  release-please:
    runs-on: ubuntu-24.04
    outputs:
      released: ${{ steps.rp.outputs.release_created }}
      tag: ${{ steps.rp.outputs.tag_name }}
    steps:
      - id: rp
        uses: googleapis/release-please-action@v4
        with: { release-type: maven }
  publish:
    needs: release-please
    if: needs.release-please.outputs.released == 'true'
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v4
        with: { ref: "${{ needs.release-please.outputs.tag }}" }
      - run: ./mvnw -B -ntp deploy -Prelease          # sign and publish artefacts

Changelogs and release notes

They're different documents for different readers:

  • A changelog (CHANGELOG.md, following Keep a Changelog: Added, Changed, Deprecated, Removed, Fixed, Security, per version with dates) is a complete, chronological record for developers and integrators. Generated drafts from commits are a start; curate them, because commit messages are written for reviewers, not users.
  • Release notes are written for users and stakeholders: what's new and why it matters, upgrade instructions, breaking changes and migration steps, known issues, deprecations with timelines, security fixes (with CVE IDs and severity), and acknowledgements.

Good release notes lead with impact ("Exports are now 5× faster for large accounts"), separate breaking changes prominently, and link to docs and issues.

Release processes

Cadence and branches

Model How Fits
Continuous deployment Every merge to main deploys (behind flags and progressive delivery) SaaS services
Release trains Fixed schedule (weekly, every 6 weeks); whatever is ready catches the train Mobile apps (store review), large coordinated products (browsers, Kubernetes ~every 4 months)
Release branches Cut release/1.4 from main; stabilise; cherry-pick fixes from main (fix on main first, then backport) Versioned products and libraries with support windows
Long-term support (LTS) Selected versions get security fixes for years Java LTS, Node LTS, Ubuntu LTS, Kubernetes managed-service extended support

Publish a support policy: which versions get fixes, for how long, and how far ahead deprecations are announced.

Publishing artefacts

  • Build in CI from a tag, never from a developer machine; record the commit, toolchain and dependencies (reproducible builds where feasible: Go, Rust and Zig make this easier; Maven with project.build.outputTimestamp).
  • Sign artefacts and attach SBOMs and provenance (Vol. 6 ch. 81; Maven Central requires signatures; npm and PyPI support trusted publishing via OIDC from CI with provenance attestations, removing long-lived publish tokens).
  • Publish checksums; keep artefacts immutable (no re-uploading a version).
  • Mobile and desktop: staged rollouts in app stores (e.g. 1% → 100%), with the ability to halt.

The release toolkit

Volume 6 (ch. 84) covered the mechanics; as a release engineer, see them as one toolkit for decoupling and de-risking:

Technique Decouples Primary risk reduced
Feature flags Deploy from release Exposure: release to 1%, a tenant, or staff; kill switch in seconds
Canary New version from all traffic Blast radius: a bad build hits a small share, analysed automatically
Blue/green Cutover from deployment Downtime and slow rollback: instant switch back
Progressive delivery Promotion from human vigilance Human error: metric-gated, automatic promotion or abort
Dark launches / shadow traffic Testing from user impact Performance and correctness surprises under real load

Combine them: a change ships dark behind a flag, the canary proves the build is healthy, the flag ramps the feature to users while product metrics are watched, and the flag is removed once fully released.

Feature flag lifecycle

  1. Create with an owner, type (release, experiment, ops, permission) and expiry date.
  2. Deploy with the flag off; test in production with internal targeting.
  3. Ramp: 1% → 10% → 50% → 100%, watching errors and business metrics; use sticky assignment by user or tenant.
  4. Clean up: remove the flag and the old code path within days or weeks of reaching 100%. Track flag debt; stale flags multiply test combinations and confusion (Knight Capital's 2012 loss of about $440 million in 45 minutes involved repurposing an old flag that reactivated dead code on one server).

Rollback and roll-forward

When a release goes wrong:

  • Mitigate first: turn off the flag, abort the rollout, route traffic away, roll back. Diagnose after users are safe.
  • Rollback (redeploy the previous artefact) is usually fastest if it's safe: the previous version must still work with current data, schema, message formats, configuration and caches.
  • Roll forward (ship a fix) when rollback is unsafe (data written in a new format, irreversible migration) or when the fix is tiny and the pipeline is fast.
  • Make rollback a routine operation, tested regularly, available to on-call without special permissions, and automated where metrics allow (Argo Rollouts, ECS deployment circuit breaker, CodeDeploy alarms).

Rollback safety is mostly decided before the release, by compatibility discipline, especially in the database.

Schema migration safety

The core problem

During any non-recreate deployment, old and new application versions run at the same time against one database. And after a rollback, the old version runs against whatever the new version did to the schema and data. So every schema change must be compatible with both the version before and the version after: the expand/contract (parallel change) pattern from Vol. 6 ch. 84.

Two separate risks:

  1. Compatibility: does every running code version work with the schema at every step?
  2. Locking and load: does the DDL statement itself block reads or writes (or saturate I/O) on a busy table?

Online DDL patterns (PostgreSQL)

Change Unsafe way Safe way
Add column With a volatile default on old versions (rewrites table) ADD COLUMN … NULL, or with a constant default (metadata-only since PG 11); backfill in batches
Add NOT NULL SET NOT NULL directly (scans table under lock) Add CHECK (col IS NOT NULL) NOT VALID, VALIDATE CONSTRAINT (weaker lock), then SET NOT NULL (uses the validated check), drop the check
Add foreign key ADD FOREIGN KEY (validates under lock) ADD CONSTRAINT … NOT VALID, later VALIDATE CONSTRAINT
Create index CREATE INDEX (blocks writes) CREATE INDEX CONCURRENTLY (outside a transaction; check for INVALID indexes after failures)
Rename column RENAME COLUMN (breaks old code instantly) Add new column → dual write → backfill → read new → stop writing old → drop old (expand/contract)
Change column type ALTER TYPE (often rewrites the table) New column of new type, dual write, backfill, switch, drop
Drop column Drop while old code still reads it Stop reading/writing in code first (and remove from ORM mappings), deploy, then drop
Any DDL No timeout: it waits behind a long transaction while every other query queues behind it SET lock_timeout = '3s' (and statement_timeout), retry with backoff

The last row matters most: an ALTER TABLE waiting for an ACCESS EXCLUSIVE lock behind a long-running query blocks all later queries on that table, which can take a service down even for a "fast" metadata-only change.

SQL
-- PostgreSQL: safe migration steps for adding a required, indexed column
SET lock_timeout = '3s';
SET statement_timeout = '15min';

-- Step 1 (expand): nullable column, metadata-only
ALTER TABLE orders ADD COLUMN currency text;

-- Step 2 (app deploy): new code writes currency for new rows

-- Step 3: backfill in small batches (run repeatedly from a job until 0 rows updated)
UPDATE orders SET currency = 'INR'
WHERE id IN (SELECT id FROM orders WHERE currency IS NULL ORDER BY id LIMIT 5000);

-- Step 4: enforce without a long exclusive lock
ALTER TABLE orders ADD CONSTRAINT orders_currency_not_null CHECK (currency IS NOT NULL) NOT VALID;
ALTER TABLE orders VALIDATE CONSTRAINT orders_currency_not_null;
ALTER TABLE orders ALTER COLUMN currency SET NOT NULL;      -- fast: proven by the validated check
ALTER TABLE orders DROP CONSTRAINT orders_currency_not_null;

-- Step 5: index without blocking writes (must run outside a transaction block)
CREATE INDEX CONCURRENTLY IF NOT EXISTS orders_currency_idx ON orders (currency);

MySQL: InnoDB's online DDL (ALGORITHM=INSTANT for adding columns since 8.0, INPLACE, LOCK=NONE for many index operations) avoids many locks; for large changes use gh-ost (GitHub, triggerless, binlog-based) or pt-online-schema-change (Percona), which copy the table in the background and swap atomically. Also watch replica lag during big DDL. PlanetScale/Vitess offers non-blocking schema changes with deploy requests and revert.

Tools that automate expand/contract: pgroll (serves old and new schema versions simultaneously via views during a migration), Reshape, and Atlas's migration linting (detects destructive and locking changes).

Migration tooling

Tool Ecosystem Style
Flyway JVM (works for any) Versioned SQL files (V7__add_currency.sql), checksums, repeatable migrations
Liquibase JVM (any) Changelogs in SQL/XML/YAML with changesets, rollbacks, contexts
Atlas Any (Go-based) Declarative schema as code (HCL/SQL) or versioned migrations; diff-based planning; migration linting in CI
golang-migrate, goose Go Up/down SQL files
sqlx migrate, refinery, SeaORM migrations Rust Versioned SQL
Alembic Python (SQLAlchemy) Python migration scripts with autogenerate
Django migrations Python Model-driven; sqlmigrate to review SQL
Prisma Migrate, Drizzle Kit, Knex TypeScript/Node Schema-driven or versioned
Rails/ActiveRecord, EF Core migrations Ruby, .NET Framework-integrated
SQL
-- Flyway: src/main/resources/db/migration/V7__orders_add_currency.sql
-- flyway:executeInTransaction=false        (allows CREATE INDEX CONCURRENTLY)
SET lock_timeout = '3s';
ALTER TABLE orders ADD COLUMN IF NOT EXISTS currency text;
CREATE INDEX CONCURRENTLY IF NOT EXISTS orders_currency_idx ON orders (currency);

Practices:

  • Migrations are code: reviewed, versioned, run by the pipeline (or a dedicated Job), not by every application instance at start-up racing each other (Vol. 6 ch. 84).
  • Test migrations against a production-sized copy (or at least realistic volumes), and lint them for locking and destructive operations (Atlas lint, Squawk for PostgreSQL, strong_migrations for Rails).
  • Forward-only in production for most teams: "down" migrations rarely work on real data; recovery is a new forward migration plus backups and PITR.
  • Separate deploys: schema expand, then code, then data backfill, then contract, across several releases.
  • Big data changes run as throttled background jobs with progress tracking, idempotency and the ability to pause.

Deprecation

Removing things is part of release engineering:

  • Announce in release notes and docs with a timeline (e.g. "deprecated in 1.10, removed no earlier than 2.0 / in 6 months").
  • Signal at runtime: Deprecation and Sunset HTTP headers (RFC 9745 and RFC 8594), deprecation warnings in SDKs and CLIs, @Deprecated(forRemoval = true) (Java), #[deprecated] (Rust), Deprecated: doc comments (Go), warnings.warn(DeprecationWarning) (Python).
  • Measure usage (who still calls the old endpoint?) and contact heavy users.
  • Remove only in a MAJOR version (libraries) or after the sunset date (services), with migration guides.

Lab: migrations that don't take the site down

PostgreSQL 16 on the volume's VM, a table of 1,000,000 orders, Python with psycopg 3. An "app" thread runs a primary-key lookup every 20 ms; a "writer" thread inserts every 10 ms; migrations run alongside. Schema changes are the most common reason a release can't be rolled back or causes an outage, so this lab measures the locking behaviour behind the advice.

Experiment 1: the lock queue

A reporting query leaves its transaction open for 5 seconds (holding an ordinary ACCESS SHARE lock). A migration then runs ALTER TABLE orders ADD COLUMN note text, which needs an ACCESS EXCLUSIVE lock:

Text
migration (no lock_timeout): succeeded after 5.0 s; app queries: 95,  slower than 0.5 s: 1, worst 4.99 s
migration (lock_timeout = 1s): gave up after 1.0 s (lock_timeout); app queries: 289, slower than 0.5 s: 1, worst 0.98 s

The ALTER itself is instant, but it had to wait for the report, and while it waited in the lock queue, every new query on the table queued behind it, including the app's simple lookup, which waited the full 5 seconds. With many concurrent requests, all of them stall; connection pools fill and the site goes down because of a "metadata-only" change. Setting lock_timeout made the migration give up after 1 second and let traffic through; the migration tool should then retry later (with backoff), ideally outside peak hours. Every migration should run with lock_timeout (and a statement_timeout).

Experiment 2: fast and slow ADD COLUMN

Text
ADD COLUMN channel text DEFAULT 'app'                0.002 s
ADD COLUMN token uuid DEFAULT gen_random_uuid()      2.354 s

Since PostgreSQL 11, a column with a constant default is added by storing the default in the catalog: no table rewrite. A volatile default (a random UUID, clock_timestamp()) must be computed per row, so the whole table was rewritten while holding an exclusive lock: 2.4 seconds here, far longer on a real table, with all reads and writes blocked. Add such columns as nullable and backfill in batches instead.

Experiment 3: building an index without blocking writes

Text
CREATE INDEX              took 0.37 s; concurrent inserts: 90,  worst insert 0.36 s
CREATE INDEX CONCURRENTLY took 0.55 s; concurrent inserts: 134, worst insert 0.01 s

A plain CREATE INDEX blocks writes for the whole build (here 0.36 s; on a large table, minutes). CONCURRENTLY took longer but let inserts continue. Its caveats: it can't run inside a transaction block (so migration tools need it marked as non-transactional), and if it fails it leaves an INVALID index to drop and retry.

Experiment 4: adding NOT NULL in two steps

Text
SET NOT NULL (scans under ACCESS EXCLUSIVE lock): 0.06 s | CHECK … NOT VALID: 0.001 s, then VALIDATE (SHARE UPDATE EXCLUSIVE: reads and writes continue): 0.06 s

SET NOT NULL scans the table while holding the strongest lock. Adding a CHECK (col IS NOT NULL) NOT VALID constraint is instant (new rows are checked), and VALIDATE CONSTRAINT scans existing rows under a lock that allows reads and writes. Since PostgreSQL 12, a subsequent SET NOT NULL uses the validated constraint and skips the scan. On a million narrow rows both were quick; on hundreds of millions, the difference is minutes of downtime.

Putting it together: an expand–contract release

Renaming customer to customer_id safely takes several releases, each independently deployable and reversible: (1) expand: add customer_id (nullable), deploy code that writes both; (2) migrate: backfill in batches, add the constraint NOT VALID, validate; (3) deploy code that reads the new column; (4) contract: stop writing the old column; (5) a later release drops it. Linters like squawk and strong_migrations catch the unsafe patterns from experiments 1–4 in code review.

Try it yourself

  1. Run experiment 1 with 50 concurrent app threads and a connection pool of 20. How long until the pool is exhausted?
  2. Write a batched backfill that updates 10,000 rows per transaction with a short sleep, and measure its impact on the app's p99.
  3. Add squawk to CI and run it over these migration statements.
  4. Script a migration runner that retries ALTER statements with lock_timeout = 2s and exponential backoff, and test it against experiment 1.

Revision sheet: release engineering

Key ideas

  • Scope: versioning, changelogs, release processes, artifacts and promotion, rollback/roll-forward, migration safety, deprecation and support.
  • Versioning: semver (MAJOR.MINOR.PATCH, pre-releases, build metadata, 0.x), calver, build numbers and commit hashes; API versioning.
  • Automation: Conventional Commits; semantic-release, release-please, Changesets, git-cliff; tags and signed releases; release notes.
  • Processes: trunk-based with continuous deployment, release trains, release branches with backports, hotfixes, freeze windows, mobile app store releases.
  • Toolkit: artifact registries, immutable artifacts by digest, provenance and signing, feature flags, canaries, release dashboards.
  • Rollback vs roll-forward: when each is safe; state changes block rollbacks.
  • Migration safety: expand–contract, lock timeouts, concurrent index builds, NOT VALID constraints, batched backfills, migrations separate from deploys.
  • Deprecation: announce, measure usage, warn (Deprecation/Sunset headers), migrate users, remove in a major version.

Numbers to remember

  • Lab: a 5 s report blocked a waiting ALTER and every query behind it for 5 s; lock_timeout = 1s capped it at 1 s; a constant default took 0.002 s, a volatile one 2.4 s (rewrite); plain index build blocked inserts 0.36 s, CONCURRENTLY 0.01 s.

Pitfalls

  • Hand-written version numbers and changelogs.
  • Breaking changes shipped as minor versions.
  • Migrations without lock_timeout.
  • Volatile defaults or plain CREATE INDEX on large hot tables.
  • Renames and type changes in one step.
  • Rolling back code after a non-reversible migration.

Glossary

  • Semver: version scheme signalling compatibility.
  • Conventional Commits: structured commit messages for automation.
  • Release train: releases on a fixed schedule with whatever is ready.
  • Hotfix: an urgent fix released outside the normal cadence.
  • Expand–contract: multi-release compatible schema or API change.
  • Lock queue: waiting lock requests that block later conflicting requests.