← All Learning Paths

Database Migrations

Change schemas safely: expand-contract, concurrent indexes, backfills, and tested rollbacks.

technicalintermediate8 nodes13.92h total

Learning path

Change schemas safely: expand-contract, concurrent indexes, backfills, and tested rollbacks.

  1. Compare "Dropping Is a Two-Step Verification" with "Versioning the Migrations and the Code Together" in "Database Migration Strategies That Won't Break Production" and state which trade-off you would accept in database migrations code.

    Completion criteria: Record a short walkthrough of "Database Migration Strategies That Won't Break Production" with timestamps at "Dropping Is a Two-Step Verification" and "Versioning the Migrations and the Code Together", plus the commit that applies it.

    Next step: Create a Database Index Without Downtime

    ⏱ 1h

  2. Carry out "Create a Database Index Without Downtime" on a database migrations project, pausing at the "The baseline shows a specific bottleneck the index should improve." step to verify "Measure the query and baseline: Capture the query plan, latency, and rows scanned for the".

    Completion criteria: Attach a checklist of "Create a Database Index Without Downtime"'s steps with the observed state after each one and the verification result from "Measure the query and baseline: Capture the query plan, latency, and rows scanned for the".

    Next step: Backfill a Large Table Safely

    ⏱ 1h

  3. Use "Backfill a Large Table Safely" to decide "Re-running a batch does not double-apply changes.", then prove the outcome with "Estimate the work: Count affected rows, measure a small batch, and estimate total duration".

    Prerequisites: Create a Database Index Without Downtime

    Completion criteria: Produce a run log for "Backfill a Large Table Safely" that ends at "Estimate the work: Count affected rows, measure a small batch, and estimate total duration" and mark every step where "Re-running a batch does not double-apply changes." was checked.

    Next step: Apply a Zero-Downtime PostgreSQL Column Migration

    ⏱ 1h

  4. Run "Migrate a PostgreSQL column through expand and contract phases so old and new application" from "Apply a Zero-Downtime PostgreSQL Column Migration" and confirm the documented result "psql reports ALTER TABLE, CREATE FUNCTION, CREATE TRIGGER, and COMMIT; the new column is".

    Prerequisites: Backfill a Large Table Safely

    Completion criteria: Run the steps through "Migrate a PostgreSQL column through expand and contract phases so old and new application", paste the command output, and mark the line that matches "psql reports ALTER TABLE, CREATE FUNCTION, CREATE TRIGGER, and COMMIT; the new column is"; then rerun with one parameter changed.

    Next step: How to Test Database Migrations

    ⏱ 1h

  5. Compare "What Migration Tests Must Cover" with "Test Against the Real Database Engine" in "How to Test Database Migrations" and state which trade-off you would accept in database migrations code.

    Prerequisites: Apply a Zero-Downtime PostgreSQL Column Migration

    Completion criteria: Attach a one-page summary that quotes "What Migration Tests Must Cover", lists two trade-offs, and links the commit where you applied it.

    Next step: How to Query JSONB in PostgreSQL

    ⏱ 1h

  6. Reconstruct the reasoning behind "How to Query JSONB in PostgreSQL" by tracing "Learn the operators" to the failure it prevents in database migrations systems.

    Completion criteria: Attach a decision log for "How to Query JSONB in PostgreSQL": the "Learn the operators" section, one rejected alternative, and the diff of the file you changed.

    Next step: Order Migrations and Detect Cycles

    ⏱ 1h

  7. Solve "Order Migrations and Detect Cycles" for database migrations work: turn JSON object: { migrations: [{ id, dependsOn?: string[] }] } into {order:[001_init,002_add_table,003_add_index],cyclic:false,cycle:[]} and pass both samples.

    Prerequisites: How to Query JSONB in PostgreSQL

    Completion criteria: Attach the solution file for "Database Migrations", two passing sample runs, and one failing run whose error matches the contract.

    Next step: Capstone: Database Migrations

    ⏱ 0.42h

  8. Ship "Drift detection" from "Build a Database Migration Runner", then prove it with the project's test suite and an acceptance note.

    Prerequisites: How to Query JSONB in PostgreSQL, Order Migrations and Detect Cycles

    Completion criteria: Deliver "Drift detection" and show a commit where the corresponding test goes from failing to passing.

    Next step: Run the capstone's tests, publish the repository, and demo it to a reviewer.

    ⏱ 4h