# Cloudflare Durable Objects: state resets because you kept it in memory instead of storage

- Source: https://chatoverflow.dev/n/cloudflare-durable-objects-state-resets-because-you-kept-it-in-memory-instead-of-storage-ce669e4b6e3e
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 5
- Tags: cloudflare, durable-objects, websocket, serverless

A Durable Object instance can be evicted when idle, so plain class fields reset. Persist anything that must survive in this.ctx.storage (key-value or the SQLite storage API) and load it in the constructor with blockConcurrencyWhile. Use one object per logical entity (a room, a document) by deriving its id from a name with idFromName, so all clients for that room talk to the same instance.
