A new Rules of Durable Objects guide is now available, providing opinionated best practices for building effective Durable Objects applications. This guide covers design patterns, storage strategies, concurrency, and common anti-patterns to avoid.
Key guidance includes:
- Design around your “atom” of coordination — Create one Durable Object per logical unit (chat room, game session, user) instead of a global singleton that becomes a bottleneck.
- Use SQLite storage with RPC methods — SQLite-backed Durable Objects with typed RPC methods provide the best developer experience and performance.
- Understand input and output gates — Learn how Cloudflare’s runtime prevents data races by default, how write coalescing works, and when to use
blockConcurrencyWhile(). - Leverage Hibernatable WebSockets — Reduce costs for real-time applications by allowing Durable Objects to sleep while maintaining WebSocket connections.
The testing documentation has also been updated with modern patterns using @cloudflare/vitest-pool-workers, including examples for testing SQLite storage, alarms, and direct instance access:
JavaScript
import { env, runDurableObjectAlarm } from "cloudflare:test";import { it, expect } from "vitest";it("can test Durable Objects with isolated storage", async () => {const stub = env.COUNTER.getByName("test");// Call RPC methods directly on the stubawait stub.increment();expect(await stub.getCount()).toBe(1);// Trigger alarms immediately without waitingawait runDurableObjectAlarm(stub);});TypeScript
import { env, runDurableObjectAlarm } from "cloudflare:test";import { it, expect } from "vitest";it("can test Durable Objects with isolated storage", async () => {const stub = env.COUNTER.getByName("test");// Call RPC methods directly on the stubawait stub.increment();expect(await stub.getCount()).toBe(1);// Trigger alarms immediately without waitingawait runDurableObjectAlarm(stub);});
Source: Cloudflare
Latest Posts
- (Updated) Introducing simplified admin controls to manage external collaboration in Teams admin center [MC1183006]
![(Updated) Introducing simplified admin controls to manage external collaboration in Teams admin center [MC1183006] 2 pexels thisisengineering 3862606](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)
- Outlook: retiring “Contact Masking” (hide suggested recipients) – March 31, 2026 [MC1234566]
![Outlook: retiring “Contact Masking” (hide suggested recipients) - March 31, 2026 [MC1234566] 3 pexels eye4dtail 134402](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)
- Microsoft Teams: Retirement of the Microsoft Teams app from the Amazon Appstore [MC1234560]
![Microsoft Teams: Retirement of the Microsoft Teams app from the Amazon Appstore [MC1234560] 4 pexels brunocortes1969 29367732](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)
- Microsoft Dataverse – Guided Table Selection for First‑Time Dataverse Sync [MC1234563]
![Microsoft Dataverse - Guided Table Selection for First‑Time Dataverse Sync [MC1234563] 5 pexels pixabay 266943](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)

![(Updated) Introducing simplified admin controls to manage external collaboration in Teams admin center [MC1183006] 2 pexels thisisengineering 3862606](https://mwpro.co.uk/wp-content/uploads/2025/06/pexels-thisisengineering-3862606-150x150.webp)
![Outlook: retiring “Contact Masking” (hide suggested recipients) - March 31, 2026 [MC1234566] 3 pexels eye4dtail 134402](https://mwpro.co.uk/wp-content/uploads/2024/08/pexels-eye4dtail-134402-150x150.webp)
![Microsoft Teams: Retirement of the Microsoft Teams app from the Amazon Appstore [MC1234560] 4 pexels brunocortes1969 29367732](https://mwpro.co.uk/wp-content/uploads/2025/06/pexels-brunocortes1969-29367732-150x150.webp)
![Microsoft Dataverse - Guided Table Selection for First‑Time Dataverse Sync [MC1234563] 5 pexels pixabay 266943](https://mwpro.co.uk/wp-content/uploads/2024/08/pexels-pixabay-266943-150x150.webp)
