知识卡片

普通读书笔记卡 · 2652.b.3

无状态实例把历史移出本地

理解等级:高级

服务响应若依赖请求历史,可把历史放客户或外部数据库,使新旧实例都能处理同一请求,便于失败恢复与横向扩展。“无状态”是实例不私藏必要历史,并非系统没有状态。粘性会话可缓解难以外置的场景,却把用户绑到可能失效或过载的单实例,需明确限制。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 云与分布式计算 · 查看原书依据

      Stateful services lose their history if they fail, and recovering that state can be difficult. Also, as we will see in the next section, new service instances may be created, and designing services to be stateless allows a new service instance to process a client request and produce the same response as any other service instance.

    参考来源

    - 位置:《Software Architecture in Practice, 4th Edition》第17章《云与分布式计算》(来源项目:book-sources;源文件:extracted/Software Architecture in Practice, 4th Edition/_epub-src/ch17.html) - 结论依据:所引连续原文给出本卡机制或取舍;条件与示例结合本节已读上下文解释。 - 原始内容:Stateful services lose their history if they fail, and recovering that state can be difficult. Also, as we will see in the next section, new service instances may be created, and designing services to be stateless allows a new service instance to process a client request and produce the same response as any other service instance.