← 返回
未分类

Data Move

Deep data migration workflow—scope, mapping, validation, batching and ordering, dual-write and cutover, rollback, and reconciliation. Use when moving tenants...
深度数据迁移工作流—包括范围、映射、验证、分批与排序、双写与切换、回滚与对账。用于租户迁移。
clawkk clawkk 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 390
下载
💾 0
安装
1
版本
#latest

概述

Data Move

Data migration fails in silent corruption, ordering bugs, and unclear cutover. Treat it as ETL with production risk: explicit mapping, checkpoints, and reconciliation against sources of truth.

When to Offer This Workflow

Trigger conditions:

  • Moving data between databases, regions, or tenants
  • Large backfills after schema changes
  • Zero or minimal downtime requirements

Initial offer:

Use seven stages: (1) scope & invariants, (2) source/target mapping, (3) batching & idempotency, (4) validation rules, (5) execution strategy (big bang vs phased), (6) cutover & rollback, (7) reconciliation & sign-off). Confirm volume, downtime budget, and compliance (PII, audit).


Stage 1: Scope & Invariants

Goal: Define what moves, what must never diverge, and ordering dependencies (foreign keys, references).

Questions

  1. Cutover moment: read-only window vs dual-write?
  2. Immutable identifiers: preserve primary keys or remap with mapping tables?
  3. Deletes: soft-delete vs hard-delete semantics in target

Exit condition: Written invariants (e.g., “every migrated row has legacy_id for traceability”).


Stage 2: Source/Target Mapping

Goal: Field-level mapping document; transforms (timezone, encoding, rounding); defaults for nulls.

Practices

  • Surrogate keys generated deterministically or via mapping table
  • Document one-way vs bi-directional sync if any

Stage 3: Batching & Idempotency

Goal: Jobs restartable; same input yields same output (idempotent writes or upsert keys).

Practices

  • Checkpoint by primary key or updated_at watermark
  • Throttle to protect source and target DB

Stage 4: Validation Rules

Goal: Row counts, checksums, sample joins, business invariants (sums, balances).

Practices

  • Shadow compare: run parallel queries on old vs new for critical aggregates

Exit condition: Validation checklist signed before cutover.


Stage 5: Execution Strategy

Goal: Phased by tenant/region vs single window—risk vs complexity trade-off.

Patterns

  • Dual-write then backfill then flip reads
  • Blue/green tables with rename swap

Stage 6: Cutover & Rollback

Goal: Runbook: who flips DNS/config, order of steps, rollback triggers (error rate, failed checks).

Practices

  • Feature flags for read path to new store
  • Keep rollback script tested in staging

Stage 7: Reconciliation & Sign-off

Goal: Post-cutover 24–72h monitoring; reconciliation job scheduled; support playbook for edge cases.


Final Review Checklist

  • [ ] Invariants and mapping documented
  • [ ] Idempotent batches with checkpoints
  • [ ] Validation and shadow checks passed
  • [ ] Cutover/rollback runbook tested
  • [ ] Reconciliation after go-live

Tips for Effective Guidance

  • Never assume “batch job finished” = correct—prove with checks.
  • Clock skew and timezone bugs are classic—call them out in transforms.
  • Pair with db-migrate for schema timing vs data movement.

Handling Deviations

  • Small one-off SQL: still document mapping and run counts before/after.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 04:41 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

business-ops

抖音运营

clawkk
提供抖音运营的可落地指南与SOP。在开展抖音运营相关工作时调用。
★ 2 📥 2,602
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 681 📥 329,510
dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 197 📥 67,970