storage survives.
Where it Runs
An instance is placed on first touch — the first method call to a name brings it up. After that you address it by name, never by location; the platform routes every call to wherever the instance currently lives. (idFromName accepts a locationHint
option, reserved for regional placement — see
Actor Namespace.)
Activation and Eviction
- Activated on demand. Naming an instance is cheap; the first method call to a name brings the instance up and routes the call to it.
- Kept warm while busy, evicted when idle. Between calls, an idle instance may be removed from memory to free resources, then re-activated on the next call.
- Restarted on deploy or host failure. A new code version or a host issue tears the instance down and re-creates it.
What Survives a Restart
In-memory state — instance fields likethis.x — is a cache. It vanishes on
eviction, restart, or relocation. Your actor’s storage is the truth: it is durable
and reloaded when the instance next activates. Treat memory exactly like a process that
can be SIGKILLed at any instant — only what you flushed to storage is real. (This
is guarantee 4 in Execution model.)
A common pattern is to load from storage once on activation and cache the result in
memory; just never assume the cache is still there.
Next Steps
- How it works — the execution model and its guarantees
- Addressing — naming and routing instances
- Runtime API —
ctx.storage,blockConcurrencyWhile