You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[Postgres](/workers/tutorials/postgres/)| Direct connection |[Postgres.js](https://github.com/porsager/postgres),[node-postgres](https://node-postgres.com/)|[TCP Socket](/workers/runtime-apis/tcp-sockets/) via database driver, using [Hyperdrive](/hyperdrive/) for optimal performance (optional, recommended) |
34
+
|[Postgres](/workers/tutorials/postgres/)| Direct connection |[node-postgres](https://node-postgres.com/),[Postgres.js](https://github.com/porsager/postgres)|[TCP Socket](/workers/runtime-apis/tcp-sockets/) via database driver, using [Hyperdrive](/hyperdrive/) for optimal performance (optional, recommended) |
35
35
|[MySQL](/workers/tutorials/mysql/)| Direct connection |[mysql2](https://github.com/sidorares/node-mysql2), [mysql](https://github.com/mysqljs/mysql)|[TCP Socket](/workers/runtime-apis/tcp-sockets/) via database driver, using [Hyperdrive](/hyperdrive/) for optimal performance (optional, recommended) |
36
36
37
37
:::note[Speed up database connectivity with Hyperdrive]
@@ -45,16 +45,18 @@ Since a connection must be re-established on every Worker invocation, this adds
45
45
46
46
### Serverless databases
47
47
48
-
Serverless databases provide HTTP-based proxies and drivers, also known as serverless drivers. These address the lack of connection reuse between Worker invocation similarly to [Hyperdrive](/hyperdrive/) for traditional SQL databases.
48
+
Serverless databases may provide direct connection to the underlying database, or provide HTTP-based proxies and drivers (also known as serverless drivers).
49
49
50
-
By providing a way to query your database with HTTP, these serverless databases and drivers eliminate several roundtrips needed to establish a secure connection.
50
+
For PostgreSQL and MySQL serverless databases, you can connect to the underlying database directly using the native database drivers and ORMs you are familiar with, using Hyperdrive (recommended) to speed up connectivity and pool database connections. When you use Hyperdrive, your connection pool is managed across all of Cloudflare regions and optimized for usage from Workers.
51
+
52
+
You can also use serverless driver libraries to connect to the HTTP-based proxies managed by the database provider. These may also provide connection pooling for traditional SQL databases and reduce the amount of roundtrips needed to establish a secure connection, similarly to Hyperdrive.
51
53
52
54
| Database | Library or Driver | Connection Method |
|[PlanetScale](https://planetscale.com/blog/introducing-the-planetscale-serverless-driver-for-javascript)|[@planetscale/database](https://github.com/planetscale/database-js)| API via client library |
55
-
|[Supabase](https://github.com/supabase/supabase/tree/master/examples/with-cloudflare-workers)|[@supabase/supabase-js](https://github.com/supabase/supabase-js)| API via client library |
56
+
|[PlanetScale](https://planetscale.com/blog/introducing-the-planetscale-serverless-driver-for-javascript)|[Hyperdrive](/hyperdrive/examples/connect-to-mysql/mysql-database-providers/planetscale), [@planetscale/database](https://github.com/planetscale/database-js)|[mysql2](/hyperdrive/examples/connect-to-mysql/mysql-drivers-and-libraries/mysql2/) or [mysql](/hyperdrive/examples/connect-to-mysql/mysql-drivers-and-libraries/mysql/), or API via client library |
57
+
|[Supabase](https://github.com/supabase/supabase/tree/master/examples/with-cloudflare-workers)|[Hyperdrive](/hyperdrive/examples/connect-to-postgres/postgres-database-providers/supabase/), [@supabase/supabase-js](https://github.com/supabase/supabase-js)|[node-postgres](/hyperdrive/examples/connect-to-postgres/postgres-drivers-and-libraries/node-postgres/),[Postgres.js](/hyperdrive/examples/connect-to-postgres/postgres-drivers-and-libraries/postgres-js/), or API via client library |
56
58
|[Prisma](https://www.prisma.io/docs/guides/deployment/deployment-guides/deploying-to-cloudflare-workers)|[prisma](https://github.com/prisma/prisma)| API via client library |
57
-
|[Neon](https://blog.cloudflare.com/neon-postgres-database-from-workers/)|[@neondatabase/serverless](https://neon.tech/blog/serverless-driver-for-postgres/)| API via client library |
59
+
|[Neon](https://blog.cloudflare.com/neon-postgres-database-from-workers/)|[Hyperdrive](/hyperdrive/examples/connect-to-postgres/postgres-database-providers/neon/), [@neondatabase/serverless](https://neon.tech/blog/serverless-driver-for-postgres/)|[node-postgres](/hyperdrive/examples/connect-to-postgres/postgres-drivers-and-libraries/node-postgres/),[Postgres.js](/hyperdrive/examples/connect-to-postgres/postgres-drivers-and-libraries/postgres-js/), or API via client library |
58
60
|[Hasura](https://hasura.io/blog/building-applications-with-cloudflare-workers-and-hasura-graphql-engine/)| API | GraphQL API via fetch() |
59
61
|[Upstash Redis](https://blog.cloudflare.com/cloudflare-workers-database-integration-with-upstash/)|[@upstash/redis](https://github.com/upstash/upstash-redis)| API via client library |
60
62
|[TiDB Cloud](https://docs.pingcap.com/tidbcloud/integrate-tidbcloud-with-cloudflare)|[@tidbcloud/serverless](https://github.com/tidbcloud/serverless-js)| API via client library |
0 commit comments