Deploy Postgres and MySQL databases with PlanetScale + Workers
Key Points
- Create PlanetScale databases directly from Cloudflare dashboard with unified billing
- Hyperdrive integration manages connection pooling and query caching for optimal performance
- Configure Worker placement to reduce database latency to single-digit milliseconds
Summary
Cloudflare has deepened its partnership with PlanetScale, enabling developers to create and manage Postgres and MySQL databases directly from the Cloudflare dashboard and API. Starting next month, new PlanetScale databases will be billed through your Cloudflare account, consolidating billing for self-serve and enterprise customers.
Key Points
- Direct Database Creation: Provision PlanetScale Postgres and MySQL databases from the Cloudflare dashboard with automatic Hyperdrive integration for connection pooling and query caching
- Unified Billing: New PlanetScale databases bill to your Cloudflare account; Cloudflare credits (startup programs, committed spend) apply to database costs
- Hyperdrive Integration: Built-in connectivity service manages connection pools and query caching for fast, reliable database queries from Workers
- Worker Placement: Configure Workers to execute in the same data center as your PlanetScale database to reduce latency to single-digit milliseconds
- Developer Experience: Access PlanetScale features including query insights, branching for safe deployments, and detailed usage/cost breakdowns
- Pricing: PlanetScale Postgres single node starts at $5/month with all features included
Configuration
Add a Hyperdrive binding to your wrangler.jsonc and query your database using your preferred Postgres client:
{
"hyperdrive": [{
"binding": "DATABASE",
"id": "<AUTO_CREATED_ID>"
}]
}