Back to library

💻The Actor Model

Stop reasoning about locks and start reasoning about mailboxes — across 14 drops you'll build a tiny actor runtime, wire up supervision, and finish by modeling a real workflow as an actor graph.

Applied14 drops~2-week path · 5–8 min/daytechnology

Phase 1Why Actors: Shared State Is the Bug

See shared state as the real concurrency bug.

4 drops
  1. Shared memory is the concurrency bug, not the solution

    6 min

    Shared memory is the concurrency bug, not the solution

  2. An actor is exactly three things — state, mailbox, behavior

    6 min

    An actor is exactly three things — state, mailbox, behavior

  3. A message is a fact; a method call is a request

    7 min

    A message is a fact; a method call is a request

  4. Actors are addressed, not called — and that changes everything

    7 min

    Actors are addressed, not called — and that changes everything

Phase 2Build a Tiny Actor System

Build a tiny actor, mailbox, and message loop.

5 drops
  1. An actor is a loop that reads a queue and updates state

    8 min

    An actor is a loop that reads a queue and updates state

  2. The mailbox is the contract — everything else is implementation

    7 min

    The mailbox is the contract — everything else is implementation

  3. Reply-to turns fire-and-forget into request-response

    8 min

    Reply-to turns fire-and-forget into request-response

  4. One actor per concept — scale the graph, not the actor

    7 min

    One actor per concept — scale the graph, not the actor

  5. Actors spawn actors — and links make crashes propagate

    8 min

    Actors spawn actors — and links make crashes propagate

Phase 3Isolation, Supervision, and Failure

Wire in isolation, supervision, and failure strategies.

4 drops
  1. Your payment worker just got a 500 from Stripe — what does the message handler do?

    8 min

    Crash the actor and let the supervisor handle restart — defensive recovery belongs to the supervisor, not the handler

  2. One of 100 upload workers just crashed on a corrupt file — which supervision strategy do you pick?

    7 min

    Match the supervision strategy to actor independence — one-for-one for independent workers, one-for-all for coupled actors, rest-for-one for linear pipelines

  3. Two services share a user-profile cache behind a distributed lock — where do actors change the design?

    8 min

    Isolate state behind an owning actor — the actor becomes the single writer, everyone else sends messages to the owner

  4. Your ingestion pipeline has a 1M-deep mailbox — which fix actually solves this, and which fix makes it worse?

    8 min

    Apply bounded mailboxes with blocking or explicit drop — backpressure is a system property, not a per-actor setting

Phase 4Model a Real Workflow as an Actor Graph

Model a real workflow as an actor graph.

1 drop
  1. Model an order-fulfillment workflow as a running actor graph

    20 min

    Model an order-fulfillment workflow as a running actor graph

Frequently asked questions

What is the actor model in programming?
This is covered in the “The Actor Model” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
How are actors different from threads and locks?
This is covered in the “The Actor Model” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
Do I need Erlang or Akka to use actors?
This is covered in the “The Actor Model” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
What is supervision in the actor model?
This is covered in the “The Actor Model” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
When should I use actors instead of async/await?
This is covered in the “The Actor Model” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.