Skip to content

Commit f6d44d5

Browse files
authored
[D1] Duplicating changelog entries into release notes (#25265)
* [D1] Duplicating changelog entries into release notes * Removing incorrect path to image * Adding image
1 parent cc9714c commit f6d44d5

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

src/content/release-notes/d1.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@ link: "/d1/platform/release-notes/"
33
productName: D1
44
productLink: "/d1/"
55
entries:
6+
- publish_date: "2025-09-11"
7+
title: D1 automatically retries read-only queries
8+
description: |-
9+
D1 now detects read-only queries and automatically attempts up to two retries to execute those queries in the event of failures with retryable errors. You can access the number of execution attempts in the returned [response metadata](/d1/worker-api/return-object/#d1result) property `total_attempts`.
10+
11+
At the moment, only read-only queries are retried, that is, queries containing only the following SQLite keywords: `SELECT`, `EXPLAIN`, `WITH`. Queries containing any [SQLite keyword](https://sqlite.org/lang_keywords.html) that leads to database writes are not retried.
12+
13+
The retry success ratio among read-only retryable errors varies from 5% all the way up to 95%, depending on the underlying error and its duration (like network errors or other internal errors).
14+
15+
The retry success ratio among all retryable errors is lower, indicating that there are write-queries that could be retried. Therefore, we recommend D1 users to continue applying [retries in their own code](/d1/best-practices/retry-queries/) for queries that are not read-only but are idempotent according to the business logic of the application.
16+
17+
![D1 automatically query retries success ratio](/_astro/faster-d1-worker-api.4S7VSUdP_o2jsC.webp)
18+
19+
D1 ensures that any retry attempt does not cause database writes, making the automatic retries safe from side-effects, even if a query causing changes slips through the read-only detection. D1 achieves this by checking for modifications after every query execution, and if any write occurred due to a retry attempt, the query is rolled back.
20+
21+
The read-only query detection heuristics are simple for now, and there is room for improvement to capture more cases of queries that can be retried, so this is just the beginning.
22+
623
- publish_date: "2025-07-01"
724
title: Maximum D1 storage per account for the Workers paid plan is now 1 TB
825
description: |-
@@ -15,13 +32,50 @@ entries:
1532
1633
If you want to retain a backup of your D1 alpha database, please use `wrangler d1 backup` before 2025-07-01. A D1 alpha backup can be used to [migrate](/d1/platform/alpha-migration/#5-create-a-new-d1-database) to a newly created D1 database in its generally available state.
1734
35+
- publish_date: "2025-05-30"
36+
title: 50-500ms Faster D1 REST API Requests
37+
description: |-
38+
39+
Users using Cloudflare's [REST API](/api/resources/d1/) to query their D1 database can see lower end-to-end request latency now that D1 authentication is performed at the closest Cloudflare network data center that received the request. Previously, authentication required D1 REST API requests to proxy to Cloudflare's core, centralized data centers, which added network round trips and latency.
40+
41+
Latency improvements range from 50-500 ms depending on request location and [database location](/d1/configuration/data-location/) and only apply to the REST API. REST API requests and databases outside the United States see a bigger benefit since Cloudflare's primary core data centers reside in the United States.
42+
43+
D1 query endpoints like `/query` and `/raw` have the most noticeable improvements since they no longer access Cloudflare's core data centers. D1 control plane endpoints such as those to create and delete databases see smaller improvements, since they still require access to Cloudflare's core data centers for other control plane metadata.
44+
1845
- publish_date: "2025-05-02"
1946
title: D1 HTTP API permissions bug fix
2047
description: |-
2148
A permissions bug that allowed Cloudflare account and user [API tokens](/fundamentals/api/get-started/account-owned-tokens/) with `D1:Read` permission and `Edit` permission on another Cloudflare product to perform D1 database writes is fixed. `D1:Edit` permission is required for any database writes via HTTP API.
2249
2350
If you were using an existing API token without `D1:Edit` permission to make edits to a D1 database via the HTTP API, then you will need to [create or edit API tokens](/fundamentals/api/get-started/create-token/) to explicitly include `D1:Edit` permission.
2451
52+
- publish_date: "2025-04-10"
53+
title: D1 Read Replication Public Beta
54+
description: |-
55+
D1 read replication is available in public beta to help lower average latency and increase overall throughput for read-heavy applications like e-commerce websites or content management tools.
56+
57+
Workers can leverage read-only database copies, called read replicas, by using D1 [Sessions API](/d1/best-practices/read-replication). A session encapsulates all the queries from one logical session for your application. For example, a session may correspond to all queries coming from a particular web browser session. With Sessions API, D1 queries in a session are guaranteed to be [sequentially consistent](/d1/best-practices/read-replication/#replica-lag-and-consistency-model) to avoid data consistency pitfalls. D1 [bookmarks](/d1/reference/time-travel/#bookmarks) can be used from a previous session to ensure logical consistency between sessions.
58+
59+
```ts
60+
// retrieve bookmark from previous session stored in HTTP header
61+
const bookmark = request.headers.get("x-d1-bookmark") ?? "first-unconstrained";
62+
63+
const session = env.DB.withSession(bookmark);
64+
const result = await session
65+
.prepare(`SELECT * FROM Customers WHERE CompanyName = 'Bs Beverages'`)
66+
.run();
67+
// store bookmark for a future session
68+
response.headers.set("x-d1-bookmark", session.getBookmark() ?? "");
69+
```
70+
71+
Read replicas are automatically created by Cloudflare (currently one in each supported [D1 region](/d1/best-practices/read-replication/#read-replica-locations)), are active/inactive based on query traffic, and are transparently routed to by Cloudflare at no additional cost.
72+
73+
To checkout D1 read replication, deploy the following Worker code using Sessions API, which will prompt you to create a D1 database and enable read replication on said database.
74+
75+
[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/templates/tree/main/d1-starter-sessions-api)
76+
77+
To learn more about how read replication was implemented, go to our [blog post](https://blog.cloudflare.com/d1-read-replication-beta).
78+
2579
- publish_date: "2025-02-19"
2680
title: D1 supports `PRAGMA optimize`
2781
description: |-

0 commit comments

Comments
 (0)