Data Proxy considerations and limitations
Considerations
Connect to databases hosted with a provider different from AWS
You can connect to a database hosted on any provider that is accessible from a public internet address. For best results and response times, configure Data Proxy in a region that is the same or as close as possible to the database.
We plan to expand the number of providers and regions. If we don't yet support a region or provider, you can submit a request. This helps us to prioritize providers and regions.
Recommended concurrent connections
We recommend that you use a database that supports at least 20 concurrent connections.
You will probably not need to set a concurrency limit on AWS Lambda. If necessary, requests are queued until they can be processed.
For more information about configuring a maximum number of connections to the database, see Manage the number of database connections.
Idle connections to the database
The Data Proxy keeps several connection pools running to maintain open database connections even when your application does not run any queries. The connection pools and any remaining idle connections close after six minutes of inactivity (or when your application does not send any queries to the database). The number of idle connections to the database depends on the number of running connection pools at any point in time.
In each of the supported locations, the Data Proxy architecture includes multiple clusters that maintain idle connections to the database.
Limitations
Prisma Migrate and Introspection do not work with a Data Proxy connection string
You cannot use specific Prisma CLI commands, such as prisma migrate
and prisma db pull
with a Data Proxy connection string.
To work around this issue, specify a direct database connection string for each Prisma CLI command that you need.
Data Proxy concurrency limits
Depending on your project plan, the Prisma Data Proxy provides a different limit of concurrent proxy instances.
The performance of a single proxy instance depends on a large number of variables, including the following:
- the type of queries
- latencies and deployment locations
- the performance of your database
If you see 429
HTTP errors in your logs, this probably means that you hit the concurrency limits.
Contact Support if you hit the concurrency limits and cannot scale your Prisma application.
Unsupported Prisma Client features
Metrics preview feature not supported
Data Proxy does not yet support Prisma Client's Metrics preview feature.
To use the Data Proxy, you must first remove metrics
from the previewFeatures
section of your schema.prisma
file.
For example:
generator client {provider = "prisma-client-js"previewFeatures = ["metrics"]previewFeatures = []}
If you have the metrics
preview feature enabled and you run prisma generate --data-proxy
, the command shows an error.
$connect and $disconnect not supported
With the Data Proxy, the PrismaClient
method $connect
does not create a new connection pool and the $disconnect
method does not close the connection pool.
Both methods are valid syntax in Prisma Client with the Data Proxy, but they do not have any impact on the connections to the database. This is because the Data Proxy manages the connections.