Qikuyueser.com

Sequence Dual-Writes and Read Cutover

Added 2026-10

Sequence Dual-Writes and Read Cutover — Chinese original prompt

要把 [业务数据] 从旧存储迁到新存储。请给出双写与读切换的完整顺序:先写旧再写新还是反过来、双写失败时以哪边为准、读切换按什么粒度推进、切回旧存储的条件。输出:分阶段步骤表、每阶段的观测指标与停留时长、数据补偿的触发方式、最终停写旧存储的前置条件。
Site original

Chinese original

Open in ChatGPT

Example

Sample input

要把订单数据从旧库迁到新库,给双写与切读的完整顺序、每阶段指标和回退条件。

The output should include

  • 先写哪边、失败以哪边为准写清
  • 读切换按什么粒度推进要写清
  • 写清停写旧库需要的前置条件

Replace these placeholders 1

Swap the bracketed parts for your own details before sending.

  • [业务数据]
How to use

读切换按用户或租户分批,比一次全量切更容易止损。

Try tweaking it

  • Have it restate requirements and constraints before writing code.
  • Ask for the smallest change plus a rollback path, not a full-file rewrite.

What you should get

  • A minimal, runnable change with copy-ready code
  • Impact list: which files and call sites must follow

Common mistakes

  • Asking it to touch ten files at once, then losing track of what broke what.
  • Pasting only the error, with no code or version, and getting an unfixable answer.

How to check the output

  • The change runs, can be rolled back, and touches nothing unrelated.
  • Edge cases (empty, oversized, concurrent) are covered or explained.

Where it works

  • Good for: having it restate requirements and constraints, then propose the smallest runnable change.
  • Watch out: include versions and a minimal reproduction with the error, or the fix may look plausible but not fit.

More in this topic