知识卡片
服务数据仅经公开接口访问
某服务拥有的数据存储只应由该服务直接读写;其他服务需要数据时,通过该服务公开接口或经明确发布的数据契约获取。直接访问对方表会把 schema 与资源竞争变成跨服务耦合。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Principles of Software Architecture Modernization》第6章《Principles of Proper Services》(源文件:`_epub-src/OPS/ch06.xhtml`,归一化正文 [46481:50698))
- 结论依据:原文要求服务间通信走服务接口,禁止直接访问对方数据库或共享文件。
- 原始内容:You must not share this database access with other services. Service to service communication must happen via the service interface, never by any other means: accessing the database or manipulating a hidden shared file.