<@U02SZDGF691> <https://prisma.slack.com/archives/...
# orm-help
y
@andrewicarlson https://prisma.slack.com/archives/C0MQBSAJY/p1662900428793269?thread_ts=1662898930.641479&amp;cid=C0MQBSAJY I was reading this, so the Data Proxy is for Prisma opening connections. So would I require this when working with Cockroach DB serverless? I'm fairly new to Serverless so these may be basic questions.
1
n
Hi Yudhvir 👋 The Data Proxy provides database connection management and pooling for Prisma applications. By using the Data Proxy, your application can seamlessly scale up while maintaining predictable database performance, by limiting the number of total connections used. Data proxy will be most useful for you if you are deploying your apps to Serverless environments Like AWS Lambda functions, Cloudflare workers or Vercel Edge functions.
y
That makes sense. So essentially if I understand correctly it manages the client connections for us & keeps them open. This is useful for servers apps so we don’t have timeouts & have lots of cold starts. CockroachDB has this: https://www.cockroachlabs.com/blog/announcing-cockroachdb-serverless/ Prisma supports CockroachDB & so I was wondering if it is already serverless & does connection pooling should I use it?
For context, I’ve been using Prisma With PostgreSQL for a year now & love it! I am making the switch to CockroachDB for serverless
🙌 1
Regarding connection pooling, so the proxy keeps the connection open client side? So Prisma doesn’t need to reconnect which is why the cockroach db pooling isn’t that relevant. The pooling they do seems like it works like an endpoint & keeps them open & I assumed that prisma could connect fast to the pooled connections but I guess there’s still a delay & so the prisma client being already open makes it faster?
Please let me know if any of this is wrong or I’m completely misunderstanding @Nurul
n
I haven’t tried out CockroachDB Serverless, it seems this was announced recently, but I assume that there shouldn’t be an issue using CockroachDB Serverless with Data Proxy. Regarding connection pooling,
the proxy keeps the connection open client side
the proxy helps avoid serverless cold starts by reusing existing database connections, so it keeps a few connections open and can help in reducing the delay faced due to cold starts.
❤️ 1
y
Thanks! I think I’ll start without the proxy but I’ll add it in if there are a lot of cold starts.
I think I’ll just have to try it & get my answer that way. Thanks for the help
🙏 1