durable-objects

Design and route Durable Objects with SQLite storage and RPC methods.

2|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/iadr-dev/colab --skill durable-objects-iadr-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: durable-objects
Source: https://github.com/iadr-dev/colab/tree/main/skills/coding/cloudflare-skills/skills/durable-objects
Command: npx skills add https://github.com/iadr-dev/colab --skill durable-objects-iadr-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Durable Objects let you build stateful, coordinated services on Cloudflare’s edge, instead of forcing chat/game/session logic into stateless Workers that lose important coordination state.

Core Features & Use Cases

  • Design and routing Durable Objects: Create one Durable Object per coordination “atom” (room, match, user) and use deterministic routing via getByName for consistent behavior.
  • State management with SQLite: Use Durable Object SQLite storage for durable primary data, including migrations via wrangler config.
  • Concurrency, alarms, and RPC: Apply blockConcurrencyWhile only for initialization, implement RPC methods (instead of fetch handlers), and schedule per-DO work with alarms.
  • Testing guidance: Set up and run Durable Object tests using @cloudflare/vitest-pool-workers with unit/integration patterns.

Quick Start

Use the durable-objects skill to implement a stateful chat room Durable Object backed by SQLite and validated by a Vitest suite.

Frequently Asked Questions about durable-objects

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build stateful coordination services on Cloudflare Workers?

Durable Objects provide per-entity storage, deterministic routing, and edge-local execution to build stateful coordination services on Cloudflare. They fit scenarios like chat rooms, multiplayer matches, and booking systems.

When should I use Cloudflare Durable Objects instead of stateless Workers?

Use Durable Objects when coordination logic requires persistent state that stateless Workers lose. They provide one instance per entity, ensuring consistent behavior for real-time WebSocket-style handlers and scheduled per-entity work.

What's the best way to manage SQLite storage and migrations for Durable Objects?

Manage Durable Object SQLite storage by defining migrations via your wrangler configuration file. This ensures your durable primary data schema is versioned and correctly applied during deployment.

Do I need blockConcurrencyWhile for Durable Object initialization?

Use blockConcurrencyWhile sparingly, applying it only for Durable Object initialization. For regular request handling, implement RPC methods instead of fetch handlers to manage entity interactions.

How do I test Cloudflare Durable Objects with Vitest?

Test Durable Objects by configuring and running your suite using @cloudflare/vitest-pool-workers. This pool supports unit and integration testing patterns specifically designed for the Cloudflare Workers runtime.

Can I schedule per-entity background work using Cloudflare Durable Objects?

Yes, you can schedule per-Durable Object background work using alarms. This allows individual entities like game matches or user sessions to execute delayed or recurring tasks deterministically at the edge.