diff --git a/src/content/docs/workers/platform/storage-options.mdx b/src/content/docs/workers/platform/storage-options.mdx index b1463cbad024c3..d08b1654a34b1a 100644 --- a/src/content/docs/workers/platform/storage-options.mdx +++ b/src/content/docs/workers/platform/storage-options.mdx @@ -209,4 +209,19 @@ 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, using SQLite's SQL semantics, to store and access your relational data. + +Hyperdrive is a service that lets you connect to your existing, regional PostgreSQL databases and improves database performance by optimizing them for global, scalable 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. + +:::note + +You cannot use D1 with Hyperdrive. + +However, 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/). + +::: diff --git a/src/content/partials/workers/storage-products-table.mdx b/src/content/partials/workers/storage-products-table.mdx index 2ac14eef286938..7fee3d5652b901 100644 --- a/src/content/partials/workers/storage-products-table.mdx +++ b/src/content/partials/workers/storage-products-table.mdx @@ -1,6 +1,5 @@ --- {} - --- | Use-case | Product | Ideal for | @@ -12,4 +11,4 @@ | Global co-ordination | [Durable Objects](/durable-objects/) | Building collaborative applications; global co-ordination across clients; strongly consistent, transactional storage. | | Vector search (database) | [Vectorize](/vectorize/) | Storing [embeddings](/workers-ai/models/#text-embeddings) from AI models for semantic search and classification tasks. | | Task processing & batching | [Queues](/queues/) | Background job processing (emails, notifications, APIs) and log processing/batching. | -| Connect to an existing database | [Hyperdrive](/hyperdrive/) | Connecting to an existing database in a cloud or on-prem. | +| Connect to an existing database | [Hyperdrive](/hyperdrive/) | Connecting to an existing database in a cloud or on-premise. |