FAQ
Why do I sometimes see unexpected cache behavior?
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.
What happens to my Scale plan subscription if I switch to Accelerate?
While Accelerate is in Preview, you do not need a subscription or a monthly plan. With Accelerate, you can use the same Data Proxy connection pooling features on top of the Accelerate global cache.
What is the pricing of Accelerate?
When we officially launch Accelerate and make it generally available, we will provide pricing details.
VS Code does not recognize the $extends
method
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 $extends
method.
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.
- Enter
typescript
and select and run the TypeScript: Restart TS server command.
VS Code should now recognize the $extends
method.
What regions are Accelerate's cache nodes available in?
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: https://www.cloudflare.com/network/.
What regions is Accelerate's connection pool available in?
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 (
ap-south-1
) - Asia Pacific, Seoul (
ap-northeast-2
) - Asia Pacific, Singapore (
ap-southeast-1
) - Asia Pacific, Sydney (
ap-southeast-2
) - Asia Pacific, Tokyo (
ap-northeast-1
) - Canada, Central (
ca-central-1
) - Europe, Frankfurt (
eu-central-1
) - Europe, Ireland (
eu-west-1
) - Europe, London (
eu-west-2
) - Europe, Paris (
eu-west-3
) - Europe, Stockholm (
eu-north-1
) - South America, Sao Paulo (
sa-east-1
) - US East, N. Virginia (
us-east-1
) - US East, Ohio (
us-east-2
) - US West, N. California (
us-west-1
) - US West, Oregon (
us-west-2
)
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 dashboard.
How does Accelerate know what region to fetch the cache from?
Under the hood, Accelerate uses Cloudflare, which uses Anycast 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 Anycast.
How can I invalidate a cache on Accelerate?
You can invalidate your cache on a project level up to five times a day. This can be done via the Cloud Project's Accelerate configuration page.
What is Accelerate's consistency model?
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 read-through caching strategy 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 this section for more information on selecting the right cache strategy for your query.
How is Accelerate different from other caching tools, such as Redis?
- 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.
When should I not use Accelerate's caching features?
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
#accelerate-feedback
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.
Can I use Accelerate with other ORMs/query builders/drivers?
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 Discord community in the #accelerate-feedback
channel.