Understanding when to use stateful services and when to rely on external persistence in Azure Service Fabric

后端 未结 3 1854
礼貌的吻别
礼貌的吻别 2021-01-30 02:58

I\'m spending my evenings evaluating Azure Service Fabric as a replacement for our current WebApps/CloudServices stack, and feel a little bit unsure about how to decide when ser

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-30 03:33

    To answer @Trond's sedcondary question which is, "What does, 'if we do not implement the optional persistance' indicate here?"

    An actor is always a stateful service, and its state can be configured, using an attribute on the actor class, to operate in one of three modes:

    1. Persisted. The state is replicated to all replica instances, and it also written to disk. This the state is maintained even if all replicas are shut down.
    2. Volatile. The state is replicated to all replica instances, in memory only. This means as long as one replica instance is alive the state is maintained. But when all replicas are shut down the state is lost and cannot be recovered after they are restarted.
    3. No persistence. The state is not replicated to other replica instances, nor to disk. This provides the least state protection.

    A full discussion of the topic can be found in the Microsoft documentation

提交回复
热议问题