Accelerate's cache performs best when it observes a higher load from a project. Many cache operations, such as committing data to cache and refreshing stale data, happen asynchronously. When benchmarking Accelerate, we recommend doing so with loops or a load testing approach. This will mimic higher load scenarios better and reduce outliers from low frequency operations.
Prisma operations are sent to Accelerate over HTTP. As a result, the first request to Accelerate must establish an HTTP handshake and may have additional latency as a result. We're exploring ways to reduce this initial request latency in the future.
You can find more details on our
If you add the Prisma Client extension for Accelerate to an existing project that is currently open in VS Code, the editor might not immediately recognize the
This might be an issue with the TypeScript server not yet recognizing the regenerated Prisma Client. To resolve this, you need to restart TypeScript.
- In VS Code, open the Command Palette. You can do so when you press F1 or select View > Command Palette.
typescriptand select and run the TypeScript: Restart TS server command.
VS Code should now recognize the
Accelerate runs on Cloudflare's network and cache hits are served from Cloudflare's 300+ locations. You can find the regions where Accelerate's cache nodes are available here: .
When no cache strategy is specified or in the event of a cache miss, the Prisma Client query is routed through Accelerate's connection pool. Currently, queries can be routed through any chosen region among the 16 available locations.
Currently, the list of available regions are:
- Asia Pacific, Mumbai (
- Asia Pacific, Seoul (
- Asia Pacific, Singapore (
- Asia Pacific, Sydney (
- Asia Pacific, Tokyo (
- Canada, Central (
- Europe, Frankfurt (
- Europe, Ireland (
- Europe, London (
- Europe, Paris (
- Europe, Stockholm (
- South America, Sao Paulo (
- US East, N. Virginia (
- US East, Ohio (
- US West, N. California (
- US West, Oregon (
You can also view the available regions when you're about to set up Accelerate or by visiting the Settings tab for Accelerate under the Region section in the Prisma Cloud Platform .
Under the hood, Accelerate uses Cloudflare, which uses for network addressing and routing. An incoming request will be routed to the nearest data center or "node" in their network that has the capacity to process the request efficiently. To learn more about how this works, we recommend looking into .
You can invalidate your cache on a project level up to five times a day. This can be done via the Accelerate configuration page.
Accelerate does not have a consistency model. It is not a distributed system where nodes need to reach a consensus (because data is only stored in the cache node(s) closest to the user). However, the data cached in Accelerate's cache nodes doesn't propagate to other nodes, so Accelerate by design doesn't need a consistency model.
Accelerate implements a particularly suitable for read-heavy workloads.
The freshness of the data served by the cache depends on the cache strategy defined in your query. Refer to for more information on selecting the right cache strategy for your query.
- Accelerate is a specialized cache that allows you to optimize data access in code at the query level with a cache strategy. On the other hand, tools such as Redis and Memcached are general-purpose caches designed to be adaptable and flexible.
- Accelerate is a managed service that reduces the time, risk, and engineering effort of building and maintaining a cache service.
- By default, Accelerate is globally distributed, reducing the latency of your queries. Other cache tools would require additional configuration to make them available globally.
Accelerate is a global data cache and connection pool that allows you to optimize data access in code at the query level. While caching with Accelerate can greatly boost the performance of your app, it may not always the best choice for your use case.
Accelerate's global cache feature may not be a good fit for your app if:
Your app is exclusively used within a specific region and both your application server and database are situated in that same region on the same network. For example, database queries will likely be much faster if your application server and database are in the same region and network. However, If your application server is in different regions or networks from your database, Accelerate will speed up your queries because the data will be cached in the closest data center to your application.
You only need a general-purpose cache. Accelerate is a connection pooler and a specialized cache that only caches your database query responses in code. A general-purpose cache, such as Redis, would allow you to cache data from multiple sources, such as external APIs, which Accelerate currently doesn't support. If general-purpose caching interests you, please share your feedback with us in the channel on our Slack community.
Your application data always needs to be up-to-date on retrieval, which would be difficult to set a reasonable cache strategy.
Even without using Accelerate's global cache, you can still greatly benefit from Accelerate by using its connection pool, especially in serverless or edge functions, where it is difficult to manage and scale database connections. You can learn more about the serverless challenge here.
No. We currently do not have any plans for supporting other ORMs/query builders or drivers. However, if you're interested in support for other libraries, feel free to reach out and let us know in our community in the