Prisma is the worst for production heavy (I will go as far as to say for any) applications. I had really high hopes for it, and pitched to use Prisma ORM for our new microservice, however, 6 months in, it became disgustingly hard to maintain and justify resource consumption. I can provide several examples where we had a trouble with it.
For the context, we are running k8s node+express backend server, our queries are simple (no relative queries or anything, just retrieving record - updating record - writing record). We had 4 pods on average with 400mb RAM (scaled to 1000mb due to Prisma) - and Prisma was crashing with P1001 or P1024 errors, randomly, out of nowhere. We spent days if not weeks trying to figure out what's going on (yes, we also looked at their "" - these are jokes like optimize your query, manually limit connections etc etc), the best quick patch was to scale AWS RDS, but upon further investigation we found the following:
-
Prisma has issues with killing connections on pod death
-
trying to fix it with manual killing didn't help, we literally at some point had 100 connections dangling somehow (4 pods 9 connection limit = 36 connections, not 100 :/ )
-
-
Prisma has high error rate even in simple queries!!! We didn't get flagged on these, since we were assuming it within acceptable error range for us, but it's something you should be aware of. claims it was within 2% rate. In our manual tests (local pg - 20ms delay between requests - 1200 total) - we managed to get 20-30% rate that is not recovering, which is a joke to be honest, how the hell VCs are even funding that?
Our main assumption that the issue has to do with their internal engine, I think it lacks decent optimization at this point in time. In the end we switched to another provider (Drizzle) with as the engine, which seems to be the best and more stable solution in the market. So far we are extremely happy, since we can type cast on schema, which was lacking in Prisma, and both performance and stability allow us to not even think about it.
If you still considering using Prisma, please, use the and split your DB from the service by at least one layer. That will allow you to switch to another db in days, without having a headache of updating every single consumer :)