A small Durable Objects example you can adapt quickly
This example uses a tiny counter object because the shape is easy to understand and still proves the important DO wiring.
A counter is not glamorous, but it teaches the real ingredients: one binding, one class, one namespace lookup, and one request path that exercises state.
- Config focus
- Explicit class discovery and DO binding
- Runtime shape
- Namespace lookup plus
- Best use
- Counters, room state, and small single-identity coordination examples
Start by wiring the binding clearly in config
Minimal Durable Object config
Then use it in one honest runtime path
- This tiny shape already proves that the object class, namespace, and fetch path are wired correctly.
- Once this works, richer room or lock logic becomes a normal extension instead of a blind leap.
A tiny object and fetch path
Lock in the behavior with one small test or smoke path
The tiny state machine is enough
You do not need a chat app to learn Durable Objects. One counter proves the important mechanics without burying them.
A matching local test
Previous
Testing Durable Objects
Durable Objects are well-supported in the default Devflare harness, which means you can test real object behavior without hand-building a fake namespace first.
Next
Queues
Devflare models Queue producers and consumers explicitly, which makes local tests and preview naming much easier to reason about.