Step 04 of 8 2-4 weeks· advanced
Step 4: Set Up Dual-Write or CDC
Keep the target DB in sync with source as the migration progresses. Choose dual-write, CDC (Debezium / DMS), or trickle-batch based on downtime tolerance and tooling.
Recommended prompts
Use one of these to do the work in your IDE
Open the template to read it in full. Click Copy prompt to grab it (with your stack values pre-filled where they apply) — then paste into Claude Code, Cursor, or wherever you build.
Recommended skills
Drop these into Claude Code for this phase
Skills auto-trigger on the right kind of request. Install once; they apply to every prompt that fits.
Recommended MCP configs
Wire these tools into Claude Code first
MCP servers give Claude Code direct access to external systems (Jira, browsers, databases). Configure once.
When you're done
Verify these in your own work before moving on
This is a checklist for you to mentally tick off in your repo and IDE — the site doesn't track it, you do.
- Sync mechanism deployed (dual-write code, CDC pipeline, or batch jobs)
- Sync is monitored (lag metric, error rate, drift detection)
- Validation runs continuously (counts and sums match between source and target)
- Stop conditions defined (when to halt sync if drift exceeds threshold)
- Sync can be paused / resumed safely
Common pitfalls
What goes wrong at this step
- No drift monitoring — sync runs, but you don't know if it's working
- CDC schema changes break sync — when the source schema changes, the CDC pipeline often needs reconfiguration
- Dual-write transactions — making both writes atomic is hard (2PC is rarely the answer)
- Forgetting bulk operations — CDC handles row-by-row; bulk imports may not flow through