Hi, I heard that Prisma is not really optimized. P...
# prisma-client
s
Hi, I heard that Prisma is not really optimized. People are saying that Prisma runs an unnecessary number of queries, and that it doesn't multiple DB connections. Is this going to be fixed and will things like DB pagination be supported in the future?
j
Prisma runs an unnecessary number of queries
Prisma returns the data you ask for. Sometimes that would be possible with a query or two less, but mostly it does not impact performance. If it does, this will be fixed sooner or later (if someone tells us about it).
it doesn't multiple DB connections
Prisma uses a collection pool that you can configure any way you want - so 1 Prisma Client can open x connections to the database. What does not work yet, is that you can define the schema of multiple different databases in one Prisma Schema, but you can just use multiple Prisma Clients (each with its own schema) to do that. What really does not work is to query across multiple databases at the same time - but that is a very common limitation as it is a super uncommon use case.
will things like DB pagination be supported in the future
I am not sure what you mean, normal database side pagination is of course supported right now: https://www.prisma.io/docs/concepts/components/prisma-client/pagination
d
I would also like to add that Prisma 2 has been in active development for a long time now (Photon and Lift anyone?) and performance keeps getting better and better. When people tried Prisma, it may have been slow at that point in time or unsuitable for their use case and has tainted their opinion of it. As performance improvements and features have been added, it has been getting faster and faster. I would recommend trying it for an extreme edge case in your application and see if the performance is suitable for you. If it isn’t, open an issue on Github with your use case and the feature/performance that is missing. Like with every piece of software, only you can decide if it is suitable for your project and if other benefits (developer ergonomics etc) are more valuable to you than shaving 10ms off a db query
💯 2