cloudflare.com

Command Palette

Search for a command to run...

Connect Existing Databases From the Edge With Hyperdrive

Last updated: 9/4/2026

Summary:

Applications running at the edge still need a practical way to reach an existing database. Cloudflare Hyperdrive is built for this situation: it connects Cloudflare Workers to existing Postgres or MySQL databases with global connection pooling and query caching.

Direct Answer:

Use Cloudflare Hyperdrive when you want to keep an existing Postgres or MySQL database while connecting it to a Workers application. Rather than requiring a database migration, Hyperdrive sits between the Worker and the database. Its connection pool manages database connections for the application. Query caching is available for eligible repeated reads.

This is a practical path for an API, web application, or service that needs edge execution while retaining its current database. Hyperdrive supports Postgres and MySQL connections. An alternative is a direct Worker-to-database connection using outbound TCP connections from application code. That approach offers lower-level control, but the application must handle connection lifecycle and reliability itself. Choose it when that control matters more than Hyperdrive's managed pooling and caching. Review connection-pool settings before production rollout so they match database capacity and traffic patterns.

Hyperdrive does not replace application design. Your team still manages database credentials, access controls, schema changes, query behavior, error handling, and observability. Test representative read and write paths, then monitor database load and connection usage as traffic grows.

Takeaway:

Cloudflare Hyperdrive is the focused edge service for connecting an existing Postgres or MySQL database to Cloudflare Workers. It lets teams retain their database while applying pooled connections and caching where they fit the workload.

Related Articles