Overview of the Actor Model

Facebook
Twitter
LinkedIn

Never miss a post!

Sign up for our newsletter and get FREE Development Trends delivered directly to your inbox.

You can unsubscribe any time. Terms & Conditions.
Categories

What is the Actor Model ?

An actor model is similar in concept to an object in OOP. It is the entity that receives a message and performs computation on that message. The main difference being, that actors are isolated between each other and they don’t share memory and cannot interact directly to modify their internal state.

An actor has the following important properties.

  • An private internal state. Important to note than an actor will maintain a private state that can never be changed directly by another actor.
  • An mail address for interaction. Each actor require an address so another actor can send a message to another
  • A mailbox. Actors will process messages in sequence. If you send an actor three message they will be processed after each other, which means that the actor needs a queue to store them. The mailbox is the name of the container (queue) used by the actor.

An actor can perform the following actions.

  • Create new Actors
  • Send messages to other actors.
  • Designate what do to with the next message. This will entail modification of the internal state of the Actor. Actors may modify their own private state, but can only affect each other through messages

The main strong points of this model are the following.

  • Fault tolerance
    • In the actor model each actor is supervisor of its children. The supervisor strategy is used to handle fault tolerance. A supervisor is responsible for starting, stopping, and monitoring its child processes. The basic idea of a supervisor is that it is to keeping its child in good state. There are multiple strategies that can be used, the most basic is to restart the actor.
  • Distribution
    • With this model the actors do not need to be present on the same machine. As long as the message arrives to its destination the actors can live on separate machine, networks. This give us as easy way to scale easily vertically scale our system.
Facebook
Twitter
LinkedIn

Our website uses cookies that help it to function, allow us to analyze how you interact with it, and help us to improve its performance. By using our website you agree by our Terms and Conditions and Privacy Policy.