知识卡片

问题卡 · 5105

关联键扩展远端数据

理解等级:中级

无法修改远端用户存储时,可在本地保存新增属性并用远端资源URL作为关联键,读取时再合并。新增字段应有独立名称,如workEmail,避免与远端email产生来源歧义。

关联不会建立跨服务事务或共同完整性约束。远端失联可按契约用缓存或默认值;404不能直接证明永久删除,不能贸然清除本地历史。保留历史、标记失联或清理孤儿记录,应按本地用途决定。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 分布式数据 · 查看原书依据

      In cases where you want to extend an existing remote data store with additional values, you can establish a local data store that contains the additional values, and an associative key that links the two data stores together.

    参考来源

    - 位置:《RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)》第6章《分布式数据》§6.11(来源项目:book-sources;源文件:extracted/RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)/_epub-src/OEBPS/ch06.xhtml) - 结论依据:原文以无法修改远端用户存储时,可在本地保存新增属性并用远端资源URL作为关联键,读取时再合并的方式说明该用途;同节示例与讨论补充了卡内条件和边界。 - 原始内容:In cases where you want to extend an existing remote data store with additional values, you can establish a local data store that contains the additional values, and an associative key that links the two data stores together.