Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Service Fabric reliable actors vs reliable services

I am new to Azure Service Fabric and the biggest questions I have are

  1. When should I use reliable actors? Give me practical examples please.
  2. When should I use reliable services? Give me practical examples please.
like image 479
spdev Avatar asked Apr 06 '16 06:04

spdev


People also ask

What is reliable service in service fabric?

Reliable Services is one of the programming models available on Service Fabric. Another is the Reliable Actor programming model, which provides a Virtual Actor application framework on top of the Reliable Services model. For more information on Reliable Actors, see Introduction to Service Fabric Reliable Actors.

What is reliable actor?

Reliable Actors is a Service Fabric application framework based on the Virtual Actor pattern. The Reliable Actors API provides a single-threaded programming model built on the scalability and reliability guarantees provided by Service Fabric.

What is an actor Service?

An actor service is a novel kind of assertion that describes the consequences of a message sent to a given actor, both in terms of consequent messages that will be sent, and functional properties that will be guaranteed.

What types of services are support by Azure service fabric?

Service Fabric powers many Microsoft services today, including Azure SQL Database, Azure Cosmos DB, Cortana, Microsoft Power BI, Microsoft Intune, Azure Event Hubs, Azure IoT Hub, Dynamics 365, Skype for Business, and many core Azure services.


2 Answers

Taken a look at the differences:

  • State analogy : Actors work on a single instance of an object graph. Services usually have state for multiple callers.
  • Scope : Actors can’t work alone, because of their size (more like objects).
  • Life-cycle : Actors are only active when used, so more will fit on your available server resources
  • Concurrency : Actors enforce single threaded access
  • State : Actors just modify the aggregate, services work on sets so often use transactions on sets for ACID behavior.
  • Communication : Actors communicate through channels provided by the platform. Services may choose otherwise.
  • Access : Actors in the cluster can’t be reached from the outside by default. You’ll probably need a Service that provides access.

Samples when to use an actor:

  • For every user of your mobile app you could have one actor.
  • For every thermostat that sends information to your application you could have one actor.
  • For every customer of your e-commerce site, you could have one shopping-basket actor.

Create a service in the cases that you are probably used to. Create a reliable service that provides a service for multiple users at once. For example a weather service.

like image 56
Pascal Naber Avatar answered Sep 28 '22 08:09

Pascal Naber


I don't mean to use a word to define itself, but use Reliable Actors only if you've determined your problem fits the actor design pattern. Actors are a design pattern much like many of the Gang of Four design patterns. If your problem fits one of the patterns, use it. If it doesn't, it's best not to try to shoehorn your problem into the wrong pattern.

In Service Fabric, Reliable Actors are an implementation of the Virtual Actor pattern. It has certain rules of operation and caveats that go with them. This is a good doc to read to get an idea of how the Reliable Actor framework works and whether or not it meets your requirements: https://azure.microsoft.com/en-us/documentation/articles/service-fabric-reliable-actors-platform/

Reliable Actors are in fact just a framework built on top of Reliable Services, so all the same scaling, partitioning, and distribution rule apply.

like image 40
Vaclav Turecek Avatar answered Sep 28 '22 07:09

Vaclav Turecek