Compare Accelerate
Learn how Prisma Accelerate compares to other connection poolers like pgbouncer
Prisma Accelerate provides a global cache and a connection pool that spans multiple regions, so applications with users in many locations read data with low latency wherever the database is hosted.
The managed connection pool is designed for serverless infrastructure, where connection counts rise and fall with traffic.
This page compares Prisma Accelerate with other global cache and connection pool options.
How Accelerate differs
Accelerate differs from the other options compared on this page in four ways:
- Query-Level policies: Accelerate lets you set a cache policy per query. It is common to have some values that need to be cached for a long time, others that need caching for a short time, and some that should not be cached at all. With Accelerate you can do this, and even set different cache strategies per query.
- Global by default: Accelerate is globally distributed by default. You never need to worry about where a user is located with respect to your database location.
- Fully managed: You don't need to manage a server or worry about uptime. Accelerate is fully managed for you.
- Auto-scaling: Accelerate adjusts resources to match workload demand during traffic spikes.
Accelerate global cache
Prisma Accelerate's global cache serves data from the edge location closest to your users, wherever your database is hosted. This lowers latency for users and reduces read load on your database by avoiding roundtrips.
| Accelerate | Hyperdrive | PlanetScale Boost | |
|---|---|---|---|
| Fully Managed | ✅ | ✅ | ✅ |
| Globally distributed edge infra | ✅ | ✅ | ✅ |
| Control cache policy from code | ✅ | ❌ | ❌ |
| Query-level cache policies | ✅ | ❌ | ❌ |
| Postgres compatible | ✅ | ✅ | ❌ |
| MySQL compatible | ✅ | ❌ | ✅ |
| MongoDB compatible | ✅ | ❌ | ❌ |
| Automatic cache updates | ❌ | ❌ | ✅ |
Why these matter
- Since Accelerate extends the Prisma client, you can control caching policies directly from your codebase with one extra line of code. Here is an example using the stale-while-revalidating caching strategy:
await prisma.user.findMany({ cacheStrategy: { swr: 60, }, }); - Query-level cache policies let you control which queries are cached and how each one is cached. You may want certain data in your app to be cached for several days, other data to be cached for a just a few minutes, and other data to be not cached at all. Of the options compared here, only Prisma Accelerate supports this.
- Automatic cache updates means that the cache is automatically updated when a change in the database occurs. With Accelerate, you are in control of how the cache is invalidated, using various caching strategies.
Accelerate connection pool
Prisma Accelerate includes a globally hosted connection pooler, which absorbs peak loads. Using a connection pool is important especially for serverless infrastructure, which by nature is not able to control connection volume to the database on its own. Prisma Accelerate offers a fully managed, globally colocated option that auto-scales with your workload.
Management
| Accelerate | pgbouncer | pgcat | Digital Ocean (pgbouncer) | Neon (pgbouncer) | Supavisor | Hyperdrive | |
|---|---|---|---|---|---|---|---|
| Fully managed | ✅ | ❌ | ❌ | 🟠 | ✅ | ❌ | ✅ |
| Globally distributed | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
| Integrated with ORM client | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Authenticate with API key | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Redundancy | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
Why these matter
- If you decide to manage a connection pooler yourself (eg. using pgbouncer or pgcat) you will also be responsible for managing its uptime. If the server crashes, your application may be down until you recover it. Accelerate, as a fully managed solution will be recovered for you transparently, in the unlikely case of any infrastructure issue.
- The hosted pgbouncer option on Digital Ocean is semi-managed, you will need to set it up in your Digital Ocean account, and ensure it is running smoothly at all times.
- Authenticating with an API key can be a helpful security measure, allowing you to decouple database credentials from application secrets. Rotate API keys as often as you like, without needing any credential changes in your database
- Redundancy is helpful in the unlikely scenario that your connection pool service goes down. With Accelerate, it is automatically handed over to another server without interruption.
Performance
| Accelerate | pgbouncer | pgcat | Digital Ocean (pgbouncer) | Neon (pgbouncer) | Supavisor | Hyperdrive | |
|---|---|---|---|---|---|---|---|
| Auto scaling | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Globally distributed | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
| Optimized queries over HTTP | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
| Isolated compute | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
Why these matter
- Accelerate will automatically scale up and down to suit your application workload, so you do not run out of compute resources. This also provides redundancy against a single compute instance failing: if an instance goes down, Accelerate spawns a new one.
- Cross-region TCP handshakes between the application server and PgBouncer or the database are costly and time-consuming. If connections are reused only at the PgBouncer layer, the TCP handshake and connection setup still consume unnecessary time on every single request, which undermines the efficiency of connection reuse. Prisma Accelerate improves this by using HTTP, which is more efficient for connection management. It reduces the overhead associated with TCP handshakes, resulting in faster, more responsive interactions between your application and the database.
- Isolated compute resources mean other customers' workloads do not affect your performance.
Database Support
| Accelerate | pgbouncer | pgcat | Digital Ocean (pgbouncer) | Neon (pgbouncer) | Supavisor | Hyperdrive | |
|---|---|---|---|---|---|---|---|
| PostgreSQL | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| MySQL | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| PlanetScale | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| CockroachDB | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| MongoDB | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
