💻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.
Phase 1Why Actors: Shared State Is the Bug
See shared state as the real concurrency bug.
Shared memory is the concurrency bug, not the solution
6 minShared memory is the concurrency bug, not the solution
An actor is exactly three things — state, mailbox, behavior
6 minAn actor is exactly three things — state, mailbox, behavior
A message is a fact; a method call is a request
7 minA message is a fact; a method call is a request
Actors are addressed, not called — and that changes everything
7 minActors are addressed, not called — and that changes everything
Phase 2Build a Tiny Actor System
Build a tiny actor, mailbox, and message loop.
An actor is a loop that reads a queue and updates state
8 minAn actor is a loop that reads a queue and updates state
The mailbox is the contract — everything else is implementation
7 minThe mailbox is the contract — everything else is implementation
Reply-to turns fire-and-forget into request-response
8 minReply-to turns fire-and-forget into request-response
One actor per concept — scale the graph, not the actor
7 minOne actor per concept — scale the graph, not the actor
Actors spawn actors — and links make crashes propagate
8 minActors spawn actors — and links make crashes propagate
Phase 3Isolation, Supervision, and Failure
Wire in isolation, supervision, and failure strategies.
Your payment worker just got a 500 from Stripe — what does the message handler do?
8 minCrash the actor and let the supervisor handle restart — defensive recovery belongs to the supervisor, not the handler
One of 100 upload workers just crashed on a corrupt file — which supervision strategy do you pick?
7 minMatch the supervision strategy to actor independence — one-for-one for independent workers, one-for-all for coupled actors, rest-for-one for linear pipelines
Two services share a user-profile cache behind a distributed lock — where do actors change the design?
8 minIsolate state behind an owning actor — the actor becomes the single writer, everyone else sends messages to the owner
Your ingestion pipeline has a 1M-deep mailbox — which fix actually solves this, and which fix makes it worse?
8 minApply 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.
Model an order-fulfillment workflow as a running actor graph
20 minModel 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.
Related paths
🐳Docker Containers Basics
Build the mental model first, then the commands — from containers vs VMs through images, layers, volumes, and networking to composing a multi-service app.
🧪Property-Based Testing
Go beyond example-based tests — learn to express what your code should always do, then let a framework find the inputs that break it.
🦀Rust's Ownership Model
Build a working mental model of Rust's ownership system — from stack vs heap intuition through borrow checker mastery — so you can read and write Rust without fighting the compiler.
💻Elixir Pattern Matching
Stop reading `=` as assignment and start using it as Elixir's core flow-control tool — through function heads, guards, and `with` — until you can rewrite a tiny command parser without a single `if`.