Picking an ORM is Getting Harder...

  Рет қаралды 9,400

Ben Davis

Ben Davis

Күн бұрын

Пікірлер: 45
@bmdavis419
@bmdavis419 Жыл бұрын
TWO THINGS: first, the SvelteKit deep dive is almost done, currently I am just struggling with trying to figure out how to explain/frame/handle the different file types (page.svelte, layout.svelte, server.ts, page.ts, page.server.ts, etc). Its tricky, and I really want this one to be done correctly. Second, the AC is out and its 95 degrees here so sorry about the tank top (sort of 😈)
@kenobi6020
@kenobi6020 Жыл бұрын
Hey Ben, love your videos! I'm learning Go after working with Node for a couple of years now and your videos have been really helpful. Have you seen htmx? I think htmx + Go can be the sveltekit + Go that you dreamed about. Keep it up with the good work!
@SRG-Learn-Code
@SRG-Learn-Code Жыл бұрын
No AC = I have to report this video because of those guns 😎😎
@Mindflays_
@Mindflays_ Жыл бұрын
I had no idea about this new direction of prisma and I use it lol thanks ❤ love your content keep it up man
@WyzrdCat
@WyzrdCat Жыл бұрын
Drizzle just seemed like the safer choice right now. Building a single very large app so unfortunately had to make that decision pretty early and it will affect things for a very long time
@zkoolkyle1
@zkoolkyle1 Жыл бұрын
Big fan, keep up the solid content 🎉❤
@boniedwin
@boniedwin Жыл бұрын
my company use oracle, so yeah only sequelize for now even some function are write in raw sql, since it's a very complex query
@tomorrowlimit6999
@tomorrowlimit6999 Жыл бұрын
I really wanted to use drizzle, the query sintax is really great and nothing comes close to it's prepared statements. But the table definition schema sucks, that's the only thing keeping me from using it. My current setup uses Prisma for schema definition, migrations and prisma studio, but with kysely instead of prisma/client, so no prisma binaries on production builds. There's generators for transforming prisma schemas into kysely interfaces, which work great in CI steps. Drizzle just hasn't a generator, and my team is already familiar with the prisma schema sintax. I do prefer drizzle over kysely, but the dev experience of prisma makes it not worth it. I wish I could integrate drizzle with prisma like I did with kysely. Kysely is mostly fine, the sintax is very close drizzle's query builder and knex, but I miss ORM-level mapping and decent prepared statements.
@lazyh0rse
@lazyh0rse Жыл бұрын
drizzle honestly seems like a clone of laravel orm. It's not bad, but prisma is miles better and the syntax is much easier to reason with imo. Either sql or just make it more like object (typescript). I hate the in-between with really no benefit aside from making you locked down to using their orm.
@JoshPalmeroc
@JoshPalmeroc 3 ай бұрын
Since you made this video about a year ago i'm curious where you're at now? Are you using drizzle or prisma currently?
@bmdavis419
@bmdavis419 3 ай бұрын
Drizzle is winning by A LOT
@mmzzzmeemee
@mmzzzmeemee Жыл бұрын
Where'd you find info about supabase's concurrent connections? I'm also curious about planetscale's lack of foreign key constraints. I'm pretty new to DBs so i don't know much about the long-term effects, so maybe you can also make a vid on this? (And maybe other things about supabase vs planetscale as well)
@bmdavis419
@bmdavis419 Жыл бұрын
supabase.com/blog/supabase-pgbouncer
@mmzzzmeemee
@mmzzzmeemee Жыл бұрын
​@@bmdavis419 thanks would also be nice to (if you're going to make a video on it) to see how this would potentially affect production apps (i guess around 10k+ MAUs or something)
@DevlogBill
@DevlogBill Жыл бұрын
Hi Ben, are a lot of companies using these newer types of databases like Prisma? I just started backend development earlier this year and I am using the basic traditional SQLite3, MySQL and I was curious is it worth learning these newer types of databases for landing a job? Thanks!
@massy-3961
@massy-3961 Жыл бұрын
These are ORMs not databases. In fact, you can use these on top of SQLite and MySQL to make those databases easier to work with. As far as are companies using them? Well, production tends to be grandfathered, battle tested, opinionated, scalable frameworks, and I don’t think companies are transitioning just yet.
@ooijaz6063
@ooijaz6063 Жыл бұрын
To be honest I would lean towards query builder such as Drizzle or Kysely, prisma provides great DX, but I doubt anyone will ask you so much about an orm on the interview. Raw SQL is always needed in bigger projects (for some queries), so if you know SQL, picking up any ORM won't be such a big deal. Especially in JS ecosystem, where everything changes daily, it's important to understand the logic behind the scenes.
@mmzzzmeemee
@mmzzzmeemee Жыл бұрын
I'm about to learn on ORM and I'm leaning towards drizzle. One common criticism I've heard of prisma is that when you need complex queries, it's hard to write them. Does drizzle allow plain sql queries?
@DevlogBill
@DevlogBill Жыл бұрын
@@mmzzzmeemee I haven't tried out drizzle yet but I think I may tomorrow and I just need to figure out if I am able to import drizzle into my Django project. I will post a message stating if I failed and of my experience to share with others.
@ooijaz6063
@ooijaz6063 Жыл бұрын
@@mmzzzmeemee Yes, drizzle do have special Template literal sql; you can write raw sql using it.
@greenlines1208
@greenlines1208 Жыл бұрын
looking buff! bro 💪
@MrSparc
@MrSparc Жыл бұрын
We at my work are against ORM frameworks as the experience had proved in production environments with hundreds of customers and transactions per secs we had to deal with big performance issues. The syntaxes and easy code of a framework has the reverse side of the coin with a black box that generates SQL queries to your DB that aren't optimized for the tasks you're using. We saw on DB logs ORM generates SQL queries with hundreds of unnecessary fields, joins, and transformations for tasks that you paid with slow DB responses. And this kind of issues only are raised in production environments or with real workload tests. So, a word of caution every time you use a ORM take a look the generated SQL and profile the performance of your system with real scenarios.
@au2001
@au2001 Жыл бұрын
Surprised you didn't mention TypeORM nor Sequelize, any thoughts on those two?
@TornadoComputerz
@TornadoComputerz Жыл бұрын
Are ORMs vulnerable to SQL injections?
@deado7282
@deado7282 Жыл бұрын
It depends, but most of them are not. Still, proper validation is necessery in any case.
@savire.ergheiz
@savire.ergheiz Жыл бұрын
orm is the issuse in the first place. its not really needed 😂
@neon-gi5tb
@neon-gi5tb Жыл бұрын
What your thoughts on Laravel?
@bmdavis419
@bmdavis419 Жыл бұрын
Never used it so I don’t really have anything intelligent to say other than I don’t like php lol (although that does not mean laravel is bad)
@mentalmarvin
@mentalmarvin Жыл бұрын
I thought you were gonna learn rust
@bmdavis419
@bmdavis419 Жыл бұрын
Yea that might happen someday but idk I kinda doubt it lol
@Kats0unam1
@Kats0unam1 Жыл бұрын
I still think JS on the backend is a mistake.
@sleekism
@sleekism Жыл бұрын
why?
@Kats0unam1
@Kats0unam1 Жыл бұрын
@@sleekism Its so easy to make memory mistakes for example like leaking memory... Javascript is a powerful language but was never intended to be used on the server.
@abdirahmann
@abdirahmann Жыл бұрын
Ben, im sorry. Why don't you JUST WRITE SQL??, here's what my take and the problems am trying to avoid, ORMs dont really teach you SQL which if you are a beginner, you'll have a very roigh time with databases of any kind, 2ndly most of the industry uses JUST SQL because ORMs become very limiting when you start doing complex queries e.g drizzles many-to-many relations syntax is just pure garbage!, 3rd there is a very high chance that you are writing SQL for complex queries already, why dont you just go with SQL??
@bmdavis419
@bmdavis419 Жыл бұрын
Often times I do, but there are also a lot of places where having an orm is really really helpful, for trivial CRUD operations having easy out of the box types and syntax makes your life a hell of a lot easier. I think that drizzle is the best balance where it is pretty much TS with SQL. There can be a lot of headache going pure sql, but getting as close as possible is good imo. I do full agree about beginners though, you should reach for an orm when u don’t feel like writing a bunch of selects and adding types yourself, not to learn. Also both of these ORMs allow u to write custom SQL queries which solves for the really complex weird stuff u run into (which trust me I have)
@andgatehub
@andgatehub Жыл бұрын
ORMs are good mostly for typechecking.
@nested9301
@nested9301 5 ай бұрын
Prisma is not. Open source it's a paid tool
@bmdavis419
@bmdavis419 5 ай бұрын
the ORM is open source, but they have a bunch of paid additions on top of it
@1337-y8u
@1337-y8u Жыл бұрын
why the hell do we even need ORMs? Why are you talking about it like you fell in love with it? Just write SQL?
@ooijaz6063
@ooijaz6063 Жыл бұрын
SQL is great, but writing raw SQL for fast iteration is not the best thing to go with. Every change to the schema means that you need to check every SQL query and adjust it manually. Without an ORM you usually need to manually map the rows to the schema, which means more code, which means more potential bugs. Every large project uses some kind of ORM or ORM-ish query builder, there is no real way around it. Raw SQL is always used for the complex queries.
@thienhuynh7962
@thienhuynh7962 Жыл бұрын
⁠@@ooijaz6063 Raw sql is also written for performance critical queries, database testing and many more as well
@mohamedelsayed1868
@mohamedelsayed1868 Жыл бұрын
@@ooijaz6063 daaah performance gets fkd there is no better than sql + oop the most readable application u could ever make same if make change to the schema u gonna need to check ur code which means more potential bugs using an orm means u cant write sql its as simple as that using sql gives better utilization in ur queries and better performance
@tomich20
@tomich20 Жыл бұрын
exactly. In my big projects i saw my self building my own ORMs, and even with that, duplicating queries, and having vulnerabilites. Now im teaching my self PRISMA just to save time on the future. Limitations: there are some many-to-many queries that are almost impossible with prisma, but they let you mix it with your own RAW queries. @@ooijaz6063
Prisma 5: Faster By Default | Prime Reacts
19:01
ThePrimeTime
Рет қаралды 40 М.
Drizzle vs Prisma: Which ORM is right for YOU?
5:59
Kodaps Academy
Рет қаралды 10 М.
How Much Tape To Stop A Lamborghini?
00:15
MrBeast
Рет қаралды 240 МЛН
А я думаю что за звук такой знакомый? 😂😂😂
00:15
Денис Кукояка
Рет қаралды 4,9 МЛН
Is Drizzle Really Better Than Prisma?
20:15
Web Dev Simplified
Рет қаралды 88 М.
DONT USE AN ORM | Prime Reacts
25:46
ThePrimeTime
Рет қаралды 239 М.
Prisma Just Got a Lot Faster
6:50
Josh tried coding
Рет қаралды 35 М.
This Drizzle ORM feature is a game changer!
8:11
Marius Espejo
Рет қаралды 20 М.
I tried 8 different Postgres ORMs
9:46
Beyond Fireship
Рет қаралды 437 М.
The Truth About HTMX
12:27
Theo - t3․gg
Рет қаралды 173 М.
Picking a Database is Hard...
17:43
Ben Davis
Рет қаралды 5 М.
Complex Schema Design with Drizzle ORM | Common Patterns
45:55
Prisma Vs. TypeORM Vs. Sequelize | Which is Better?
12:44
PedroTech
Рет қаралды 34 М.
How database migrations work when using Drizzle ORM
6:27
Web Dev Cody
Рет қаралды 10 М.
How Much Tape To Stop A Lamborghini?
00:15
MrBeast
Рет қаралды 240 МЛН