We need to talk about Prisma

preview_player
Показать описание
We migrated to SQL a month back and our biggest learning was to never use Prisma. Watch the full video to know what happened and how we found a solution.

👉 Checkout codedamn on social:

If you found the video valuable, please leave a like and subscribe ❤️ It helps the channel grow and helps us push out more valuable content.

✨ Tags ✨
#coding #sql #migration #prisma #mongodb

✨ Video Tags ✨
Never Use Prisma
We migrated to SQL. Our biggest learning? Don't use Prisma.
Don't Use Prisma.
Рекомендации по теме
Комментарии
Автор

But the marketing people say Prisma + Planetscale has "limitless scale". Thanks for the eye opening story.

Fireship
Автор

Thank you so much, starting a project with Prisma right now, will take your findings here seriously to change the stack.

GuilhermeSS
Автор

I tried Prisma for a project last year, I was using also PostgreSQL for data, I ended up ditching it as soon as I realised how complex code starts to get with simple SQL joins, and several gotchas like no support for some native data types. I ended out rolling with Postgres.js, a super fun and simple to use lib, actual SQL on string templates, with all the safety and performance Jazz.

dagoacarralero
Автор

This is literally a great video to tell how real engineering should be taken care off, thanks for sharing the learnings with us 🔥

abhishekvishwakarma
Автор

Went through the same thing. Had a large backend entirely written with Prisma. Performance on complex queries was abysmal. Rewrote everything with Kysely (still using Prisma migrate, of course) and things couldn't be better.

texoport
Автор

I have found avoiding joins to be a huge plus in terms of performance. In terms of serializing rows it gets exponential if you use a traditional left join.

penry
Автор

I have to say, a lot of points you raised up are because of not digging enough in the documentation or not understanding simple architecture choices.

I'll have to say that the most 2 biggest cons of prisma are:
1. The giant rust binaries with the graphql bindings.
2. The connection process on each query.

BUT,
regarding the point of prisma not doing SQL joins, why is that and why it's actually good.

when you use realtionMode prisma, it's stated in the docs(you showed the actual page when it's documented), that with the foreign key simulation,
no joins can happen because it's depended on the foreign key rules.
this means if you used prisma, with other SQL providers that support relation foreign keys, prisma would use the SQL joins.

but why is that, why use SQL without abusing the power of JOINs.

well, it not a decision by prisma, or even PlanetScale, it's a choice by Vitess...

you see, we all love joins because of their ease to use and how well they simulate real world scenarios,
but JOINs are very low performant on big databases, with huge amounts of rows, so because of that there is no native support for SQL joins in prisma.

in the early days of Facebook, once they started to really grow, there was a small "rule" that passed through Facebook, and that's not to use SQL joins anymore because of poor performance.

TheIpicon
Автор

Amazing video. And whilst I share the sentiment I'm still blown away by the level of overengineering some Devs will resort to not write SQL and/or because they're obsessed with types. I feel the lessons here are not just about Prisma or ORMs in general but also how we got here. I see too many devs and projects fail because they don't focus on simplicity and delivering functionality.

netssrmrz
Автор

This is just super useful. Thanks a lot

narutokunn
Автор

This is actually an eye opener, I watched this video till the end!

igboanugwocollins
Автор

Would love to see some of your test results between Keysly and Prisma (and maybe a control - just raw queries). I wonder if there’s a place along the curve where it does perform better and where it flips. Data is > anecdote

zackadam
Автор

I also jumped on the hype train of planetscale + prisma. Quickly gave up on prisma. It has that extra complexity and abstraction without making life easier. Now I’m using drizzle. I’m not sure if I like drizzle or knex more but they both get the job done

lian
Автор

Wow, thanks for working through this in public. ❤

lucaszapico
Автор

Thanks for sharing the experience with us !

yousoumar
Автор

Almost migrated to prisma and planet scale from mongodb. Now reconsidering 😢

Thanks 😊

dragenoxinside
Автор

This was refreshing, i went on a personal research phase last week about orms in js and decided not to touch them unless it is a project am using just to learn something

johnychinese
Автор

"I watched this video till the end!"
Thanks for sharing your experience with us Mehul 🙏

jagrajbains
Автор

Perhaps the most informative vid we've watching in probably 3 or 4 years. You likely saved many some significant hassle, thx for sharing this in such detail.

blujedis
Автор

This video made a great influence on the dev community, many youtube creators are now shifting from prisma to other alternatives! Thanks Mehul

sahilaggarwal
Автор

man, I've been wondering if prisma will be a good option for scaling, nice video man

EmperorAlles