知识卡片

问题卡 · 5146

队列缓冲集群扩展处理

理解等级:中级

突发请求或长任务积压可能压垮同步执行链路,需要分别缓冲接收压力与增加处理能力。

持久队列把接收与处理解耦,可快速确认并等待后台执行;集群增加处理器消化积压,也可让单机故障时其他处理器继续服务。二者能在公共接口后引入。

排队等待同样消耗作业或任务时限;若消息常在处理前超时,需检查处理能力。消息必须自描述、共享状态独立,任务可以并行,扩容才有基础。队列与集群并不自动保证恰好执行一次或跨节点一致性,仍依赖[[可组合服务的动作契约]]。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 超媒体工作流 · 查看原书依据

      By adding a message queue between the service interface and the service itself, you can reduce the time it takes for a request to get acknowledged even if it will take some time before the request is processed (Figure 7-13). This technique is especially easy if you are expressing workflow requests as documents (Recipe 7.5).

    参考来源

    - 位置:《RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)》第7章《超媒体工作流》§7.19(来源项目:book-sources;源文件:extracted/RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)/_epub-src/OEBPS/ch07.xhtml) - 结论依据:原文以持久队列把接收与处理解耦,可快速确认并等待后台执行;集群增加处理器消化积压,也可让单机故障时其他处理器继续服务的方式说明该用途;同节示例与讨论补充了卡内条件和边界。 - 原始内容:By adding a message queue between the service interface and the service itself, you can reduce the time it takes for a request to get acknowledged even if it will take some time before the request is processed (Figure 7-13). This technique is especially easy if you are expressing workflow requests as documents (Recipe 7.5).