知识卡片
未知字段保留往返
服务只负责修改记录的一部分时,写回过程中容易丢掉自己不认识的数据。
只处理自己理解的字段,并不等于删掉其余字段。读取整条记录后修改电子邮件,再写回时应保留未知及未修改部分,避免破坏记录完整性,也让来源新增字段时消费者仍能工作。
这适用于双方约定的整记录读改写模式;提交仍须遵守来源提供的表单和并发条件。Must Ignore是“忽略语义、保留传递”,不是允许未知内容绕过写入安全校验。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 分布式数据 · 查看原书依据
At the heart of this solution is what is loosely referred to as the “Must Ignore” rule. When receiving a message from another party, just ignore the parts of the message you don’t understand. Operate on the parts you were designed to understand, and return the entire block if you are attempting an update.
参考来源
- 位置:《RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)》第6章《分布式数据》§6.8(来源项目:book-sources;源文件:extracted/RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)/_epub-src/OEBPS/ch06.xhtml)
- 结论依据:原文以只处理自己理解的字段,并不等于删掉其余字段的方式说明该用途;同节示例与讨论补充了卡内条件和边界。
- 原始内容:At the heart of this solution is what is loosely referred to as the “Must Ignore” rule. When receiving a message from another party, just ignore the parts of the message you don’t understand. Operate on the parts you were designed to understand, and return the entire block if you are attempting an update.