Skip to content

Commit 0e0714b

Browse files
authored
Merge branch 'production' into max/zt/combine-on-ramps
2 parents 72afa40 + c96ef9c commit 0e0714b

File tree

4 files changed

+70
-28
lines changed

4 files changed

+70
-28
lines changed

src/content/docs/durable-objects/api/storage-api.mdx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,21 @@ The `put()` method returns a `Promise`, but most applications can discard this p
191191

192192
* `txn`
193193

194-
* Provides access to the `put()`, `get()`, `delete()` and `list()` methods documented above to run in the current transaction context. In order to get transactional behavior within a transaction closure, you must call the methods on the `txn` Object instead of on the top-level `state.storage` Object.<br/><br/>Also supports a `rollback()` function that ensures any changes made during the transaction will be rolled back rather than committed. After `rollback()` is called, any subsequent operations on the `txn` Object will fail with an exception. `rollback()` takes no parameters and returns nothing to the caller.
194+
* Provides access to the `put()`, `get()`, `delete()` and `list()` methods documented above to run in the current transaction context. In order to get transactional behavior within a transaction closure, you must call the methods on the `txn` Object instead of on the top-level `ctx.storage` Object.<br/><br/>Also supports a `rollback()` function that ensures any changes made during the transaction will be rolled back rather than committed. After `rollback()` is called, any subsequent operations on the `txn` Object will fail with an exception. `rollback()` takes no parameters and returns nothing to the caller.
195+
196+
* When using [the SQLite-backed storage engine](/durable-objects/best-practices/access-durable-objects-storage/#sqlite-storage-backend), the `txn` object is obsolete. Any storage operations performed directly on the `ctx.storage` object, including SQL queries using [`ctx.storage.sql.exec()`](#sqlexec), will be considered part of the transaction.
197+
198+
### transactionSync
199+
200+
* `transactionSync(callback)`: <Type text='any' />
201+
202+
* Only available when using [the SQLite-backed storage engine](/durable-objects/best-practices/access-durable-objects-storage/#sqlite-storage-backend).
203+
204+
* Invokes `callback()` wrapped in a transaction, and returns its result.
205+
206+
* If `callback()` throws an exception, the transaction will be rolled back.
207+
208+
* The callback must complete synchronously, that is, it should not be declared `async` nor otherwise return a Promise. Only synchronous storage operations can be part of the transaction. This is intended for use with SQL queries using [`ctx.storage.sql.exec()`](#sqlexec), which complete sychronously.
195209

196210
### sync
197211

@@ -233,7 +247,7 @@ The `put()` method returns a `Promise`, but most applications can discard this p
233247

234248
:::note[SQLite in Durable Objects Beta]
235249

236-
SQL API methods accessed with `ctx.storage.sql` are only allowed on [Durable Object classes with SQLite storage backend](/durable-objects/reference/durable-objects-migrations/#enable-sqlite-storage-backend-on-create-durable-object-class-migration) and will return an error if called on Durable Object classes with a key-value storage backend.
250+
SQL API methods accessed with `ctx.storage.sql` are only allowed on [Durable Object classes with SQLite storage backend](/durable-objects/reference/durable-objects-migrations/#enable-sqlite-storage-backend-on-new-durable-object-class-migration) and will return an error if called on Durable Object classes with a key-value storage backend.
237251

238252
:::
239253

@@ -282,6 +296,8 @@ A cursor (`SqlStorageCursor`) to iterate over query row results as objects. `Sql
282296
* `rowsWritten`: <Type text='number' />
283297
* The number of rows written so far as part of this SQL `query`. This may increase as you iterate the cursor. The final value is used for [SQL billing](/durable-objects/platform/pricing/#sqlite-storage-backend).
284298

299+
Note that `sql.exec()` cannot execute transaction-related statements like `BEGIN TRANSACTION` or `SAVEPOINT`. Instead, use the [`ctx.storage.transaction()`](#transaction) or [`ctx.storage.transactionSync()`](#transactionsync) APIs to start a transaction, and then execute SQL queries in your callback.
300+
285301
#### Examples
286302

287303
<Render file="durable-objects-sql" />

src/content/docs/reference-architecture/by-solution.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,27 @@ Architecture documentation related to using Cloudflare for Zero Trust, SSE and S
4343
- [Securing data at rest](/reference-architecture/diagrams/security/securing-data-at-rest/)
4444
- [Securing data in transit](/reference-architecture/diagrams/security/securing-data-in-transit/)
4545
- [Securing data in use](/reference-architecture/diagrams/security/securing-data-in-use/)
46+
- [Extend ZTNA with external authorization and serverless computing](/reference-architecture/diagrams/sase/augment-access-with-serverless/)
4647

4748
#### Design guides
4849

4950
- [Building zero trust architecture into your startup](/reference-architecture/design-guides/zero-trust-for-startups/)
5051
- [Network-focused migration from VPN concentrators to Zero Trust Network Access](/reference-architecture/design-guides/network-vpn-migration/)
52+
- [Using a zero trust framework to secure SaaS applications](/reference-architecture/design-guides/zero-trust-for-saas/)
5153

5254
#### Implementation guides
5355

5456
- [Secure your Internet traffic and SaaS apps](/learning-paths/secure-internet-traffic/)
5557
- [Replace your VPN](/learning-paths/replace-vpn/)
5658
- [Deploy Zero Trust Web Access](/learning-paths/zero-trust-web-access/)
5759

60+
### Networking
61+
62+
#### Reference architecture diagrams
63+
64+
- [Protect public networks with Cloudflare](/reference-architecture/diagrams/network/protect-public-networks-with-cloudflare/)
65+
- [Bring your own IP space to Cloudflare](/reference-architecture/diagrams/network/bring-your-own-ip-space-to-cloudflare/)
66+
5867
### Application Performance
5968

6069
Content related to DNS, caching, load balancing and other Cloudflare services designed to improve application reliability and performance.
@@ -68,6 +77,11 @@ Content related to DNS, caching, load balancing and other Cloudflare services de
6877

6978
Content related to protecting your applications from threats such as DDoS attack, SQL injection, exploiting application vulnerabilities, scraping API data and more.
7079

80+
#### Reference architecture diagrams
81+
82+
- [Bot management](/reference-architecture/diagrams/bots/bot-management/)
83+
84+
7185
#### Design guides
7286

7387
- [Secure application delivery](/reference-architecture/design-guides/secure-application-delivery/)
@@ -78,16 +92,26 @@ Architecture content for our developer platform.
7892

7993
#### Reference architecture diagrams
8094

95+
##### AI
96+
8197
- [Automatic captioning for video uploads](/reference-architecture/diagrams/ai/ai-video-caption/)
8298
- [Composable AI architecture](/reference-architecture/diagrams/ai/ai-composable/)
8399
- [Content-based asset creation](/reference-architecture/diagrams/ai/ai-asset-creation/)
84100
- [Multi-vendor AI observability and control](/reference-architecture/diagrams/ai/ai-multivendor-observability-control/)
85101
- [Retrieval Augmented Generation (RAG)](/reference-architecture/diagrams/ai/ai-rag/)
102+
- [Ingesting BigQuery Data into Workers AI](/reference-architecture/diagrams/ai/bigquery-workers-ai/)
103+
104+
##### Serverless
105+
86106
- [Optimizing Image Delivery with Cloudflare Image Resizing and R2](/reference-architecture/diagrams/content-delivery/optimizing-image-delivery-with-cloudflare-image-resizing-and-r2/)
87107
- [A/B-testing using Workers](/reference-architecture/diagrams/serverless/a-b-testing-using-workers/)
88108
- [Fullstack Applications](/reference-architecture/diagrams/serverless/fullstack-application/)
89109
- [Serverless ETL pipelines](/reference-architecture/diagrams/serverless/serverless-etl/)
90110
- [Serverless global APIs](/reference-architecture/diagrams/serverless/serverless-global-apis/)
91111
- [Serverless image content management](/reference-architecture/diagrams/serverless/serverless-image-content-management/)
112+
113+
##### Storage
114+
92115
- [Egress-free object storage in multi-cloud setups](/reference-architecture/diagrams/storage/egress-free-storage-multi-cloud/)
93116
- [On-demand Object Storage Data Migration](/reference-architecture/diagrams/storage/on-demand-object-storage-migration/)
117+
- [Event notifications for storage](/reference-architecture/diagrams/storage/event-notifications-for-storage/)

src/content/docs/workers/wrangler/configuration.mdx

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ Top-level keys apply to the Worker as a whole (and therefore all environments).
6363

6464
- Whether Wrangler should keep variables configured in the dashboard on deploy. Refer to [source of truth](#source-of-truth).
6565

66+
- `migrations` <Type text="object[]" /> <MetaInfo text="optional" />
67+
68+
- When making changes to your Durable Object classes, you must perform a migration. Refer to [Durable Object migrations](/durable-objects/reference/durable-objects-migrations/).
69+
6670
- `send_metrics` <Type text="boolean" /> <MetaInfo text="optional" />
6771

6872
- Whether Wrangler should send usage metrics to Cloudflare for this project.
@@ -161,13 +165,13 @@ At a minimum, the `name`, `main` and `compatibility_date` keys are required to d
161165

162166
- `logpush` <Type text="boolean" /> <MetaInfo text="optional" />
163167

164-
- Enables Workers Trace Events Logpush for a Worker. Any scripts with this property will automatically get picked up by the Workers Logpush job configured for your account. Defaults to `false`.
168+
- Enables Workers Trace Events Logpush for a Worker. Any scripts with this property will automatically get picked up by the Workers Logpush job configured for your account. Defaults to `false`. Refer to [Workers Logpush](/workers/observability/logs/logpush/).
165169

166170
- `limits` <Type text="Limits" /> <MetaInfo text="optional" />
167171

168172
- Configures limits to be imposed on execution at runtime. Refer to [Limits](#limits).
169173

170-
* `observability` object optional
174+
* `observability` <Type text="object" /> <MetaInfo text="optional" />
171175

172176
- Configures automatic observability settings for telemetry data emitted from your Worker. Refer to [Observability](#observability).
173177

@@ -322,6 +326,26 @@ Example:
322326
crons = ["* * * * *"]
323327
```
324328

329+
## Observability
330+
331+
The [Observability](/workers/observability/logs/workers-logs) setting allows you to automatically ingest, store, filter, and analyze logging data emitted from Cloudflare Workers directly from your Cloudflare Worker's dashboard.
332+
333+
- `enabled` <Type text="boolean" /> <MetaInfo text="required" />
334+
335+
- When set to `true` on a Worker, logs for the Worker are persisted. Defaults to `true` for all new Workers.
336+
337+
- `head_sampling_rate` <Type text="number" /> <MetaInfo text="optional" />
338+
- A number between 0 and 1, where 0 indicates zero out of one hundred requests are logged, and 1 indicates every request is logged. If `head_sampling_rate` is unspecified, it is configured to a default value of 1 (100%). Read more about [head-based sampling](/workers/observability/logs/workers-logs/#head-based-sampling).
339+
340+
Example:
341+
342+
```toml title="wrangler.toml"
343+
[observability]
344+
enabled = true
345+
head_sampling_rate = 0.1 # 10% of requests are logged
346+
```
347+
348+
325349
## Custom builds
326350

327351
You can configure a custom build step that will be run before your Worker is deployed. Refer to [Custom builds](/workers/wrangler/custom-builds/).
@@ -510,7 +534,7 @@ When making changes to your Durable Object classes, you must perform a migration
510534

511535
- The new Durable Objects being defined.
512536

513-
- `renamed_classes` <Type text="from: string, to: string}[]" /> <MetaInfo text="optional" />
537+
- `renamed_classes` <Type text="{from: string, to: string}[]" /> <MetaInfo text="optional" />
514538

515539
- The Durable Objects being renamed.
516540

@@ -629,28 +653,6 @@ binding = "<BINDING_NAME2>"
629653
id = "<NAMESPACE_ID2>"
630654
```
631655

632-
### Observability
633-
634-
The [Observability](/workers/observability/logs/workers-logs) setting allows you to automatically ingest, store, filter, and analyze logging data emitted from Cloudflare Workers directly from your Cloudflare Worker's dashboard.
635-
636-
- `enabled` boolean required
637-
638-
- When set to `true` on a Worker, logs for the Worker are persisted. Defaults to `true` for all new Workers.
639-
640-
- `head_sampling_rate` number optional
641-
- A number between 0 and 1, where 0 indicates zero out of one hundred requests are logged, and 1 indicates every request is logged. If `head_sampling_rate` is unspecified, it is configured to a default value of 1 (100%). Read more about [head-based sampling](/workers/observability/logs/workers-logs/#head-based-sampling).
642-
643-
Example:
644-
645-
```toml title="wrangler.toml"
646-
[observability]
647-
enabled = true
648-
649-
[observability]
650-
enabled = true
651-
head_sampling_rate = 0.1 # 10% of requests are logged
652-
```
653-
654656
### Queues
655657

656658
[Queues](/queues/) is Cloudflare's global message queueing service, providing [guaranteed delivery](/queues/reference/delivery-guarantees/) and [message batching](/queues/configuration/batching-retries/). To interact with a queue with Workers, you need a producer Worker to send messages to the queue and a consumer Worker to pull batches of messages out of the Queue. A single Worker can produce to and consume from multiple Queues.

src/content/partials/workers/storage_api_pricing.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ You can introspect rows read and rows written using `cursor.rowsRead` and `curso
4242

4343
:::
4444

45-
For [Durable Objects classes with SQLite storage backend](/durable-objects/reference/durable-objects-migrations/#enable-sqlite-storage-backend-on-create-durable-object-class-migration) via `ctx.storage.sql` the following pricing is used instead:
45+
For [Durable Objects classes with SQLite storage backend](/durable-objects/reference/durable-objects-migrations/#enable-sqlite-storage-backend-on-new-durable-object-class-migration) via `ctx.storage.sql` the following pricing is used instead:
4646

4747
| | Workers Paid plan |
4848
| ----------------------------| -------------------------- |

0 commit comments

Comments
 (0)