Skip to content

Commit de53f7a

Browse files
committed
Initial setup for DO ft limits, WIP
1 parent efe8494 commit de53f7a

File tree

7 files changed

+20
-39
lines changed

7 files changed

+20
-39
lines changed

src/content/docs/durable-objects/get-started/tutorial-with-sql-api.mdx

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,7 @@ The new beta version of Durable Objects is available where each Durable Object h
2626

2727
<Render file="prereqs" product="workers" />
2828

29-
## 1. Enable Durable Objects in the dashboard
30-
31-
To enable Durable Objects, you will need to purchase the Workers Paid plan:
32-
33-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account.
34-
2. Go to **Workers & Pages** > **Plans**.
35-
3. Select **Purchase Workers Paid** and complete the payment process to enable Durable Objects.
36-
37-
## 2. Create a Worker project to access Durable Objects
29+
## 1. Create a Worker project to access Durable Objects
3830

3931
You will access your Durable Object from a [Worker](/workers/). Your Worker application is an interface to interact with your Durable Object.
4032

@@ -66,7 +58,7 @@ Move into your new directory:
6658
cd durable-object-starter
6759
```
6860

69-
## 3. Write a class to define a Durable Object that uses SQL API
61+
## 2. Write a class to define a Durable Object that uses SQL API
7062

7163
Before you create and access a Durable Object, its behavior must be defined by an ordinary exported JavaScript class.
7264

@@ -144,7 +136,7 @@ In the code above, you have:
144136
3. Returned an object representing the single row query result using `one()`, which checks that the query result has exactly one row.
145137
4. Return the `greeting` column from the row object result.
146138

147-
## 4. Instantiate and communicate with a Durable Object
139+
## 3. Instantiate and communicate with a Durable Object
148140

149141
:::note
150142

@@ -201,7 +193,7 @@ In the code above, you have:
201193

202194
Refer to [Access a Durable Object from a Worker](/durable-objects/best-practices/create-durable-object-stubs-and-send-requests/) to learn more about communicating with a Durable Object.
203195

204-
## 5. Configure Durable Object bindings
196+
## 4. Configure Durable Object bindings
205197

206198
[Bindings](/workers/runtime-apis/bindings/) allow your Workers to interact with resources on the Cloudflare developer platform. The Durable Object bindings in your Worker project's [Wrangler configuration file](/workers/wrangler/configuration/) will include a binding name (for this guide, use `MY_DURABLE_OBJECT`) and the class name (`MyDurableObject`).
207199

@@ -221,7 +213,7 @@ The `[[durable_objects.bindings]]` section contains the following fields:
221213
- `class_name` - Required. The class name you wish to bind to.
222214
- `script_name` - Optional. Defaults to the current [environment's](/durable-objects/reference/environments/) Worker code.
223215

224-
## 6. Configure Durable Object class with SQLite storage backend
216+
## 5. Configure Durable Object class with SQLite storage backend
225217

226218
A migration is a mapping process from a class name to a runtime state. You perform a migration when creating a new Durable Object class, or when renaming, deleting or transferring an existing Durable Object class.
227219

@@ -243,7 +235,7 @@ new_sqlite_classes = ["MyDurableObject"] # Array of new classes
243235

244236
Refer to [Durable Objects migrations](/durable-objects/reference/durable-objects-migrations/) to learn more about the migration process.
245237

246-
## 7. Develop a Durable Object Worker locally
238+
## 6. Develop a Durable Object Worker locally
247239

248240
To test your Durable Object locally, run [`wrangler dev`](/workers/wrangler/commands/#dev):
249241

@@ -253,7 +245,7 @@ npx wrangler dev
253245

254246
In your console, you should see a`Hello world` string returned by the Durable Object.
255247

256-
## 8. Deploy your Durable Object Worker
248+
## 7. Deploy your Durable Object Worker
257249

258250
To deploy your Durable Object Worker:
259251

src/content/docs/durable-objects/get-started/tutorial.mdx

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,7 @@ If you wish to learn more about Durable Objects, refer to [What are Durable Obje
1919

2020
<Render file="prereqs" product="workers" />
2121

22-
## 1. Enable Durable Objects in the dashboard
23-
24-
To enable Durable Objects, you will need to purchase the Workers Paid plan:
25-
26-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account.
27-
2. Go to **Workers & Pages** > **Plans**.
28-
3. Select **Purchase Workers Paid** and complete the payment process to enable Durable Objects.
29-
30-
## 2. Create a Worker project
22+
## 1. Create a Worker project
3123

3224
Durable Objects are accessed from a [Worker](/workers/).
3325

@@ -59,7 +51,7 @@ Move into your new directory:
5951
cd durable-object-starter
6052
```
6153

62-
## 3. Write a Durable Object class
54+
## 2. Write a Durable Object class
6355

6456
Durable Objects are defined by a exporting a standard JavaScript class which extends from the `DurableObject` base class.
6557

