Why Prisma Might Not Be a Good Choice for Your Project

preview_player
Показать описание
Prisma is nice. I've used it in nearly all of my projects. But it's not good in every use case. The awesome DX comes with some large trade-offs I didn't even know about until I dug further into this topic. Chances are you didn't either.

-- my links

Рекомендации по теме
Комментарии
Автор

Prisma's DX is great! But as someone who's been shipping Drizzle for just over a month and a half now, I don't think I can go back.
It doesn't even feel like an ORM, more like a lite wrapper around SQL.

SeanCassiere
Автор

Opinion: The Prisma approach is really great. Great when you want to get things done.

allan_archie
Автор

🎯 Key Takeaways for quick navigation:

00:14 🔄 *Prisma's architecture involves a query engine written in Rust, which adds complexity to the data retrieval process.*
01:23 💡 *Prisma has benefits like intuitive schema declaration but is inefficient in handling data queries, especially with SQL joins.*
02:30 🌐 *Prisma lacks Edge compatibility due to the large size of the Rust binary used in the query engine.*
03:13 🔍 *Drizzle ORM offers Edge compatibility and more control but may require SQL knowledge and has a more complex setup compared to Prisma.*
05:07 ⚖️ *Consider using Drizzle if you value Edge compatibility and are comfortable with SQL, even though it may not provide the same developer experience as Prisma.*

Made with HARPA AI

maxxflyer
Автор

Could you do a video explaining the full basics in Drizzle with Planetscale and Next Auth?
That would be great!!!
Thanks for you awesome content, it helps me a lot

CorujaCareca
Автор

For those who know SQL, sometimes clean SQL without ORM is better.
Write a library that will contain the queries with validation and verification of the parameters. and return them in present form (interface \ tuple \ class).
It's very efficient, it's intuitive, when you work correctly it's secure and it's easy to mock it for tests.

omerpriel
Автор

MikroORM is another fantastic Node ORM. Despite its functionalities, it is being developed by just one guy Martin Adamek who does it almost philanthropically so it makes me appreciate the tremendous work he did for this project. I guess he applied for some kind Github funding the project was rejected. The only video about Mikro I remember is in Ben Awad's tutorial of LiRedit from I guess 2-3 years ago. I hope some youtubers will make videos about MikroORM and spread the word about it because I think it is worth it. It would be also great for the creator if he noticed much interest in the project on the internet. So Josh, I count on You :)

albertszymanski
Автор

I'm a free tier free loader and I love the dx of prisma. If my userbase out grows my free tiers I will move the tech over to more scalable solutions. Planetscale to AWS RDS, Vercel to AWS Amplify.

I didnt know about it's querying costing more money so I really hope they can fix that soon. If they can fix it I will get more out of my free tier plans. There's a gap in the market here for a typesafe ORM that runs on the edge with a decent DX!

devfren
Автор

Worth to mention that drizzle recently added relational queries, which are pretty similar to prisma includes, expect that ts is super slow and requires more manual work to set up.

maaasyn
Автор

Can you do a video explaining the full basics in Drizzle with Planetscale??? Please !

vickoalan
Автор

Ah, did you use the last update? They added relational queries and other cool features to give prisma DX (or much closer). For us we do more complex queries and drizzle can do then all, it’s great

jrdn
Автор

I started using Kysely recently and I'm pretty happy with it

_nikeee
Автор

Hey Josh, thanks for another amazing and really informative video 😄 I work at Prisma and quickly want to react to a few of the things you've said in the video.

First, regarding Edge Support in Prisma. If you're using the plain ORM, this is indeed not possible right now. However:

- We are currently working on a solution to enable usage of Prisma ORM in Edge functions that will work even with the Rust-based query engine. We don't have a concrete timeline yet but expect some more news about this in the next few weeks/months 🎉
- It is still possible to use Prisma in Edge environments using Accelerate. Accelerate is an external connection pool (and also comes with an optional, global database cache) that you can use to proxy your DB connections from Edge functions. In fact, when deploying an application to the Edge, you'll want to use an external connection pool to ensure the scalability of your DB connections during traffic spikes. If you use Drizzle or another ORM without an external connection pool in Severless or Edge environments, you run the risk of exhausting your DB connections because each function instance will spawn a DB connection which in situations of high traffic will lead to the exhaustion of your DB connection limit. With an external connection pool, this problem is mitigated so using this external connection pool is the more sustainable architecture in the first place.

We love your content at Prisma and are looking forward to more videos 😄💚

nikolasburk
Автор

The drizzle team moves so fast that this video is already out of date 😮 Their new relational query builder has DX that’s super close to prisma’s while only executing a single query.

ikeako
Автор

I've read somewhere that prisma is working on a solution to enable edge usage 🤔

zivtamary
Автор

My issue with Prisma is that it won't attempt to reestablish a connection if the initial connection fails. For example, I have an API lambda that calls an Aurora cluster, but as soon as the cluster sleeps (to save money), Prisma will wake it up with a query, but that query also fails and Prisma never recovers even if on the next query the RDS is running. Still love it though 😂

yoitsba
Автор

That query engine has 15mb built with RUST, pretty heavy.

yurisoares
Автор

Had the same realization a while back and found EdgeDB. The performance benchmarks win and the dev experience is nice. Only works with Postgres though.

anubiseyeproductions
Автор

I personally prefer MikroORM. It has everything Prisma does and more plus is battle tested.

davidhavl
Автор

Gj josh, I think you missing comparing what drizzle does differently when it comes to performance after talking about what prisma does (wrong/different)

smotch
Автор

I recently migrated from prisma to drizzle and I really liked it, honestly it didn’t bother me how tricky it is to setup and push migrations to planet scale but it was fun

koruko