Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added src/assets/images/d1/faster-d1-worker-api.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions src/content/changelogs-next/2025-01-07-d1-faster-query.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: 40-60% Faster D1 Worker API Requests
description: D1's Worker API request latency decreases by 40-60%.
products:
- d1
date: 2025-01-07T18:00:00Z
---

[D1](/d1/) lowered end-to-end request latency via the [Workers API](/d1/worker-api/) by up to 60% through eliminating redundant network round trips for each request.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is framed in terms of what we did

Vs

What does it now mean for you

Ex

When you query D1 from Workers, the round trip time is n% lower etc


![D1 Worker API latency](../../assets/images/d1/faster-d1-worker-api.png)

*p50, p90, and p95 latency aggregated across entire D1 service. These latencies are a reference point and should not be viewed as your exact workload improvement.*

This performance improvement benefits all D1 Worker API traffic, especially cross-region requests where network latency is an outsized latency factor. For example, a user in Europe talking to a database in North America. D1 [location hints](/d1/configuration/data-location/#provide-a-location-hint) can be used to influence the geographic location of a database.

For more details on how D1 removed redundnat round trips, see the D1 specific changelog [entry](/d1/platform/changelog/#2025-01-07).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird that I have to go somewhere else?

Copy link
Contributor Author

@vy-ton vy-ton Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@irvinebroque I disagree. I want discoverability and navigation between changelog-next (product updates) and D1 changelog (release notes). A user skimming changelog-next entries should take away what changed and why does it affect me, without necessarily caring about the how.

In an ideal future:

  • product changelog would be generated release notes from code rollouts with more technical, implementation description
  • changelog-next would be product updates from code rollouts/shipped features that are worth calling out

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your call! just saying that i initially interpreted the changelog post as, "whoa the query times are slow!" and then only after understanding "we got rid of network roundtrips" did it click that — "ohhh the total time it takes to get data back from D1 over the network is what is getting faster, we're not talking about timing of D1 queries themselves"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good feedback, let me try to clarify/make the improvement more clear without full details

9 changes: 9 additions & 0 deletions src/content/changelogs/d1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ entries:

For better insight into your current usage, refer to your [billing metrics](/d1/observability/billing/) for rows read and rows written, which can be found on the [D1 dashboard](https://dash.cloudflare.com/?account=/workers/d1) or GraphQL API.

- publish_date: "2025-01-07"
title: D1 Worker API request latency decreases by 40-60%.
description: |-
D1 lowered end-to-end Worker API request latency by 40-60% by eliminating redundant network round trips for each request.

For each request to a D1 database, at least two network round trips were eliminated. One round trip was due to a bug that is now fixed. The remaining removed round trips are due to avoiding creating a new TCP connection for each request when reaching out to the datacenter hosting the database.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bringing this up into post helps me as reader understand

Ohhhh the metrics you're sharing are not query latency, they are total network time

Quick diagram may go long way

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also put the image in both sections.


The removal of redundant network round trips also applies to D1\'s [REST API](/api/resources/d1/subresources/database/methods/query/). However, the REST API still depends on Cloudflare's centralized datacenters for authentication, which reduces the relative performance improvement.

- publish_date: "2024-08-23"
title: D1 alpha databases have stopped accepting SQL queries
description: |-
Expand Down
Loading