@@ -126,7 +118,7 @@ export class MyDurableObject extends DurableObject {
126118

127119
</TabItem> </Tabs>
128120

129-
## 4. Invoke methods on a Durable Object class
121+
## 3. Invoke methods on a Durable Object class
130122

131123
As mentioned previously, methods on a Durable Object class are invoked by a Worker. This is done by creating an ID refering to an instance of the Durable Object class, getting a stub that refers to a particular instance of a Durable Object class, and invoking methods on that stub.
132124

@@ -174,7 +166,7 @@ export default {
174166

175167
</TabItem> </Tabs>
176168

177-
## 5. Configure Durable Object bindings
169+
## 4. Configure Durable Object bindings
178170

179171
To allow a Worker to invoke methods on a Durable Object, the Worker must have a [Durable Object binding](/workers/runtime-apis/bindings/) in the project's [Wrangler configuration file](/workers/wrangler/configuration/#durable-objects). The binding is configured to use a particular Durable Object class.
180172

@@ -197,7 +189,7 @@ The `[[durable_objects.bindings]]` section contains the following fields:
197189

198190
Refer to [Wrangler Configuration](/workers/wrangler/configuration/#durable-objects) for more detail.
199191

200-
## 6. Configure Durable Object classes with migrations
192+
## 5. Configure Durable Object classes with migrations
201193

202194
A migration is a mapping process from a class name to a runtime state. You perform a migration when creating a new Durable Object class, or when renaming, deleting or transferring an existing Durable Object class.
203195

@@ -217,7 +209,7 @@ new_classes = ["MyDurableObject"] # Array of new classes
217209

218210
</WranglerConfig>
219211

220-
### 6.a Optional: Configure new Durable Object class for SQL storage
212+
### 5.a Optional: Configure new Durable Object class for SQL storage
221213

222214
:::note[SQLite in Durable Objects Beta]
223215

@@ -243,7 +235,7 @@ new_sqlite_classes = ["MyDurableObject"] # Array of new classes
243235

244236
Refer to [Durable Objects migrations](/durable-objects/reference/durable-objects-migrations/) to learn more about the migration process.
245237

246-
## 7. Develop a Durable Object Worker locally
238+
## 6. Develop a Durable Object Worker locally
247239

248240
To test your Durable Object locally, run [`wrangler dev`](/workers/wrangler/commands/#dev):
249241

@@ -253,7 +245,7 @@ npx wrangler dev
253245

254246
In your console, you should see a`Hello world` string returned by the Durable Object.
255247

256-
## 8. Deploy your Durable Object Worker
248+
## 7. Deploy your Durable Object Worker
257249

258250
To deploy your Durable Object Worker:
259251

src/content/docs/durable-objects/platform/limits.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sidebar:
88

99
import { Render, GlossaryTooltip } from "~/components";
1010

11-
Durable Objects are only available on the [Workers Paid plan](/workers/platform/pricing/#workers). Durable Objects limits are the same as [Workers Limits](/workers/platform/limits/), as well as the following limits that are specific to Durable Objects:
11+
Durable Objects limits are the same as [Workers Limits](/workers/platform/limits/), as well as the following limits that are specific to Durable Objects:
1212

1313
| Feature | Limit for class with key-value storage backend | Limit for class with SQLite storage backend [^1] |
1414
| --------------------------------- | ---------------------------------------------------------------- | ----------------------------------------------- |

src/content/docs/workers/platform/pricing.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ Refer to [D1 Pricing](/d1/platform/pricing/) to learn more about how D1 is bille
174174

175175
## Durable Objects
176176

177+
Durable Objects are available on both the [Workers Free](#workers) and [Workers Paid](#workers) plans.
178+
177179
<Render file="durable_objects_pricing" />
178180

179181
:::note[Durable Objects billing examples]

src/content/docs/workers/tutorials/deploy-a-realtime-chat-app/index.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ In this tutorial, you will deploy a serverless, real-time chat application that
1616

1717
This chat application uses a Durable Object to control each chat room. Users connect to the Object using WebSockets. Messages from one user are broadcast to all the other users. The chat history is also stored in durable storage. Real-time messages are relayed directly from one user to others without going through the storage layer.
1818

19-
To continue with this tutorial, you must purchase the [Workers Paid plan](/workers/platform/pricing/#workers) and enable Durable Objects by logging into the [Cloudflare dashboard](https://dash.cloudflare.com) > **Workers & Pages** > select your Worker > **Durable Objects**.
20-
2119
<Render file="tutorials-before-you-start" />
2220

2321
## Clone the chat application repository

src/content/partials/durable-objects/durable-objects-pricing.mdx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,14 @@ import { Markdown } from "~/components"
77

88
## Durable Objects
99

10-
Durable Objects are only available on the [Workers Paid plan](/workers/platform/pricing/#workers).
11-
12-
10+
Durable Objects are available on both Workers Free and [Workers Paid plans](/workers/platform/pricing/#workers).
1311

1412
| | Paid plan |
1513
| -------------------- | ------------------------------------------------- |
1614
| Requests<sup>1</sup> | 1 million, + $0.15/million |
1715
| Duration<sup>2</sup> | 400,000 GB-s, + $12.50/million GB-s<sup>3,4</sup> |
1816

1917

20-
2118
<sup>1</sup> Requests include all incoming HTTP requests, WebSocket messages, and alarm invocations. There is no charge for outgoing WebSocket messages, nor for incoming [WebSocket protocol pings](https://www.rfc-editor.org/rfc/rfc6455#section-5.5.2).
2219

2320
<sup>2</sup> Application-level auto-response messages handled by [`state.setWebSocketAutoResponse()`](/durable-objects/best-practices/websockets/) will not incur additional wall-clock time, and will not be charged.

src/content/partials/workers/durable_objects_pricing.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import { Markdown, GlossaryTooltip } from "~/components";
66

7-
[Durable Objects](/durable-objects/) are only available on the [Workers Paid plan](/workers/platform/pricing/#workers), and are billed while the Durable Object is active (including the <GlossaryTooltip term="request context"> request context</GlossaryTooltip>).
7+
[Durable Objects](/durable-objects/) are available on both the Workers Free and [Workers Paid plans](/workers/platform/pricing/#workers), and are billed while the Durable Object is active (including the <GlossaryTooltip term="request context"> request context</GlossaryTooltip>).
88

99
| | Paid plan |
1010
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |

0 commit comments

Comments
 (0)