stateazure-service-fabricactorservice-fabric-actor

Service Fabric Actor State : where is the state read from in Persistent mode?


In Persistent mode Service fabric actor state is persisted on disk and replicated to other nodes, that is clear from the documentation. My question is on consecutive queries to the actor state, throughout the life time of the actor, is each call read from the disk or is it pulled from in memory after the first call to the disk ?


Solution

  • Vaclav from the SF team provides the answer here.

    The component that stores your data in your service is called a State Provider. State providers can be in-memory only or in-memory + local disk. The default state provider you get with an actor service is in-memory + local disk but it only keeps hot data in memory so your storage requirements are not memory bound. Contrast with the Reliable Collections state provider which currently stores all data both in-memory and on local disk, although in a future release it will also have an option to only keep hot data in memory and offload the rest to local disk.

    So data for active Actors is in memory, and state is on disk for inactive Actors. So, depending on the time between the calls, it could be either. (As the Actor life-cycle is managed for you by SF.) Two calls directly following each other will get data from memory.