知识卡片

普通读书笔记卡 · 3426

双写必须规定部分失败的补偿

理解等级:高级

双写将一致性复杂度移到服务代码:目标写入失败时需明确重试、错误记录、差异核对和补偿。仅因主库成功就忽略副库故障,会留下切换后的数据缺口。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    原书出处

    参考来源

    - 位置:《Principles of Software Architecture Modernization》第10章《Data Migrations》(源文件:`_epub-src/OPS/ch10.xhtml`,归一化正文 [29404:33820)) - 结论依据:原文讨论一侧写失败、重试次数有限以及表差异补偿的选择。 - 原始内容:Failure in one write operation Well, for this case, we have two options, either you completely ignore it and let the table diff component take care of that, or you will need to retry. Waiting until a table diff executes creates the issue where the two DBs will be out of sync for a while; eventually, they will be consistent.