|
2 | 2 | {} |
3 | 3 | --- |
4 | 4 |
|
5 | | -import { Markdown, GlossaryTooltip, Details } from "~/components"; |
| 5 | +import { Markdown, GlossaryTooltip, Details, AnchorHeading } from "~/components"; |
| 6 | + |
| 7 | +{ props.product === "durable-objects" && <><AnchorHeading title="Compute billing" depth={2}/></> } |
| 8 | +{ props.product === "workers" && <><AnchorHeading title="Compute billing" depth={3}/></> } |
6 | 9 |
|
7 | 10 | Durable Objects are billed only while the Durable Object is active (includes the <GlossaryTooltip term="request context"> request context</GlossaryTooltip>). |
8 | 11 |
|
@@ -32,4 +35,57 @@ await durableObjectStub.cat(); // billed as a request |
32 | 35 |
|
33 | 36 | <sup>5</sup> Duration billing charges for the 128 MB of memory your Durable Object is allocated, regardless of actual usage. If your account creates many instances of a single Durable Object class, Durable Objects may run in the same isolate on the same physical machine and share the 128 MB of memory. These Durable Objects are still billed as if they are allocated a full 128 MB of memory. |
34 | 37 |
|
| 38 | +</Details> |
| 39 | + |
| 40 | +{ props.product === "durable-objects" && <><AnchorHeading title="Storage billing" depth={2}/></> } |
| 41 | +{ props.product === "workers" && <><AnchorHeading title="Storage billing" depth={3}/></> } |
| 42 | + |
| 43 | +The [Durable Objects Storage API](/durable-objects/api/storage-api) is only accessible from within Durable Objects. Pricing depends on the type of storage your Durable Objects use. |
| 44 | + |
| 45 | +- **SQLite-storage backed Durable Objects (recommended)**: This is the default storage used by Durable Objects. You can use SQLite-storage backed Durable Objects without a Workers Paid plan, or unlock higher limits with a Workers paid plan. |
| 46 | +- **Key-value storage backed Durable Objects**: This is only available on the Workers Paid plan. |
| 47 | + |
| 48 | +{ props.product === "durable-objects" && <><AnchorHeading title="SQLite storage backend" depth={3}/></> } |
| 49 | +{ props.product === "workers" && <><AnchorHeading title="SQLite storage backend" depth={4}/></> } |
| 50 | + |
| 51 | +| | Workers Free plan | Workers Paid plan | |
| 52 | +| ----------------------------| ------------------------- | --------------------------------------------------------- | |
| 53 | +| Rows reads <sup>1,2</sup> | Capped at 5 million / day | First 25 billion / month included + $0.001 / million rows | |
| 54 | +| Rows written <sup>1,2</sup> | Capped at 100,000 / day | First 50 million / month included + $1.00 / million rows | |
| 55 | +| SQL Stored data | 5 GB (total) | 5 GB-month, + $0.20/ GB-month | |
| 56 | + |
| 57 | +<Details header="Footnotes" open={true}> |
| 58 | + |
| 59 | +<sup>1</sup> Rows read and rows written included limits and rates match D1, Cloudflare's serverless SQL database, [pricing](/d1/platform/pricing/). |
| 60 | + |
| 61 | +<sup>2</sup> Key-value methods like `get()`, `put()`, `delete()`, or `list()` store and query data in a hidden SQLite table and are billed as rows read and rows written. |
| 62 | + |
| 63 | +<sup>3</sup> Each `setAlarm` is billed as a single row written. |
| 64 | + |
| 65 | +</Details> |
| 66 | + |
| 67 | +{ props.product === "durable-objects" && <><AnchorHeading title="Key-value storage backend" depth={3}/></> } |
| 68 | +{ props.product === "workers" && <><AnchorHeading title="Key-value storage backend" depth={4}/></> } |
| 69 | + |
| 70 | +| | Workers Paid plan | |
| 71 | +| -------------------------------- | -------------------------- | |
| 72 | +| Read request units<sup>1,2</sup> | 1 million, + $0.20/million | |
| 73 | +| Write request units<sup>3</sup> | 1 million, + $1.00/million | |
| 74 | +| Delete requests<sup>4</sup> | 1 million, + $1.00/million | |
| 75 | +| Stored data<sup>5</sup> | 1 GB, + $0.20/ GB-month | |
| 76 | + |
| 77 | +<Details header="Footnotes" open={true}> |
| 78 | + |
| 79 | +<sup>1</sup> A request unit is defined as 4 KB of data read or written. A request that writes or reads more than 4 KB will consume multiple units, for example, a 9 KB write will consume 3 write request units. |
| 80 | + |
| 81 | +<sup>2</sup> List operations are billed by read request units, based on the amount of data examined. For example, a list request that returns a combined 80 KB of keys and values will be billed 20 read request units. A list request that does not return anything is billed for 1 read request unit. |
| 82 | + |
| 83 | +<sup>3</sup> Each `setAlarm` is billed as a single write request unit. |
| 84 | + |
| 85 | +<sup>4</sup> Delete requests are unmetered. For example, deleting a 100 KB value will be charged one delete request. |
| 86 | + |
| 87 | +<sup>5</sup> Durable Objects will be billed for stored data until the data is removed. Once the data is removed, the object will be cleaned up automatically by the system. |
| 88 | + |
| 89 | +Requests that hit the [Durable Objects in-memory cache](/durable-objects/reference/in-memory-state/) or that use the [multi-key versions of `get()`/`put()`/`delete()` methods](/durable-objects/api/storage-api/) are billed the same as if they were a normal, individual request for each key. |
| 90 | + |
35 | 91 | </Details> |
0 commit comments