I am currently using Drizzle, and I am running into issues where Drizzle just wouldn't insert the correct boolean value into my Postgres database. Like I made sure that the value being inserted is correct before I add it to my insert statement, but the ORM is still inserting it incorrectly to our database.
I also noticed that the Drizzle has open bugs on things that should've been solved at the start, like this GitHub issue.
Granted, Drizzle doesn't have their 1.0 release yet, and so the ORM can drastically change over time, but we need something that actually works, and doesn't have bugs at the fundamental level.
So I am currently revisiting this topic of ORM's, and I am considering Prisma. Granted, it's notorious for not supporting joins at the database level. But now that it does have it, I want to know if any of your opinions of Prisma has changed?
Is Prisma now a lot better than how it was before?
For my use case, we don't need edge as it's some internal app. Having great performance would be nice, but we absolutely need correctness here. The ORM should not be inserting incorrect values to the database. It must have good migration and type support. We want to avoid having to create all the types ourselves, so we want to make use of its query builder to help us with that.
So given this, would you recommend Prisma? Or do you have other alternatives?
Raw queries, ORM, Query builder, code generators etc which pg client library would you choose with Node.js today in production?
Popular ones are: 1] Knex 2] Sequalize 3] TypeORM 4] Prisma 5] Drizzle 6] MikroORM
If you can also comment on "why" that would also be great. If there is any new recommendation that is also great
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 "suggestions" - 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. This article 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 node-pg 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 Hexagonal Architecture 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 :)
I’m about to launch my first project (Chrome extension) and questioning my database decision. Built everything with PostgreSQL and Prisma, but wondering if I should switch to Supabase before going live.
What I’m storing:
∙ User authentication (accounts, sessions)
∙ Subscription tiers and usage quotas
∙ Request history and some cached data
Pretty standard SaaS stuff. Nothing complex, but could scale to a decent number of users if things go well.
Current setup:
Node.js backend with Express, PostgreSQL database, Prisma as the ORM. I built the JWT auth flow myself - login, signup, password resets, token refresh, the whole thing. Took a while but it works.
I keep reading about Supabase having built-in auth and real-time features. The auth part is tempting since I’m not confident my implementation is bulletproof. But I’m not sure if Supabase even fits my architecture.
From what I understand, Supabase is designed for direct client-to-database access. My setup has the Chrome extension talking to my Express backend, which then talks to the database. Does Supabase make sense for that pattern or am I thinking about it wrong?
Is this one of those things where the choice doesn’t really matter for a small project, or are there actual tradeoffs I should consider?
For those who’ve built similar projects, what would you go with? Or should I just stick with what’s working and stop second-guessing myself?
I am trying to dockerize a Node server running Express and Prisma, and an instance of Postgres.
The goal is to have a single repo, where I can type docker-compose up and everything is spun up at once, in the right order. From what I have found online, it seems that the Postgres container needs to be fully functioning before the Node container should spin up.
At which point in this chain should the PrismaClient information be generated/copied, and using what command? npx prisma generate or npx prisma migrate dev or something else?
I am a bit burnt out on this, to the point that I've tried probably 20 different solutions, Dockerfiles, docker-compose files, tweaking, resetting, etc. With that being said, I'm probably not even articulating what is going wrong properly.
Does anyone have an example of a working Dockerfile, docker-compose.yml, the right scripts in package.json, etc. that successfully build a Postgres server, Node server, and handle all of the Prisma requirements in the right order to make composing up/down quick and easy?
Thank you in advance!
Which ORM are you using with your database and why? Do you also use native SQL in some cases?
I have experience working with MongoDB using Mongoose in Node.js, but now I'm planning to switch to PostgreSQL. I’m not sure which ORM to use for PostgreSQL. Can anyone suggest the best ORM for working with PostgreSQL in Node.js?
I always find it funny that tools describe them as 'next-gen' either stay in the 'upcoming' or 'next-gen' status, or die out before they become current lol. Did they finally fix their SQL joins?
I'm new to node as of the last month. I started my project with prisma cause it seemed to be a popular ORM.
I have found it PAINFUL to work with. I don't understand what problem it solves. It's less user friendly and less functional than straight SQL. I run into constant issues trying to do what should be basic things.
Does it really suck or is this just cause I'm a beginner? Is there a better alternative? Currently eyeing Drizzle.
Edit: Appreciating the insights. After reading some responses I'm now leaning towards Kysely since its type safe but let's me basically write SQL which j prefer.
I really think it's a stupid idea to cover so much ground when in reality most people don't switch databases that often.
Do you also think it's a stupid idea or have you seen examples where people have constantly changed databases while running a huge production site which I know nothing about?
roof melodic weather birds include bedroom march cooing fade encouraging
This post was mass deleted and anonymized with Redact
Hi all,
I'm developing an ETL service for an online ordering platform that manages products, inventory, orders, and accounting. Our primary application uses MongoDB (about 30GB across 50+ entities), and I'm tasked with creating a Node.js service (using Prisma) that listens to RabbitMQ events and stores data in Postgres. For our Superset reporting dashboard—hosted in a Docker container with Postgres on Digital Ocean—we’re constructing datasets from approximately 35 materialized views refreshed at intervals (5, 10, 15, or 60 minutes) due to performance issues with regular views and table indexes. Currently, the primary/foreign keys on the tables are stringified Mongo ObjectIDs.
I’d appreciate insights on the following:
Is this solution viable given the data volume and complexity?
Are there better alternatives to using materialized views for our reporting needs?
Will storing Mongo ObjectIDs as strings hurt performance compared to integers, especially regarding indexing and model consistency with Prisma?
Is there an alternative to Superset that is both low-cost and manageable?
Any recommendations or insights are greatly helpful.
Do companies usualy use mongoose or prisma in a node + express aplication? I always hear about the MERN stack, but I like prisme a lot more than mongoose
Hi people, I just read on Pirsma doc that Prisma Postgres contains a risk on total data loss. Yet they say it's because of the absence of automated backups only I'm still worried, can I use it for my hobby project or should I wait ?
EDIT: Doc link: https://www.prisma.io/docs/orm/overview/databases/prisma-postgres
It create migrations like prisma is preferred.
I can't use Prisma since I want to use a lot of Select For Update for avoid logical race conditions.
Thanks
Even if you live on Mars, you couldn't escape the big Prisma ORM hype
How is Prisma different than 'traditional' ORMs (TypeORM, Sequelize)? is it better? is it now the supreme choice for your next project ORM?
My new blog post covers these questions with code examples and numbers. It also includes a short hello-world section to give you a sense of how Prisma syntax looks like
Am I an ORM expert? Not at all. Although I have vast experience with databases, I'm writing from the perspective of a casual developer who seeks the right ORM for his next project. Hope you like it
https://practica.dev/blog/is-prisma-better-than-your-traditional-orm
I'm about to start a project at work—it'll be an Express API—and I'm trying to decide which ORM to use. I really like Drizzle, but I'm a bit concerned that it doesn't have many features for handling migrations, and I've noticed that Prisma has improved a lot. What do you think?
For a personal project I'm looking for a modern nodejs ORM or a query builder. I've done a lot of research and it's hard to know what's the best so I've done an excel spreadsheet :
| ORMs | Coded in typescript | Query style |
|---|---|---|
| Prisma | TRUE | Schema + client API |
| Typeorm | TRUE | Decorators + Active Record/Data Mapper |
| Mikro-orm | TRUE | Data Mapper |
| Sequelize | (half) | Active Record |
| Query-builders | ||
| Drizzle | TRUE | Query builder + light ORM |
| Kysely | TRUE | Query builder |
| Knex | _ | Query builder |
| Objection | _ | Query builder + light ORM (Knex-based) |
So far I have tested Drizzle and Prisma :
- Drizzle : I liked the simplicity and the fact that it's close to SQL. But I disliked a few things. Most of it is linked to the documentation and feedback from the CLI. First of all the maintainers don't even speak english properly so the documentation feels a bit low-cost. And most importantly, the Drizzle-kit CLI doesn't even give you any feedback when there is an error. It just stops without doing anything.
- Prisma : I tried it because ChatGPT told me it was the most popular and modern. I really liked the documentation and the CLI gives me good, verbose feedback when there is a problem. My only worry is that it's made by a company who seem really desperate for money because they are pushing a product that nobody cares about (Prisma Postgres).
What are your opinions? Should I stick to Prisma? (so far my best choice, but i'm open to alternatives).