In programming, what is the actor model?


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

What I realized the concept is that there are several actors and each one takes responsibility for completing a certain task. It seemed to me to be something very similar to the same microservices.

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

asked by anonymous 17.02.2017 / 11:26

2 answers


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

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

Azure Service Fabric especially emphasizes the Actor model by explicitly defining Actors. Find more information on this here: link

Theoretically, the actors can be seen as small microServices. The actors are directed messages, they must 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 microservice architecture is primarily an organizational decision. It's not about scaling an application, but about scaling a development organization. And some of the key principles of microservices are things like deployment independence, isolation, having separate developments and deployment cycles, etc.

These are things you usually do not get just by 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 the available actor frames). So while actors provide scalability and better distributed competition and development management, they still do not provide the level of separation and isolation that a microservice-based architecture provides and therefore do not meet the same needs.

In general, in a microservice architecture (MSA), the actor is the microservice itself according to link

27.02.2017 / 15:16

Actor Model The Model of Actors, which had its development initiated by Carl Hewitt (Mavadatt, 2002), is used in some programming languages as a method of concurrent programming. Initially, the model proposed by Hewitt was a of agents, developed in the smalltalk language, based on the programming oriented to objects, each object was considered as an active entity, receiving, sending and reacting to messages. These objects, as well as the interaction messages, were called actors (Guy, 2003).

Actor Settings According to (Mavadatt, 2002), actors are competing and independent objects that interact by sending messages asynchronously. For (Guy, 2003), an actor may have arbitrarily many "known", that is, he can "know" about others actors and send messages to these. (Lieberman, 1987) states that actors end up with distinction between data and procedures, creating dynamically allocating resources on a parallel machine. In the composition of such an object, we have that an actor encapsulates states, a set of methods and an active thread (Figure 1). Each actor has his unique mailing address, serving as a target for receiving messages, which is associated with unlimited communication, thus forming a queue for receiving messages. (Varela, 2001).

Source: link

17.02.2017 / 12:12