知识卡片
队列加检查点支持恢复
队列持久服务从消息队列读输入,周期性保存当前状态及已处理位置;失败时先加载检查点,再按消息位置恢复处理。这样不必为每条消息保存完整状态,也可复用队列的持久能力。检查点状态与位置必须对应,边界消息的重复处理要有设计;书中“重处理最后消息”不等于天然恰好一次副作用。
它同样要满足[[确定性重放恢复本地状态]]中的输入和语义恢复条件,不能只保存一个消息编号。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 服务端架构 · 查看原书依据
In a message queue-based persistent service, the client places messages in a message queue (e.g., Apache Kafka), and the service reads from the queue and processes the messages. From time to time, the service saves its current state together with the last message ID processed.
参考来源
- 位置:《Software Architecture and Decision-Making》第11章《Server Architectures》(来源项目:book-sources;源文件:extracted/Software Architecture and Decision-Making Leveraging Leadership, Technology, and Product Management to Build Great Products… (Srinath Perera)/_epub-src/ch11.xhtml)
- 结论依据:摘录说明队列持久服务从消息队列读输入,周期性保存当前状态及已处理位置;失败时先加载检查点,再按消息位置恢复处理。其余条件结合本章相邻例子与取舍说明,数字示例不作当前性能承诺。
- 原始内容:In a message queue-based persistent service, the client places messages in a message queue (e.g., Apache Kafka), and the service reads from the queue and processes the messages. From time to time, the service saves its current state together with the last message ID processed.