I'm currently working on a backend setup using NestJS, Fastify, and Supabase PostgreSQL. As part of this project, I'm trying to decide between Prisma and TypeORM as the ORM to use. My main priorities are ensuring that my choice is future-proof, as I don't want to regret it later, and that I select an option that provides good performance, especially since my app is designed to grow. It's basically a mix of e-commerce and social media, with features including user authentication, social interactions like posts and likes, e-commerce functionalities like ordering and transactions, messaging capabilities, and profile management features. Which ORM do you think would be the best fit and why?
5 Answers
Prisma is the way to go! It's more stable, has great TypeScript support, and effectively manages complex relational data. TypeORM's okay but Prisma really shines for growing applications like yours.
I would definitely recommend Prisma. TypeORM has been a bit unreliable lately, and even though it's had some recent attention, it still carries a heavy backlog of issues. Personally, I prefer Prisma's API and its clear syntax for queries, but I've also tried Drizzle and MikroORM which are solid in their own right.
True, but I've found Prisma to lack some handy types, and having that extra build step can get annoying. I've been happy with TypeORM despite its quirks.
I've been through both ORMs, and it often comes down to personal preference revealed after some time. Prisma generally offers a more pleasant experience due to its consistency and type safety. TypeORM provides more flexibility but can be tricky, especially when scaling up. Given your tech stack, I suggest Prisma—it'll make development smoother. If needed, you can still run raw queries later for performance tweaks. Future-proofing is essentially about keeping your schema clean.
Thanks for the detailed insight! I came here for a Prisma vs TypeORM discussion and now I'm also confused about Drizzle.
If you're looking for a better experience, consider using Drizzle with NestJS. Check out some tutorials to get started; it might change your workflow for the better!
Steer clear of TypeORM if you value simplicity and sanity! From my experience in a larger project, it was riddled with inconsistencies and performance hiccups. Prisma has a much better developer experience overall, especially thanks to its solid documentation.
Does Prisma support inner joins now?