DB Migration Guardrails

March 6, 2026 · View on GitHub

🧭 Quick Return to Map

You are in a sub-page of OpsDeploy.
To reorient, go back here:

Think of this page as a desk within a ward.
If you need the full triage and all prescriptions, return to the Emergency Room lobby.

Plan and execute schema or storage migrations with zero data loss and predictable retrieval quality. Applies to primary OLTP stores, vector stores, and search backends.

Open these first

Acceptance targets

  • Data loss equals 0 verified by row counts and checksums
  • Backfill completeness equals 100 percent with reconciliation pass
  • ΔS drift between pre and post retrieval ≤ 0.02 on a gold set
  • λ remains convergent across two seeds
  • Cutover within the planned window with a reversible path

60-second checklist

  1. Preflight
    Freeze schema in source, create target with explicit charset, collations, index types, vector metric, analyzer. Verify privileges and connection pools.
  2. Dual-write flag
    Enable dual writes with idempotency keys. Record op_id, source_rev, target_rev, index_hash.
  3. Backfill
    Copy in batches with capped concurrency. Validate counts and checksums per table or collection.
  4. Shadow reads
    Use Shadow Traffic Mirroring to compare answers and latency.
  5. Cutover
    Flip read source after a clean soak. Keep dual writes for a short tail.
  6. Rollback plan
    Document exact steps and TTL for the rollback window with checkpoints.

Minimal playbook

  • Contracts: protect schemas with Data Contracts so producers and consumers fail fast.
  • Consistency: validate referential and vector invariants after each batch.
  • Indexing: for vectors rebuild offline and swap atomically. See Vector Index Build & Swap.
  • Traffic: rate limit heavy stages and prefer maintenance windows.
  • Metrics: log migrated_rows, checksum_ok, dual_write_fail, ΔS_diff, λ_state, cutover_ms.

Common pitfalls → fix

  • Metric mismatch after cutover produces wrong-meaning hits
    → confirm vector metric and normalization. See Embedding ≠ Semantic.
  • Read timeouts during backfill
    → isolate reader replicas or use read-only mode during the heaviest phase. See Read-Only Mode.
  • Dual-write divergence
    → enforce idempotency keys and reconcile with drift queries. See Idempotency & Dedupe.

Escalate

Abort and rollback if data checksums diverge or ΔS drift exceeds 0.05 on the gold set for longer than 15 minutes. Publish an incident update and run a focused postmortem with Postmortem & Regression Tests.


🔗 Quick-Start Downloads (60 sec)

ToolLink3-Step Setup
WFGY 1.0 PDFEngine Paper1️⃣ Download · 2️⃣ Upload to your LLM · 3️⃣ Ask “Answer using WFGY + <your question>”
TXT OS (plain-text OS)TXTOS.txt1️⃣ Download · 2️⃣ Paste into any LLM chat · 3️⃣ Type “hello world” — OS boots instantly

Explore More

LayerPageWhat it’s for
⭐ ProofWFGY Recognition MapExternal citations, integrations, and ecosystem proof
⚙️ EngineWFGY 1.0Original PDF tension engine and early logic sketch (legacy reference)
⚙️ EngineWFGY 2.0Production tension kernel for RAG and agent systems
⚙️ EngineWFGY 3.0TXT based Singularity tension engine (131 S class set)
🗺️ MapProblem Map 1.0Flagship 16 problem RAG failure taxonomy and fix map
🗺️ MapProblem Map 2.0Global Debug Card for RAG and agent pipeline diagnosis
🗺️ MapProblem Map 3.0Global AI troubleshooting atlas and failure pattern map
🧰 AppTXT OS.txt semantic OS with fast bootstrap
🧰 AppBlah Blah BlahAbstract and paradox Q&A built on TXT OS
🧰 AppBlur Blur BlurText to image generation with semantic control
🏡 OnboardingStarter VillageGuided entry point for new users

If this repository helped, starring it improves discovery so more builders can find the docs and tools.
GitHub Repo stars