Tweet by thomasgauvin
November 12, 2025
Merged! This doc goes over the connection lifecycle of a database connection when using Hyperdrive. And it's really the magic at the core of Hyperdrive. Db connections require multiple round trips to set up ( 7x going from your Worker to the db to setup a connection) for TCP, TLS, and the db auth. This is the connection setup handshake Hyperdrive makes that super fast by letting you setup connections using the special Hyperdrive connection string (env.HYPERDRIVE.connectionString) within your Worker code That will actually connect you to a _Hyperdrive instance_ running right next to your Worker. That means that your db connection handshake (the 7 roundtrips) happens all next to your Worker, eliminating cross-region network latency Once connected, your driver sends the query and that happens in a single round trip across regions within Hyperdrive to get to your db One the other side, Hyperdrive pools database connections close to your database and makes it easy to reuse them across Worker invocations. So that means that creating a new db connection on every Worker invocation is super fast because connections are made to Hyperdrive, and then Hyperdrive reuses some of its open connections. This makes database access from Workers much faster and more scalable thanks to the built-in connection pooling. This is why we made is 1) super easy to use, just drop in your connection string and get a new Hyperdrive connection string and 2) available in all plans, free or paid Check out the docs! 👇
- Author
- thomasgauvin
- Date
- November 12, 2025
- Canonical URL
- /tweets/thomasgauvin-1988644719849599213-0f67ab