---
title: New Best Practices guide for Durable Objects
description: A comprehensive guide to building effective Durable Objects applications.
image: https://developers.cloudflare.com/changelog-preview.png
---

> Documentation Index  
> Fetch the complete documentation index at: https://developers.cloudflare.com/changelog/llms.txt  
> Use this file to discover all available pages before exploring further. 

[Skip to content](#%5Ftop) 

# Changelog

New updates and improvements at Cloudflare.

[ Subscribe to RSS ](https://developers.cloudflare.com/changelog/rss/index.xml) [ View RSS feeds ](https://developers.cloudflare.com/fundamentals/new-features/available-rss-feeds/) 

![hero image](https://developers.cloudflare.com/_astro/hero.CVYJHPAd_26AMqX.svg) 

[ ← Back to all posts ](https://developers.cloudflare.com/changelog/) 

## New Best Practices guide for Durable Objects

Dec 15, 2025 

[ Durable Objects ](https://developers.cloudflare.com/durable-objects/)[ Workers ](https://developers.cloudflare.com/workers/) 

A new [Rules of Durable Objects](https://developers.cloudflare.com/durable-objects/best-practices/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](https://developers.cloudflare.com/durable-objects/examples/testing-with-durable-objects/) has also been updated with modern patterns using `@cloudflare/vitest-pool-workers`, including examples for testing SQLite storage, alarms, and direct instance access:

* [  JavaScript ](#tab-panel-2725)
* [  TypeScript ](#tab-panel-2726)

**test/counter.test.js**

```js
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 stub
  await stub.increment();
  expect(await stub.getCount()).toBe(1);


  // Trigger alarms immediately without waiting
  await runDurableObjectAlarm(stub);
});
```

**test/counter.test.ts**

```ts
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 stub
  await stub.increment();
  expect(await stub.getCount()).toBe(1);


  // Trigger alarms immediately without waiting
  await runDurableObjectAlarm(stub);
});
```

```json
{"@context":"https://schema.org","@type":"BlogPosting","@id":"https://developers.cloudflare.com/changelog/post/2025-12-15-rules-of-durable-objects/#page","headline":"New Best Practices guide for Durable Objects · Changelog","description":"A comprehensive guide to building effective Durable Objects applications.","url":"https://developers.cloudflare.com/changelog/post/2025-12-15-rules-of-durable-objects/","inLanguage":"en","image":"https://developers.cloudflare.com/changelog-preview.png","dateModified":"2025-12-15","datePublished":"2025-12-15","publisher":{"@type":"Organization","name":"Cloudflare","url":"https://www.cloudflare.com/"},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
```
