software-architecture – In programming, what is the actor model?

Question:

I have a co-worker who is an apologist for the actor model ( actor model , in Portuguese). In general terms it seems to be a software architecture to be applied in distributed systems or in the cloud .

From what I understood the concept is that there are several actors and each one is responsible for completing a certain task. It seemed to me to be something very similar to microservices.

Can you clarify better what the actor model actually is? (Normally additional questions are allowed, but if you can detail why the actor model is different from microservices, I appreciate it).

Answer:

Actors are isolated, single-threaded components that encapsulate their state and behavior. This is very similar to how conventional messaging services work, as actors receive input parameters through messages.

MicroServices are standalone components that by definition serve a single purpose. In theory, actors are a perfect fit for implementing environments in microServices.

Azure Service Fabric especially emphasizes the Actor model by explicitly defining Actors. Find more information about it here: https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-reliable-actors-introduction

Theoretically, actors can be seen as small microServices. Actors are message driven, they should have a single responsibility (this is not implicit in the model, but it makes sense), so there are some equivalents compared to microServices. MicroServices can also fulfill other responsibilities. It is important to remember that a microservices architecture is primarily an organizational decision. It's not about scaling an application, it's about scaling a development organization. And some of the main principles of microservices are things like deployment independence, isolation, having separate development and deployment cycles, etc.

These are things you don't usually get by just using actors. An actor-based application is still a single code base and should be deployed as a single application (at least with the current state of available actor frames). Thus, while actors provide scaling and better management of concurrency and distributed development, they still do not provide the level of separation and isolation that a microservices-based architecture provides and therefore do not meet the same needs.

Generally speaking, in a microservices architecture (MSA), the actor is the microservice itself according to http://usblogs.pwc.com/emerging-technology/what-is-microservices-architecture-think-ant-colonies- beehives-or-termite-mounds/

Scroll to Top