Actors
An actor is a stateful entity identified by a type name and an instance key — like ShoppingCart["user-123"] or Counter["page-views"]. Each actor instance has durable, server-backed state and exposes operations that callers invoke remotely. Orcher guarantees that exclusive operations on the same key are serialized — no two mutations run concurrently on the same actor instance, eliminating race conditions without locks.
Actors are ideal when you need:
- Per-entity state — shopping carts, user sessions, device twins, game lobbies
- Single-writer safety — counters, balances, inventory levels where concurrent writes would corrupt data
- Low-latency reads — shared operations run concurrently, so reads never block behind other reads
- Location transparency — callers invoke operations by name and key; Orcher routes to the right worker
How Actors Differ from Workflows
Workflows orchestrate a sequence of steps with journaling and replay. Actors manage persistent state for individual entities with operation-level concurrency control. Use workflows for multi-step processes ("process this order"), and actors for stateful objects ("this user's cart").
ShoppingCart["user-123"]
type + key → unique instance
State
items[...]
total59.99
Operations
⊘add_itemexclusive
⊘remove_itemexclusive
◎get_cartshared
Concurrency
Exclusive
One at a time · serialized
Shared
Many concurrent · read-only