Files

Hyperdrive

Use Hyperdrive to connect Workers to an existing PostgreSQL or MySQL database with connection pooling and optional query caching. It does not replace the origin database or replicate its data. Start with how Hyperdrive works and supported databases and features to assess fit.

Retrieve current documentation

Fetch the relevant official page before implementing. Driver versions, compatibility settings, API shapes, CLI flags, cache settings, and limits belong in the docs rather than this reference. Use the Hyperdrive documentation index to discover additional pages. Retrieve a page as Markdown by sending Accept: text/markdown to its URL.

Choose the next reference

Task Reference
Create a configuration, bind it, connect privately, or develop locally configuration.md
Choose a driver, use binding credentials, or integrate an ORM api.md
Decide read freshness, connection lifetime, or query placement patterns.md
Diagnose connection, cache, latency, or capacity problems gotchas.md

Decisions to preserve

  • Choose a driver for the database engine and existing application stack; verify supported versions and Worker requirements in its guide.
  • Create database clients inside each handler invocation. Hyperdrive manages the underlying origin pool; consult connection lifecycle for cleanup behavior.
  • Choose caching by read freshness. Disabling caching still allows connection pooling; a write does not invalidate cached reads. See query caching.

See also

  • D1 for a managed SQLite alternative.
  • Workers for the runtime and bindings.