PlanetScale for Postgres is now GA. Get started
Navigation

Blog|Product

Partnering with Cloudflare to bring you the fastest globally distributed applications

By Mike Coutermarsh |

We are excited to announce that we're partnering with Cloudflare to bring you the easiest way to ship full-stack applications backed by Postgres or MySQL. You can now seamlessly connect Cloudflare Workers to your PlanetScale databases using our new native integration.

PlanetScale Cloudflare connect

Cloudflare's mission is to build a better internet through improved security, better performance, democratized internet infrastructure, and improved reliability. This deeply resonates with PlanetScale's mission: bring you the fastest, most scalable, and most reliable databases without compromising on developer experience.

This partnership delivers immediate benefits for your applications:

  • Faster setup: Connect your PlanetScale database to Cloudflare Workers with Hyperdrive in just a few clicks
  • Optimized performance: Leverage Hyperdrive's connection pooling and query caching with PlanetScale's global infrastructure
  • Reduced latency: Bring your database closer to your users with intelligent edge caching
  • Better reliability: Combine PlanetScale's database reliability with Cloudflare's global network

The PlanetScale and Cloudflare stack

If you want your application to be fast, you must include the database in that equation.

Combining Cloudflare Workers, Hyperdrive, and PlanetScale relational databases allows you to build modern globally distributed applications without worrying about database connection limits or latency. Your Workers run globally at the edge, Hyperdrive provides intelligent connection pooling and caching, and PlanetScale delivers ultra fast and reliable databases for both Postgres and MySQL/Vitess.

Together, this powerful combination enables you to build data-driven applications that perform like they're running locally for users everywhere. This integration is especially helpful if you already use Cloudflare Workers to access your database, are facing connection limits and connection pooling issues for serverless applications, or want to reduce database latency for global users.

How to use it

The integration is available for both Postgres and Vitess databases. Before getting started, make sure you have a Cloudflare account with Workers enabled and a PlanetScale account.

You can get started either from the Cloudflare dashboard or the PlanetScale dashboard. To connect to your Cloudflare application from the PlanetScale dashboard:

  1. Head to the PlanetScale dashboard.
  2. Create a new database or select the database you'd like to connect to.
  3. Click "Connect".
  4. Create a new User-defined role with the necessary permissions (this will depend on how you're using Cloudflare Workers)
  5. Click "Create role".
  6. Select "Cloudflare" from the connection options below.
  7. Follow the instructions in the dashboard to finish connecting your Cloudflare account.

If you have any questions, reach out to our support team. We look forward to seeing what you build!