---
id: "cloudflare-hyperdrive"
type: "component"
kind: "database-proxy"
provider: "cloudflare"
category: "data"
docs: "https://developers.cloudflare.com/hyperdrive/configuration/query-caching/"
url: "https://localhost:3000/catalogue/components/cloudflare-hyperdrive"
---

# Cloudflare Hyperdrive

Pooled and cached connections from Workers to an existing Postgres or MySQL database.

| | |
|---|---|
| Provider | [cloudflare](https://localhost:3000/catalogue?provider=cloudflare) |
| Kind | [Database proxy](https://localhost:3000/catalogue/kinds/database-proxy) |
| Category | Data |
| Official docs | [https://developers.cloudflare.com/hyperdrive/configuration/query-caching/](https://developers.cloudflare.com/hyperdrive/configuration/query-caching/) |

## Properties

| property | type | values | required | kind default | this component |
|---|---|---|---|---|---|
| `cacheMaxAgeSeconds` | integer | — | no | 60 | inherited |
| `engine` | enum | `postgres`, `mysql` | no | "postgres" | inherited |
| `hedging` (advanced) | boolean | — | no | false | inherited |
| `loadShedding` (advanced) | boolean | — | no | false | inherited |
| `managed` | boolean | — | no | false | **true** |
| `poolSharded` (advanced) | boolean | — | no | false | **false** |
| `pooling` | boolean | — | no | true | **true** |
| `queryCaching` | boolean | — | no | true | inherited |
| `requestCoalescing` (advanced) | boolean | — | no | false | inherited |
| `routing` | enum | `none`, `shard-key`, `lookup` | no | "none" | **"none"** |
| `scatterGather` (advanced) | boolean | — | no | false | **false** |
| `staleWhileRevalidateSeconds` | integer | — | no | 15 | inherited |

Bold values are the ones this component pins.

## Rules that apply · 0

No rule selects this kind or its category.

## Other products of the same kind · 13

- [Amazon RDS Proxy](https://localhost:3000/catalogue/components/rds-proxy.md) `rds-proxy` — aws
- [Generic database proxy](https://localhost:3000/catalogue/components/database-proxy.md) `database-proxy` — default
- [MariaDB MaxScale](https://localhost:3000/catalogue/components/maxscale.md) `maxscale` — default
- [mongos](https://localhost:3000/catalogue/components/mongos.md) `mongos` — default
- [Odyssey](https://localhost:3000/catalogue/components/odyssey.md) `odyssey` — default
- [PgBouncer](https://localhost:3000/catalogue/components/pgbouncer.md) `pgbouncer` — default
- [PgCat](https://localhost:3000/catalogue/components/pgcat.md) `pgcat` — default
- [Pgpool-II](https://localhost:3000/catalogue/components/pgpool.md) `pgpool` — default
- [ProxySQL](https://localhost:3000/catalogue/components/proxysql.md) `proxysql` — default
- [Supavisor](https://localhost:3000/catalogue/components/supavisor.md) `supavisor` — default
- [Vitess](https://localhost:3000/catalogue/components/vitess.md) `vitess` — default
- [Cloud SQL Auth Proxy](https://localhost:3000/catalogue/components/google-cloud-sql-auth-proxy.md) `google-cloud-sql-auth-proxy` — gcp
- [IBM Data Virtualization](https://localhost:3000/catalogue/components/ibm-data-virtualization.md) `ibm-data-virtualization` — ibm

## Use it in a design

```yaml
nodes:
  - { id: "cloudflare-hyperdrive", component: "cloudflare-hyperdrive" }
```

## Source (`component` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../../schema/component.schema.json
# Hyperdrive: pooled, cached connections from Workers to an existing Postgres or MySQL database.
# "How Hyperdrive works" states it manages the connection pool for you; "Query caching" states
# caching is enabled by default with max_age 60 s and stale_while_revalidate 15 s, reads only.
schemaVersion: "1"
type: "component"
id: "cloudflare-hyperdrive"
kind: "database-proxy"
provider: "cloudflare"
docs: "https://developers.cloudflare.com/hyperdrive/configuration/query-caching/"
defaults:
  managed: true
  pooling: true
  routing: "none"
  poolSharded: false
  scatterGather: false
properties:
  engine:
    type: "enum"
    values: ["postgres", "mysql"]
    default: "postgres"
  queryCaching:
    type: "boolean"
    default: true
  cacheMaxAgeSeconds:
    type: "integer"
    default: 60
  staleWhileRevalidateSeconds:
    type: "integer"
    default: 15
```

Human page: https://localhost:3000/catalogue/components/cloudflare-hyperdrive
