From 9e1cd8b4a8651ad565ab07597f6e4d11fec12384 Mon Sep 17 00:00:00 2001 From: Thomas Gauvin <35609369+thomasgauvin@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:27:02 +0100 Subject: [PATCH] Add D1 vs Hyperdrive --- src/content/docs/workers/platform/storage-options.mdx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/content/docs/workers/platform/storage-options.mdx b/src/content/docs/workers/platform/storage-options.mdx index b1463cbad024c37..43543be15eddd70 100644 --- a/src/content/docs/workers/platform/storage-options.mdx +++ b/src/content/docs/workers/platform/storage-options.mdx @@ -209,4 +209,15 @@ The new beta version of Durable Objects is available where each Durable Object h ::: +## D1 vs Hyperdrive + +D1 is a standalone, serverless database that provides a SQL API to store and access your relational data. + +Hyperdrive is a service that improves the performance of your existing, regional PostgreSQL databases, optimizing them for global data access from Workers. + +If you are building a new project on Workers or are considering migrating your data, use D1. + +If you are building a Workers project with an existing PostgreSQL database, use Hyperdrive. + +D1 does not need to be used with Hyperdrive because it does not have slow connection setups which would benefit from Hyperdrive's connection pooling. D1 data can also be cached within Workers using the [Cache API](/workers/runtime-apis/cache/).