durable-objects

Coordinate and persist state across Cloudflare Workers with Durable Objects.

Updated Jan 19, 2026
One-click install
npx skills add https://github.com/andrewkoumoudjian/personnal-setup --skill durable-objects-andrewkoumoudjian
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: durable-objects
Source: https://github.com/andrewkoumoudjian/personnal-setup/tree/main/.opencode/skill/durable-objects
Command: npx skills add https://github.com/andrewkoumoudjian/personnal-setup --skill durable-objects-andrewkoumoudjian

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Cloudflare Durable Objects provide a pattern to coordinate and persist state across edge workers, enabling per-entity storage, deterministic routing, and real-time coordination at scale.

Core Features & Use Cases

  • One DO per chat room, game session, or tenant to ensure strong coordination.
  • Implement RPC methods, alarms, and WebSocket handlers with structured patterns.
  • Integrate SQLite storage and wrangler migrations, plus testing with Vitest, to ensure reliability and observable behavior.
  • Review DO code for best practices and maintainability across deployments.

Quick Start

Create a simple Durable Object example that coordinates a chat room and stores messages using SQLite to see it in action.

Frequently Asked Questions about durable-objects

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

FAQPage Schema
How do I coordinate and persist state across Cloudflare Workers using Durable Objects?

Cloudflare Durable Objects coordinate and persist state across edge workers by providing per-entity storage, deterministic routing, and real-time coordination. You can implement RPC methods, alarms, and WebSocket handlers using structured patterns to ensure strong coordination for specific entities like chat rooms or game sessions.

How do I test Cloudflare Durable Objects with Vitest?

You test Durable Objects with Vitest by applying provided structured guidance and code examples to ensure reliability and observable behavior. This testing approach validates your RPC methods, alarm triggers, and WebSocket handlers before deploying your edge computing application.

Can I integrate SQLite storage with Cloudflare Durable Objects?

Yes, you can integrate SQLite storage with Durable Objects alongside Wrangler migrations. This combination allows you to persist messages and application state locally at the edge, enabling real-world use cases like chat rooms and booking systems with reliable data storage.

What are the best practices for building WebSocket handlers in Cloudflare Durable Objects?

Best practices for WebSocket handlers in Durable Objects involve using structured patterns for real-time coordination across edge workers. You should implement dedicated RPC methods and review your code against provided guidelines to maintain application reliability and observability during real-time sessions.

Does this approach work for managing per-tenant state in edge computing applications?

Yes, using one Durable Object per tenant, chat room, or game session ensures strong coordination and deterministic routing in edge computing applications. This per-entity isolation allows you to maintain consistent state and handle real-time interactions reliably across Cloudflare Workers.

How do I configure Wrangler for Cloudflare Durable Objects and SQLite migrations?

You configure Wrangler for Durable Objects by setting up migrations for SQLite storage and defining your edge worker bindings. Provided reference materials and code examples guide you through the Wrangler configuration process to ensure correct deployment and state persistence.