Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 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
3 changes: 2 additions & 1 deletion public/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -1679,7 +1679,8 @@

# hyperdrive

/hyperdrive/learning/how-hyperdrive-works/ /hyperdrive/configuration/how-hyperdrive-works/ 301
/hyperdrive/key-concepts/how-hyperdrive-works/ /hyperdrive/key-concepts/how-hyperdrive-works/ 301
/hyperdrive/learning/how-hyperdrive-works/ /hyperdrive/key-concepts/how-hyperdrive-works/ 301
/hyperdrive/learning/connect-to-postgres/ /hyperdrive/configuration/connect-to-postgres/ 301
/hyperdrive/learning/query-caching/ /hyperdrive/configuration/query-caching/ 301
/hyperdrive/learning/troubleshooting/ /hyperdrive/reference/troubleshooting/ 301
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ _P50, P75, and P90 Hyperdrive session latency for all client connection sessions

This performance improvement is applied to all new and existing Hyperdrive configurations that have caching enabled.

For more details on how Hyperdrive performs query caching, refer to the [Hyperdrive documentation](/hyperdrive/configuration/how-hyperdrive-works/#query-caching).
For more details on how Hyperdrive performs query caching, refer to the [Hyperdrive documentation](/hyperdrive/key-concepts/how-hyperdrive-works/#query-caching).
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ By improving placement of Hyperdrive database connection pools, Workers' Smart P

With this update, Hyperdrive also uses [Cloudflare's standard IP address ranges](https://www.cloudflare.com/ips/) to connect to your database. This enables you to configure the firewall policies (IP access control lists) of your database to only allow access from Cloudflare and Hyperdrive.

Refer to [documentation on how Hyperdrive makes connecting to regional databases from Cloudflare Workers fast](/hyperdrive/configuration/how-hyperdrive-works/).
Refer to [documentation on how Hyperdrive makes connecting to regional databases from Cloudflare Workers fast](/hyperdrive/key-concepts/how-hyperdrive-works/).

This improvement is enabled on all Hyperdrive configurations.
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,5 @@ Refer to the [`wrangler dev` documentation](/workers/wrangler/commands/#dev) to
## Related resources

- Use [`wrangler dev`](/workers/wrangler/commands/#dev) to run your Worker and Hyperdrive locally and debug issues before deploying.
- Learn [how Hyperdrive works](/hyperdrive/configuration/how-hyperdrive-works/).
- Learn [how Hyperdrive works](/hyperdrive/key-concepts/how-hyperdrive-works/).
- Understand how to [configure query caching in Hyperdrive](/hyperdrive/configuration/query-caching/).
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ const noCachingClient = new Client({

## Next steps

- Learn more about [How Hyperdrive works](/hyperdrive/configuration/how-hyperdrive-works/).
- Learn more about [How Hyperdrive works](/hyperdrive/key-concepts/how-hyperdrive-works/).
- Learn how to [Connect to PostgreSQL](/hyperdrive/configuration/connect-to-postgres/) from Hyperdrive.
- Review [Troubleshooting common issues](/hyperdrive/observability/troubleshooting/) when connecting a database to Hyperdrive.
2 changes: 1 addition & 1 deletion src/content/docs/hyperdrive/get-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ By finishing this tutorial, you have created a Hyperdrive configuration, a Worke

## Next steps

- Learn more about [how Hyperdrive works](/hyperdrive/configuration/how-hyperdrive-works/).
- Learn more about [how Hyperdrive works](/hyperdrive/key-concepts/how-hyperdrive-works/).
- How to [configure query caching](/hyperdrive/configuration/query-caching/).
- [Troubleshooting common issues](/hyperdrive/observability/troubleshooting/) when connecting a database to Hyperdrive.

Expand Down
30 changes: 16 additions & 14 deletions src/content/docs/hyperdrive/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Overview
title: Cloudflare Hyperdrive
order: 0
type: overview
pcx_content_type: overview
Expand All @@ -19,7 +19,7 @@ import {
RelatedProduct,
Tabs,
TabItem,
LinkButton
LinkButton,
} from "~/components";

<Description>
Expand Down Expand Up @@ -49,20 +49,22 @@ export default {
// your database via Hyperdrive that can be used with your existing tools
const sql = postgres(env.HYPERDRIVE.connectionString);

try {
// Sample SQL query
const results = await sql`SELECT * FROM pg_tables`;
try {
// Sample SQL query
const results = await sql`SELECT * FROM pg_tables`;

// Close the client after the response is returned
ctx.waitUntil(sql.end());
// Close the client after the response is returned
ctx.waitUntil(sql.end());

return Response.json(results);
} catch (e) {
return Response.json({ error: e instanceof Error ? e.message : e }, { status: 500 });
}
},

return Response.json(results);
} catch (e) {
return Response.json({ error: e instanceof Error ? e.message : e }, { status: 500 });
}
},
} satisfies ExportedHandler<{ HYPERDRIVE: Hyperdrive }>;
```

````

</TabItem>
<TabItem label="wrangler.jsonc">
Expand All @@ -86,7 +88,7 @@ export default {
}
]
}
```
````

</TabItem>
</Tabs>
Expand Down
12 changes: 12 additions & 0 deletions src/content/docs/hyperdrive/key-concepts/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
pcx_content_type: navigation
title: Key concepts
sidebar:
order: 2
group:
hideIndex: true
---

import { DirectoryListing } from "~/components";

<DirectoryListing />
2 changes: 1 addition & 1 deletion src/content/docs/hyperdrive/observability/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pcx_content_type: navigation
title: Observability
sidebar:
order: 4
order: 7
group:
hideIndex: true
---
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/hyperdrive/platform/pricing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar:

**Hyperdrive is free and included in every [Workers Paid](/workers/platform/pricing/#workers) plan**.

Hyperdrive is automatically enabled when subscribed to a Workers Paid plan, and does not require you to pay any additional fees to use. Hyperdrive's [connection pooling and query caching](/hyperdrive/configuration/how-hyperdrive-works/) do not incur any additional charges, and there are no hidden limits other than those [published](/hyperdrive/platform/limits/).
Hyperdrive is automatically enabled when subscribed to a Workers Paid plan, and does not require you to pay any additional fees to use. Hyperdrive's [connection pooling and query caching](/hyperdrive/key-concepts/how-hyperdrive-works/) do not incur any additional charges, and there are no hidden limits other than those [published](/hyperdrive/platform/limits/).

:::note

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,6 @@ In this tutorial, you have learned how to create a working example to ingest and

## Next steps

- Learn more about [How Hyperdrive Works](/hyperdrive/configuration/how-hyperdrive-works/).
- Learn more about [How Hyperdrive Works](/hyperdrive/key-concepts/how-hyperdrive-works/).
- Learn more about [Timescale](https://timescale.com).
- Refer to the [troubleshooting guide](/hyperdrive/observability/troubleshooting/) to debug common issues.
39 changes: 19 additions & 20 deletions src/content/docs/kv/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,28 @@ export default {
// write a key-value pair
await env.KV_BINDING.put('KEY', 'VALUE');

// read a key-value pair
const value = await env.KV_BINDING.get('KEY');

// list all key-value pairs
const allKeys = await env.KV_BINDING.list();

// delete a key-value pair
await env.KV_BINDING.delete('KEY');

// return a Workers response
return new Response(
JSON.stringify({
value: value,
allKeys: allKeys,
}),
);
},

// read a key-value pair
const value = await env.KV_BINDING.get('KEY');

// list all key-value pairs
const allKeys = await env.KV_BINDING.list();

// delete a key-value pair
await env.KV_BINDING.delete('KEY');

// return a Workers response
return new Response(
JSON.stringify({
value: value,
allKeys: allKeys,
}),
);
},
} satisfies ExportedHandler<{ KV_BINDING: KVNamespace }>;

```
</TabItem>
<TabItem label="wrangler.jsonc">
<TabItem label="wrangler.jsonc">

```json
{
Expand Down Expand Up @@ -193,7 +192,7 @@ Built on SQLite, D1 is Cloudflare’s first queryable relational database. Creat

---

### More resources
## More resources

<CardGrid>

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/workers/platform/storage-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Hyperdrive allows you to:
To get started with Hyperdrive:

- [Connect Hyperdrive](/hyperdrive/get-started/) to your existing database.
- Learn more [about how Hyperdrive speeds up your database queries](/hyperdrive/configuration/how-hyperdrive-works/).
- Learn more [about how Hyperdrive speeds up your database queries](/hyperdrive/key-concepts/how-hyperdrive-works/).

## Analytics Engine

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ export default {

## Next steps

- Learn more about [How Hyperdrive Works](/hyperdrive/configuration/how-hyperdrive-works/).
- Learn more about [How Hyperdrive Works](/hyperdrive/key-concepts/how-hyperdrive-works/).
- Refer to the [troubleshooting guide](/hyperdrive/observability/troubleshooting/) to debug common issues.
- Understand more about other [storage options](/workers/platform/storage-options/) available to Cloudflare Workers.
10 changes: 5 additions & 5 deletions src/content/release-notes/hyperdrive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ entries:
- publish_date: "2025-03-07"
title: Hyperdrive connects to your database using Cloudflare's IP address ranges
description: |-
Hyperdrive now uses [Cloudflare's IP address ranges](https://www.cloudflare.com/ips/) for egress.
Hyperdrive now uses [Cloudflare's IP address ranges](https://www.cloudflare.com/ips/) for egress.

This enables you to configure the firewall policies on your database to allow access to this limited IP address range.
This enables you to configure the firewall policies on your database to allow access to this limited IP address range.

Learn more about [configuring your database networking for Hyperdrive](/hyperdrive/configuration/firewall-and-networking-configuration/).
- publish_date: "2025-03-07"
Expand All @@ -34,7 +34,7 @@ entries:
description: |-
Hyperdrive query caching now happens in all locations where Hyperdrive can be accessed. When making a query in a location that has cached the query result, your latency may be decreased by up to 90%.

Refer to [documentation on how Hyperdrive caches query results](/hyperdrive/configuration/how-hyperdrive-works/#query-caching).
Refer to [documentation on how Hyperdrive caches query results](/hyperdrive/key-concepts/how-hyperdrive-works/#query-caching).
- publish_date: "2024-11-19"
title: Hyperdrive now supports clear-text password authentication
description: |-
Expand All @@ -44,13 +44,13 @@ entries:
- publish_date: "2024-10-30"
title: New Hyperdrive configurations to private databases using Tunnels are validated before creation
description: |-
When creating a new Hyperdrive configuration to a private database using Tunnels, Hyperdrive will verify that it can connect to the database to ensure that your Tunnel and Access application have been properly configured. This makes it easier to debug connectivity issues.
When creating a new Hyperdrive configuration to a private database using Tunnels, Hyperdrive will verify that it can connect to the database to ensure that your Tunnel and Access application have been properly configured. This makes it easier to debug connectivity issues.

Refer to [documentation on connecting to private databases](/hyperdrive/configuration/connect-to-private-database/) for more information.
- publish_date: "2024-09-20"
title: The `node-postgres` (pg) driver is now supported for Pages applications using Hyperdrive.
description: |-
The popular `pg` ([node-postgres](https://github.com/brianc/node-postgres) driver no longer requires the legacy `node_compat` mode, and can now be used in both Workers and Pages for connecting to Hyperdrive. This uses the new (improved) Node.js compatibility in Workers and Pages.
The popular `pg` ([node-postgres](https://github.com/brianc/node-postgres) driver no longer requires the legacy `node_compat` mode, and can now be used in both Workers and Pages for connecting to Hyperdrive. This uses the new (improved) Node.js compatibility in Workers and Pages.

You can set [`compatibility_flags = ["nodejs_compat_v2"]`](/workers/runtime-apis/nodejs/) in your `wrangler.toml` or via the Pages dashboard to benefit from this change. Visit the [Hyperdrive documentation on supported drivers](/hyperdrive/configuration/connect-to-postgres/#supported-drivers) to learn more about the driver versions supported by Hyperdrive.
- publish_date: "2024-08-19"
Expand Down
Loading