concept actor model in category system administration

appears as: actor model, The actor model
Functional and Reactive Domain Modeling

This is an excerpt from Manning's book Functional and Reactive Domain Modeling.

This book focuses on messaging systems using the actor model of computation. Actors provide a fairly high level of concurrency construct that helps you organize your model in terms of loosely coupled modules (they can be bounded contexts as well) that interact using asynchronous messages. We’ll discuss how a well-engineered actor system can provide resilience to your model, help you scale out and back through proper handling of back pressure, and provide overall responsiveness to your system.

  • The actor model— This is one of the primary architectural constructs that help you design your model based on asynchronous, event-driven, and nonblocking communication. The sender sends messages based on the fire-and-forget style, and the receiver’s mailbox gets them for further processing. The primary takeaway of this model is that you don’t have to handle concurrency within your code. An actor allows a single thread of execution within itself. You achieve concurrency by creating a huge number of actors, which are lightweight abstractions of computation. Some actor implementations such as Akka (http://akka.io) also offer features such as fault tolerance, location transparency, and distribution.
  • An actor is usually implemented as an extremely lightweight construct. Typically, you can have millions of actors created in a laptop of standard configuration that can process messages in parallel. Actors were first popularized in the Erlang programming language (www.erlang.org), which uses this model almost exclusively as the primary concurrency primitive. Inspired by Erlang, Akka brings the actor model to the JVM. Though on some finer points they differ in design, Akka actors are almost equivalent to what you get on the Erlang/OTP platform.

    In this section, you’ll look at Akka actors mainly from a domain modeling point of view. I won’t cover all the capabilities that Akka offers; for that, you can look at Raymond Roestenburg’s Akka in Action (Manning, 2015). This section highlights the capabilities of the actor model that are useful for designing domain models and points out weaknesses that you may want to avoid. Let’s start with some of the primary features that Akka actors offer: