← Back to list
Computing & Embedded
#액터모델#동시성#메시지전달#감독트리#분산시스템
Last updated · 2026-11-14

Actor Model

1. Overview

A. Definition

The Actor Model is a mathematical model of concurrent computation that treats the Actor as the universal primitive, describing every computation as interactions among independent objects that share no state and communicate solely through asynchronous message passing. That is, it discards the traditional mindset of "protect shared memory with locks" and designs concurrency on the principle of "share nothing; communicate only by messages."

The Actor Model began as a theory proposed in 1973 by Carl Hewitt and colleagues during artificial intelligence research, but it was only rediscovered across industry after multicore and distributed systems became ubiquitous in the 2000s. Behind this lies the fundamental limitation of the traditional shared-memory + lock concurrency model. When threads share global state protected by mutexes, lock contention worsens as core counts grow, scalability collapses, and the slightest mistake in lock ordering produces non-deterministic faults such as [[deadlock]] and [[race-condition]]. Such faults are hard even to reproduce, earning the painful nickname "Heisenbugs."

The Actor Model solves this by eliminating the root cause (shared state) itself. Each actor encapsulates its own state so that no one outside can touch it directly, and it talks to other actors only through messages. Because an actor processes one message at a time, sequentially, there is simply no concurrent access inside an actor. As a result, locks become unnecessary, and the very notions of critical section, mutex, and semaphore vanish from the design. Concurrency is redefined from "a locking problem" into "a message-exchange problem."

Another reason this model draws attention is that it unifies concurrency and distribution into a single abstraction. Whether an actor lives in the same process or on a different server, it is reached the same way: "send a message to an address." Thanks to this location transparency, concurrency code written for a single machine can scale to a cluster of dozens with little change. This is why the Actor Model became the de facto standard in domains like telecom, messaging, and game servers, which must handle millions of independent entities simultaneously.

B. Background and Necessity

Modern servers must handle "millions of concurrent connections at once," not merely "one request fast." A single messaging server maintains the sessions of millions of users, a game server updates the state of hundreds of thousands of players in real time, and an IoT gateway ingests streams from millions of sensors. Trying to cover such massive concurrency with OS threads hits a wall at a few thousand, because each thread costs several MB of stack plus kernel-switching overhead.

The Actor Model answers this need in two ways. First, actors are lightweight entities managed by a runtime rather than OS threads, so a single process can host millions of them (an Erlang process starts with a stack of only a few hundred bytes). Second, state isolation removes locks, so scaling nearly linearly with added cores becomes possible. Add the supervision scheme described later, and you naturally gain fault isolation and self-healing, where the whole system survives even if some actors die. This is the core reason the Actor Model is chosen as a design foundation for high-availability, high-concurrency systems.

To grasp the scale, contrast the numbers. A typical OS thread has a default stack of 1–8 MB, so launching even a few thousand on a 16 GB server consumes several GB in stacks alone and sends context-switch costs soaring. A lightweight actor (or goroutine or virtual thread), by contrast, starts at hundreds of bytes to a few KB and grows only as needed, so the same server can sustain hundreds of thousands to millions. Exactly where the "thread-per-connection" model collapses at a few thousand connections, the "actor-per-connection" model stretches to millions. This tens-to-hundreds-fold density difference is how services like WhatsApp handled enormous traffic with few servers, and it shows the Actor Model is not a mere programming taste but a design choice that governs infrastructure cost.

2. Structure and Core Concepts of the Actor Model

The elements that compose the Actor Model are simple, but they mesh together to produce the property of "concurrency without sharing." The structural diagram below shows the internal composition of one actor and how actors communicate.

flowchart LR
  subgraph A1["Actor A"]
    MB1["Mailbox"] --> BH1["Behavior"]
    BH1 --> ST1["Internal State"]
  end
  subgraph A2["Actor B"]
    MB2["Mailbox"] --> BH2["Behavior"]
    BH2 --> ST2["Internal State"]
  end
  BH1 -- "async message send" --> MB2
  BH2 -- "async message send" --> MB1
  style ST1 fill:#fde8e8,stroke:#c0392b
  style ST2 fill:#fde8e8,stroke:#c0392b

As the figure shows, each actor's internal state can never be accessed directly from outside (marked in red); it changes only when the behavior processes a message that arrived in the mailbox. Let us examine the principle of each component in turn.

A. Actor and state encapsulation. An actor is a self-contained unit of computation holding state, behavior, and a mailbox. The key is state encapsulation. Objects in object orientation also claim encapsulation, but typically another thread can "directly call" a method and touch the internal state concurrently. An actor, by contrast, offers no path for the outside to touch its state via a call. To change the state you can only send a message to "request" it, and the actual change is carried out by that actor itself within its own thread of execution. For this reason, code inside an actor can be written as if single-threaded, and the developer need write no concurrency-defense code.

B. Mailbox and sequential processing. Each actor has a mailbox, a queue that accumulates the messages sent to it. The actor takes messages from this mailbox one at a time, sequentially, and processes them. This very "one at a time" rule is the pillar that holds up the safety of the Actor Model. No matter how many actors send messages at once, the receiving actor lines them up in the queue and processes them one by one, so concurrent access to its internal state can never arise. That said, this serial processing carries the trade-off that a single actor can become a bottleneck, discussed later in the considerations.

C. Address and location transparency. An actor is identified by a unique address (reference), and to send a message you need only know this address. The sender need not know whether the target actor is in the same JVM, on another node, or even restarting after a failure right now. This location transparency is the key device that naturally extends single-node code to a distributed cluster. In practice, one must beware that inter-node messages incur serialization and network costs, so complete transparency can be an illusion (the "fallacies of distributed computing").

D. Behavior and state transition. The processing logic an actor runs when it receives a message is its behavior. As a result of processing a message, an actor can (1) change its own state, (2) send a finite number of messages to other actors, (3) create new actors, and (4) replace the behavior itself for the next message. In particular, (4) lets you use an actor like a state machine: switching to a different behavior "before authentication" versus "after authentication," for instance, enables clean protocol implementation without conditional branching.

These four abilities are Hewitt's "three fundamental actor behaviors (change state, send messages, create actors)" plus the behavior replacement added by modern implementations, and with these alone one can express arbitrary concurrent computation, which is why the Actor Model is regarded as a Turing-complete concurrency model. In practice (3) actor creation matters because it enables the "actor-per-request" pattern—spawning a dedicated actor on the fly for each incoming request—or the "actor-per-entity" pattern—mapping one domain entity such as a user, session, or order to one actor. The latter leads to a design that models real-world entities 1:1 as in-memory actors, like a "digital twin."

3. Message Processing and Operating Principles

Communication between actors is asynchronous and non-blocking by default. The sending actor places a message in the recipient's mailbox and immediately continues its own work, without stopping to await a reply. This "fire-and-forget" approach is the secret to high throughput. The sequence diagram below shows the typical flow in which a client request is distributed to several actors, processed asynchronously, and aggregated.

sequenceDiagram
  participant C as Client
  participant R as Router Actor
  participant W1 as Worker Actor 1
  participant W2 as Worker Actor 2
  C->>R: task request message
  R->>W1: subtask A (async)
  R->>W2: subtask B (async)
  Note over R: R returns at once, awaiting no reply
  W1-->>R: result A
  W2-->>R: result B
  R-->>C: aggregated result reply

In the flow above, the router actor can immediately receive its next message after fanning tasks out to the two workers, without blocking. The workers run in parallel independently and return their results asynchronously as each finishes. A crucial design decision here is the message-delivery guarantee level. The pure Actor Model often guarantees only "at-most-once" delivery; that is, messages may be lost, and ordering is guaranteed only between a given sender–receiver pair. This is a design reflecting the reality of networked distributed environments (packet loss, node failure); if reliability is needed, acknowledgment, retransmission, and idempotent handling must be designed at a higher layer.

Another key point is how request–response is woven asynchronously. A traditional method call receives the result as a return value, but for an actor "the reply is just another message." So the sender embeds its own address in the message, and the receiver fires a reply message back to that address. Many implementations wrap this in the convenience syntax of the ask pattern (returning a future value), but internally it creates a temporary actor to receive the reply. Thus the Actor Model maintains the consistent principle that every interaction reduces to messages.

Mailbox behavior also directly affects performance. The default mailbox is a FIFO queue, but many variants are used: priority mailboxes that handle urgent messages first, "selective receive" that picks only messages meeting a condition, and back-pressured mailboxes that throttle sending when the mailbox fills. In particular, mailbox backlog is a classic failure signal of an actor system. An actor whose intake outpaces its processing lets its mailbox grow without bound and exhausts memory, so combining it with [[reactive-streams-backpressure]] to control intake matters in practice. Also, messages that no behavior could handle (missing recipient, type mismatch) are collected as dead letters, used as an observability metric that exposes design defects early in operation.

4. Supervision and Fault Handling — "Let it crash"

The reason the Actor Model is valued beyond a mere concurrency technique, as a high-availability design philosophy, lies in its distinctive fault-handling model. Traditional code catches every exception defensively and strains to recover (defensive programming), but the Actor Model takes the opposite philosophy: "Let it crash." Actors are organized into a supervision tree in which a parent actor supervises child actors, and when a child dies from an unhandleable error, the parent supervisor detects it and handles it according to a defined strategy (restart, stop, escalate).

flowchart TB
  G["Top-level Guardian"]
  G --> S1["Domain Supervisor A"]
  G --> S2["Domain Supervisor B"]
  S1 --> W1["Worker Actor 1"]
  S1 --> W2["Worker Actor 2"]
  S2 --> W3["Worker Actor 3"]
  W2 -. "crash on error" .-> S1
  S1 -. "apply restart strategy" .-> W2
  style W2 fill:#fde8e8,stroke:#c0392b
  style S1 fill:#e8f0fe,stroke:#2f6fed

The insight of this approach is that it delegates the responsibility for error handling not to the place where the error occurred but to the supervisor. Each worker cleanly implements only the happy path, and when an unexpected error occurs, instead of recovering messily it simply dies and restarts to a clean initial state. This relies on the empirical rule that many software bugs are transient and state-dependent, systematizing "turn it off and on again" recovery into the system structure. The supervisor can choose strategies such as "restart only the child," "restart siblings together," or "escalate the error upward," thereby controlling the blast radius of a failure by design.

This supervision scheme originates from Erlang/OTP and led to the legendary reliability case of nine nines (99.9999999% availability, tens of milliseconds of downtime per year). Ericsson's AXD301 telecom switch is reported to have achieved this level, and the key was not making each component perfect but building a structure that recovers quickly even when it dies. This demonstrates the essence of fault tolerance: "faults are unavoidable, so design to endure them."

5. Comparison with Other Concurrency Models

To properly understand the value of the Actor Model, we must examine its differences from rival models and the reasons those differences arise. The comparison below is not a mere listing but captures the philosophical difference of "what problem is handled, and how."

Aspect Actor Model Shared memory + locks CSP (channels) Reactive streams
State sharing None (encapsulated) Shared + lock-protected None (passed via channels) None (passed via streams)
Communication Async messages (address-oriented) Direct memory access Sync channels (channel-oriented) Async data flow
Coupling Knows actor address Tight coupling Shares channels Publish–subscribe
Distributed scaling Easy via location transparency Very hard Limited Framework-dependent
Representative impls Erlang, Akka, Orleans pthread, Java synchronized Go, occam Reactor, RxJava

The most important contrast is the difference from the shared memory + locks model. The lock model is the idea of "many share one resource but prevent collisions," so as cores grow, lock contention grows and pitfalls like deadlock and priority inversion pile up. The actor idea is "don't share in the first place," so such problems structurally disappear. The price, however, is that every interaction pays the cost of copying and passing messages, so for extremely fine-grained sharing in low-latency computation (e.g., the hot path of high-frequency trading), lock-based or lock-free data structures can actually be preferable.

One should also clarify the relationship with object orientation (OOP), often confused. Object orientation as Alan Kay originally envisioned it—"independent objects exchanging messages"—is philosophically very close to the Actor Model. But objects in mainstream OOP languages degenerated into shareable data structures with "methods that other threads call directly," pushing concurrency safety onto the developer's lock responsibility. The actor returns to the "object where messages are first-class" of before this degeneration, choosing messages over calls and asynchronous replies over synchronous returns. For this reason the Actor Model is often called "true object orientation revived for the concurrency era."

The comparison with CSP (Communicating Sequential Processes) is also interesting. CSP, represented by Go's goroutines and channels, aims like actors at "don't share, communicate," but the subject of communication differs. Actors name a "recipient (actor address)" to send and accumulate asynchronously in the mailbox, whereas CSP sends via a "channel" and is synchronous (rendezvous) by default. That is, actors require the sender to know the receiver but do not block, while CSP is mutually anonymous but must meet at a channel. This difference makes actors strong at dynamic topologies and distribution, and CSP concise for static, local pipelines. Meanwhile [[reactive-streams-backpressure]] can be seen as laying a "stream that regulates flow with backpressure" abstraction atop actors, so the two are less rivals than a layered relationship.

6. Deep Dive: Industrial Cases and Recent Trends

The Actor Model did not stay in theory; it was proven in the core of the world's largest-scale services. Let us examine its substance through concrete cases and figures.

A. Erlang/Elixir ecosystem — messaging and real time. WhatsApp is famous for processing about 2 million concurrent connections per server on Erlang, handling hundreds of millions of users with only a handful of engineers. This is evidence of the extreme efficiency created by lightweight processes and supervision trees. Recently Elixir, offering more modern syntax atop the Erlang VM (BEAM), and its web framework Phoenix have risen; Discord built real-time messaging and presence (connection-status) systems in Elixir, handling state propagation for millions of concurrent users. It is a representative case showing why the Actor Model suits domains like "chat, notifications, games" that juggle countless independent sessions.

B. Akka on the JVM and its license change. On the JVM, the Scala/Java actor toolkit Akka became the de facto standard, widely used in large-scale backends across finance, telecom, and logistics. Then in September 2022, when the developer Lightbend switched Akka's license from open source (Apache 2.0) to the source-available commercial BSL (Business Source License) 1.1, it caused a major stir. In response, the Apache Foundation forked Akka's last Apache 2.0 version and carried it on as Apache Pekko, becoming an event that shows the reality of technology choices entangled with license and governance risk. From a professional engineer's viewpoint, this is an important lesson in "assessing license sustainability when adopting open source."

C. Virtual actors and Microsoft Orleans. The traditional Actor Model burdened developers with directly managing actor creation, placement, and lifecycle. Microsoft's Orleans abstracted this by introducing the concept of virtual actors (Grains), so that actors are treated "as if they always exist" and the runtime automatically activates, deactivates, and relocates them as needed. This model was applied to backends such as Xbox's Halo game services, simplifying large-scale state management. Recently, Microsoft's Dapr (Distributed Application Runtime) provides language-neutral virtual-actor building blocks, and the trend of using the Actor Model cloud-natively in Kubernetes environments is also spreading.

7. Considerations and Implications

From a professional engineer's viewpoint, the following should be strategically considered when adopting and designing with the Actor Model.

A. Adoption strategy — judging domain fit. The Actor Model is no panacea. It excels in domains that juggle many independent, stateful entities (messaging, games, IoT, telecom, workflow orchestration), but for simple request–response CRUD or work where strong transactional consistency is the core, it can add excessive complexity. Rather than a full switch, a realistic incremental strategy applies it selectively to core paths demanding high concurrency and high availability while letting the rest coexist with the existing architecture.

B. Trade-off — the price of simplicity. The price for the inside of an actor becoming simple as if single-threaded is that the system as a whole grows complex with the flow of countless asynchronous messages. Message loss, ordering, and duplication; memory blowup from mailbox backlog; the problem of one "hot actor" becoming a bottleneck; and the difficulty of debugging and tracing asynchronous flows all emerge as new challenges. One must therefore co-design distributed tracing ([[opentelemetry-observability]]), dead-letter queues, and backpressure control, and understand it not as "concurrency became easy" but as "the kind of difficulty changed."

C. Consistency and persistence design. An actor's state is in memory and can vanish when a node dies. For this, the persistent-actor pattern combined with event sourcing ([[cqrs-event-sourcing]]) is widely used: state changes are recorded as an event log and restored by replay on restart. Also, in distributed environments the singleton/sharding strategy that guarantees "only one actor for the same entity exists across the cluster" is central to data consistency, and a design that prevents duplicate activation during partitions or network splits must accompany it.

D. Organizational capability and operational maturity. The Actor Model demands a shift in mindset. For a development organization accustomed to sequential, synchronous, shared thinking, changing to asynchronous, message-based, immutable thinking carries a learning cost, and the capability to design message flows and set supervision strategies correctly decides success or failure. Operationally, too, if monitoring that can observe mailbox backlog, dead letters, and actor lifecycles is lacking, pinpointing fault causes can become harder than with lock-based approaches. Adoption must therefore presuppose organizational readiness—training, observability, and operational standards—beyond the technology choice.

E. Outlook and allied technologies. The Actor Model's use is expanding into the fine-grained state-management unit of [[microservices-architecture]], stateful computation at serverless and edge, and the autonomous-collaboration structure of AI agents. In particular, multi-agent systems in which several autonomous agents collaborate via messages conceptually meet the Actor Model's message orientation and supervision structure, leaving great room to be revisited as the theoretical foundation of next-generation distributed-intelligence architecture. A professional engineer must see through how this old 1973 model re-emerges in the new context of multicore, cloud, and AI, and make design judgments at the principle level of "shared-nothing, message-based concurrency" rather than tied to a particular framework.

References


In one line: The Actor Model is a concurrency paradigm in which lightweight, share-nothing actors communicate only by asynchronous messages and isolate faults through a supervision tree, structurally achieving lock-free massive concurrency and "Let it crash"-based high availability.