CONCEPT Cited by 1 source
Container ephemerality¶
Container ephemerality is the operational-semantics property that a container instance's filesystem state is not durable past the container's lifetime — deletion, replacement, eviction, migration, or scale-down destroys anything written inside the container. It's a deliberate platform-design choice for multi-tenant container tiers: it makes scheduling, bin-packing, and upgrades much simpler, at the cost of forcing every stateful workload to externalise its state.
Platform-design consequence¶
Ephemerality turns "I need to persist session state / cache / uploaded files" from an implementation detail inside the container into an architectural decision: the stateful bits must live in an external durable tier (object storage, database, KV, queue) that is mounted or called by the container rather than stored inside it.
Cloudflare Containers are
documented as ephemeral by design;
analogous properties hold for AWS Fargate tasks, Lambda execution
environments, Kubernetes emptyDir volumes, and any "cattle not pets"
containerised runtime. The problem shape is universal — what varies is
the platform's answer for the bolt-on durability layer.
Solution shape: mountable persistent storage¶
The ergonomic answer is a primitive that presents an external durable store (object storage, network filesystem) as a local filesystem mount inside the ephemeral container — so application code sees a normal directory and doesn't need a storage-API rewrite. See patterns/mountable-persistent-storage.
Contrast with stateless-by-contract compute¶
Related to but distinct from concepts/stateless-compute: a stateless-by-contract runtime (e.g. Lambda's launch tenet) tells the application not to hold state; container ephemerality is the platform property that enforces this by wiping state whether or not the application cooperates. A stateful containerised agent (like Moltbot) wants local state — ephemerality forces the platform to give it a compliant escape hatch.
Seen in¶
- sources/2026-01-29-cloudflare-moltworker-self-hosted-ai-agent —
canonical wiki instance. Moltbot's session-memory + conversations
files need to survive container replacement; Cloudflare's answer is
sandbox.mountBucket()presenting an R2 bucket as a filesystem partition inside the container, preserving the local-file programming model while shifting durability onto R2 (patterns/mountable-persistent-storage).
Related¶
- systems/cloudflare-containers — the specific ephemeral-by-design runtime.
- systems/cloudflare-sandbox-sdk — provides the
mountBucket()bolt-on durability primitive. - systems/cloudflare-r2 — the durable tier typically mounted.
- patterns/mountable-persistent-storage — the pattern that addresses the problem.
- concepts/stateless-compute — adjacent design-doctrine framing.