InfoQ Homepage News Cloudflare Hyperdrive: Access PostgreSQL Databases Globally
Cloudflare Hyperdrive: Access PostgreSQL Databases Globally
This item in japanese
Oct 07, 2023 2 min read
by
Write for InfoQ
Feed your curiosity. Help 550k+ globalsenior developers
each month stay ahead.Get in touch
During the recent "Birthday Week 2023", Cloudflare announced the open beta of Hyperdrive, a new service that uses Cloudflare global network to speed up queries to existing databases. The service currently supports PostgreSQL-compatible databases, with support for MySQL expected soon.
To make data access faster from anywhere in the world, regardless of end-users locations, Hyperdrive caches the most popular database queries. This can enhance full-stack application performance and reduce the load and cost on the database. Furthermore, Hyperdrive enables database connection pooling for Workers, reducing latency caused by repeatedly establishing new database connections.
Matt Silverlock, director of product at Cloudflare, and Alex Robinson, principal engineer at Cloudflare, write:
In a modern distributed cloud environment like Workers, where compute is globally distributed (so it’s close to users) and functions are short-lived (so you’re billed no more than is needed), connecting to traditional databases has been both slow and unscalable. Slow because it takes upwards of seven round-trips (TCP handshake; TLS negotiation; then auth) to establish the connection, and unscalable because databases like PostgreSQL have a high resource cost per connection.
The new service supports a wide range of the most popular database providers, including those hosted on AWS, Google Cloud, Neon, and Timescale, as well as Postgres-compatible databases like CockroachDB. Support for MySQL is expected by the end of the year, both for the community edition and providers like PlanetScale.
With Hyperdrive, developers keep using their existing drivers, query builder, and ORM (Object-Relational Mapper) libraries. Silverlock and Robinson explain:
To achieve this, we worked with the maintainers of popular open-source drivers — including node-postgres and Postgres.js — to help their libraries support Worker’s new TCP socket API, which is going through the standardization process, and we expect to see land in Node.js, Deno and Bun as well.
To demonstrate Hyperdrive’s performance and functionalities, Cloudflare provides a demo application that queries against the same database both directly and with Hyperdrive.
According to Cloudflare, Hyperdrive’s connection pooling will always be free for both database protocols supported today and new database protocols. During the open beta, query caching and analytics are free and pricing details will be announced closer to general availability, expected early in 2024.
User NetworkIsSpreading on Reddit comments:
I'll still use D1 because SQLite is great for small/medium read-heavy sites but this opens up a ton of workflows now that you can plug and play with your existing database. Doesn't this render Prisma's Data Proxy useless?
Hyperdrive was not the only database-related announcement during the "Birthday Week 2023": Cloudflare unveiled the open beta of D1, their native serverless database, and of Vectorize, a new managed vector database for AI-powered applications.
This content is in the Cloud topic
Related Topics:
-
Related Editorial
-
Related Sponsors
-
Popular across InfoQ
-
Microsoft Patches Critical ASP.NET Core Vulnerability with 9.9 Severity Score
-
Monzo’s Real-Time Fraud Detection Architecture with BigQuery and Microservices
-
When Reverse Proxies Surprise You: Hard Lessons from Operating at Scale
-
Java News Roundup: Spring Framework 7.0, Spring Data, Spring AI, Payara Platform, OpenJDK, JobRunr
-
Architecture Should Model the World as it Really is: a Conversation with Randy Shoup
-
Reducing False Positives in Retrieval-Augmented Generation (RAG) Semantic Caching: a Banking Case Study
-
Related Content
The InfoQ Newsletter
A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers. View an example