3
votes

Hi I have some reliable actors which I want to backup. I'm thinking of full backup every day and incremental backup once the state changes and maybe before each deployment. Reading the documentation and example didn't help me because there are using services.

I found an example on github: https://github.com/Microsoft/azure-docs/blob/master/articles/service-fabric/service-fabric-reliable-actors-platform.md But I have some doubts using the remoting contract and call all actors. This will block the actor since its kind of single threaded. Is this really the best practice?

Maybe it will be beter to forward all the changes to an event hub and the store it in a real database. Or should I use a reminder which will trigger the backup task.

1
I think the Actor service is called and not the actor it self. Maybe I'll create a task with a while(true) which will do the backup job.Thieme

1 Answers

1
votes

Reliable Actors abstraction is built on ActorService which. is an implementation of StatefulServiceBase (Reliable Service). As explained in the Backup and restore Reliable Actors, you can implement a custom ActorService to get access to the same BackupAsync and RestoreAsync APIs as if you were building a Reliable Service. So you can program your ActorService to backup periodically as you were thinking. Note that when an ActorService backups up, it backs up all the Actors that reside on that replica. Hence, backing up every time an Actor's state changes might be expensive. I would recommend deciding on the acceptable Recovery Point Objective for your application and incrementally backing up at the relevant periodicity.

More information on how to build a custom ActorService can be found in Custom Actor Service section.

Please note that in the current release, ActorService does not support incremental backups: "The KvsActorStateProvider currently only supports full backup" Backup and Restore Reliable Actors.