Prisma 5: Faster By Default | Prime Reacts

  Рет қаралды 40,302

ThePrimeTime

ThePrimeTime

Күн бұрын

Пікірлер: 92
@beni69
@beni69 Жыл бұрын
pris'MA NUTS
@ThePrimeTimeagen
@ThePrimeTimeagen Жыл бұрын
Yes pls
@austincodes
@austincodes Жыл бұрын
😂😂😂
@Philopater-Phoneix
@Philopater-Phoneix Жыл бұрын
XD
@iliassglitch
@iliassglitch Жыл бұрын
Hilarity 😂
@AlohaBrent
@AlohaBrent Жыл бұрын
Gottem
@Cyber_Lanka
@Cyber_Lanka Жыл бұрын
Clarification about that previous article. That relationship issue only happens when you specify relationMode = "prisma" in the schema file. This tells Prisma to emulate foreign keys because the underlying DBMS doesn't support that. In other cases, Prisma works the same way. It will do all the joins using the DBMS/SQL, not using their Rust engine thing.
@darshandev1754
@darshandev1754 Жыл бұрын
thats great to hear
@thobias-s5x
@thobias-s5x 11 ай бұрын
This doesn't seem to be true in my case. I have no relationMode setting in my schema file and I see individual select statements on all tables when fetching with joins. In other words of you want to join table a and b prisma will do two individual select statements on each table. I am using postgres so it is not because prisma is defaulting to its 'prisma' relationMode
@alsjourney
@alsjourney Жыл бұрын
Love these videos. Even though you just react but the input you provide is so valuable
@blenderpanzi
@blenderpanzi Жыл бұрын
The whole separate process and IPC thing is a big WTF to me. For an ORM? There is a library option where a native library is loaded and no separate process is started. That option was broken for a while because of wrong flags for dlopen() that caused a segmentation fault because Prisma links a different OpenSSL version than NodeJS does.
@mathijsfrank9268
@mathijsfrank9268 Жыл бұрын
"Most of what youll be doing is basic sql." Tell that to my work where we write almost all business logic in stored procedures that are hundreds of lines long and have existed for over 20 years....
@dacam29
@dacam29 Жыл бұрын
You work for the government or in a big insurance/bank cie!? 😂
@Adelphos0653
@Adelphos0653 Жыл бұрын
Lol, we use prisma, but we refuse to use stored procedures. We want business logic in our primary code
@travishatch6246
@travishatch6246 Жыл бұрын
Lol just had to troubleshoot a 2000+ line stored procedure that generates its own dynamic SQL statements and inserts them into a temp table from a cursor nested in a cursor Then it begins a transaction and opens a cursor to execute the previous generated SQL statements💀
@travishatch6246
@travishatch6246 Жыл бұрын
​@@Adelphos0653we use an database schema from pre Y2K and up until a year ago all logic was done in the database. Mainly table triggers, dynamic SQL compiling and executing during runtime (to allow for the installed app to be independent of form field additions) and stored procedures.
@mathijsfrank9268
@mathijsfrank9268 Жыл бұрын
@@dacam29 No, it's a very small company (only 4 people) which was started about 25 years ago by someone that only really knows databases. The core software is used in production since that time so we can't just change it, although we are trying.
@frosty2912
@frosty2912 Жыл бұрын
The GraphQL like way transmitted the entire schema to the DB each time, the new way just transmits the bits you need.
@IzioDev
@IzioDev Жыл бұрын
Really great to have commentary after the reading with the community 👍 Was adding more context
@guidobit
@guidobit Жыл бұрын
I have a feeling Prisma is the Mongo for ORMs: traction trough marketing budget.
@SAsquirtle
@SAsquirtle Жыл бұрын
yeah..
@zzzyyyxxx
@zzzyyyxxx Жыл бұрын
Unlike Mongo, Prisma is actually good.
@Alex-kb2ws
@Alex-kb2ws Жыл бұрын
​@@zzzyyyxxxif it's so good, write a computed field query in prisma
@HalfMonty11
@HalfMonty11 Жыл бұрын
Have you used it? It's not trying to be the fastest ORM in the world. If you want absolute max performance all the time, you don't want an ORM. Hand rolled optimized SQL queries is going to win every time. However, what Prisma is amazing at is great support of the most common relational db types and great tooling that allows you to either work with code first or db first approach, generating your models and client and types for you, reducing how much code you have to write and speeding up your code delivery. 3 cli commands and it'll set up your project for you, and you can just start using the client. It gets you off the ground so easy and the docs are great, usage is intuitive. Stop trying to fit it into what it's not trying to be and you might then appreciate it for what it is. If you are going to take the time to include a dependency, it should bring something to the table and what prisma brings is a massive elimination of code and effort on the developers part. That's worth something.
@zzzyyyxxx
@zzzyyyxxx Жыл бұрын
@@Alex-kb2ws I've literally never had to do that in either Prisma or SQL. If your argument is just, why can't it do something I need in 0.1% of scenarios, then, that's the exception that proves the rule.
@lilililliilil
@lilililliilil Жыл бұрын
still it takes about 3~5 seconds at start. so annoying. thinking to move to Drizzle
@TurtleKwitty
@TurtleKwitty Жыл бұрын
Prisma half works with postgres, if they did properly there would be 0 reasons to use mongo, post handles json internally and a TON of features on top of everything mongo has but prisma hides it. The number of fucking times ive had my backend/DB engineer say postgres sucks cause it doesnt handle XYZ but its just prisma hiding that it does is wild
@huge_letters
@huge_letters Жыл бұрын
is it prisma's fault a lotta people jump to MongoDB as their first option when they need a db instead of postres or mysql?
@TurtleKwitty
@TurtleKwitty Жыл бұрын
​@@huge_letters Prismas fault people go to mongo first? no. Prismas fualt that people don't see there is so much strong tooling in other DBs because prisma is pushed so hard as /the/ single way to access a DB? yes.
@huge_letters
@huge_letters Жыл бұрын
@@TurtleKwitty I guess but isn't orm supposed to be for dummies? I'm a dummy and use an orm cause it's easy for me - if you're a db engineer you should know SQL and it's tooling. At least that's the way I see it
@TurtleKwitty
@TurtleKwitty Жыл бұрын
@@huge_letters you'd think so but so often people just get comfortable in a specific tool/library and don't want to branch out. Orm in and of itself isn't for dummies just better DX, some are more simple some are more complex, some have a simple initial interface but still give access to the full complexity when you need it; that last point (that Prisma doesn't do) is exactly the problem I have with Prisma, they went with simple then became the defacto tool so now people are kinda stuck with surface level tooling. It would be a fairly easy solve, just learn to use the db directly but (personal theory) react is pushed so hard as the defacto webdev framework and is unusable without a ton of wrappers and libraries that webdevs engrained in react especially are hard stuck thinking that is there isn't a wrapper to make things usable you just can't use it at all.
@yojou3695
@yojou3695 Жыл бұрын
it's amazing how people in javascript world STILL havent figured out a half decent orm
@MegaMech
@MegaMech Жыл бұрын
I had this on 1.75 speed by default when the video started. Would have been funny if the editor had edited like that as a joke.
@renatocron
@renatocron Жыл бұрын
so, i'm here, 15:05, din't watch no further (and i didn't had a chance to watch the previous episode you talked about), and I'm also interested in how prisma will deal with join and/or competition (hi drizzle). I like the ideia that some queries can be optimized with joins (most of then can, indeed), the real issue is, how to break down the queries into smaller queries without the database feedback, because, if you follow perl/DBIC way to remap/change the query order by to met the query spec, then you potentially get back many many rows, wasting CPU (and in the AWS, bad yet, bandwidth!). So, over simple queries this is already solved by current prisma engine (eg: load all posts with created by (author name+date), updated by(author name+date), if the author repeat in many, the author only get retured once). Exploring more into the more specialized queries, trying new solutions, that depends heavily in the use case, you can change joins by JSON queires or functions that return stable objects (so can be cache inside one transaction in read committed, assuming that this is the most used tx mode) also can lead to moving the load from the process (nodejs:rust-prisma-bind/distributed) to the (most of the time much more expensive aurora/rds) database. So. it's not simple. Prisma can be better, but's not an easy or clear solution to go towards
@zaneearldufour
@zaneearldufour Жыл бұрын
There's a third party python client for Prisma that is awesome. That's all I know
@johnychinese
@johnychinese Жыл бұрын
What a name Got me there😂
@jdal21
@jdal21 Жыл бұрын
Sticking with Drizzle though
@unersame8253
@unersame8253 Жыл бұрын
I've been using Prisma since about 2 years ago. I hate it. I'll keep on using it since I hate all ORMs, and it's mainly a skill issue.
@blenderpanzi
@blenderpanzi Жыл бұрын
I don't know what other article this video refers to about the joins (don't see a video from yesterday about the topic) and I don't actually know how Prisma is actually doing it. But if it happens to refer to the include mechanism, of course these are two queries? Like if you query all users born after a certain date and all their files: prisma.user.findMany({ where: { birthdate: { ge: date } }, include: { files: true } }) I assume it will do these SQL queries (like many other ORMs do too): SELECT * FROM user WHERE birthdate >= ?; SELECT * FROM file WHERE user_id IN (?); Where the ? in the second query is the list of user IDs returned in the first query. If it would do this instead: SELECT * FROM user LEFT JOIN file ON user.id = file.user_id WHERE birthdate >= ?; Yes, it would be one query, but it would duplicate all fields of user for each file. That might explode the size of the returned result. If you then have even more includes it would explode the result size exponentially. Don't think that would be good. Don't think that would be what you would write by hand (except when you know the involved joins still keep the result set small, like there are one 3 columns in user and you only have one join). I guess one could have an optimization for when there are only very few columns of user selected and not too many includes, than it could use joins. Again, I haven't checked how Prisma actually does this, but I would assume it happens that way for these reasons. Would you use join in any case?
@Xe054
@Xe054 Жыл бұрын
What does Prime mean when he says he prefers query builders? What are some good examples of them? Does Drizzle fall into that category?
@dima1478
@dima1478 Жыл бұрын
Drizzle is still ORM. ORM interface with the database so that you can OOP instead of writing SQL. Query builders just make writing SQL easier, but there is no abstraction between.
@wchorski
@wchorski Жыл бұрын
wondering about anyone's experience with KeystoneJS. Ive started using it for a year, I think it has a great DX but have a feeling it might turn into a big foot gun
@Yupppi
@Yupppi 10 ай бұрын
Talking about lazy load, why does C++ endlessly yap about "no cost abstractions, you only pay for what you use" and then #include for some single method like printing or one algorithm blasts your code with every single feature from the standard library. You need like a single method from 10 different libraries and suddenly you have 10 full libraries in your short code.
@spamviking8591
@spamviking8591 Жыл бұрын
Is this considered good performance? I was working with a bunch of scrubs on a project written in PHP back in 2017. Since none of them could be trusted to do things properly, I wrote an entire query string based query builder that interpreted db relationships based off of foreign keys that could build a complex query with multi layer joins and apply the permissions before executing the query and still managed to return almost every response in less than 150ms on a MariaDB database.
@nikhiljugdan724
@nikhiljugdan724 Жыл бұрын
And how much time did you spend developing it ?
@spamviking8591
@spamviking8591 Жыл бұрын
@@nikhiljugdan724 a weekend.
@therealestsnake
@therealestsnake Жыл бұрын
Yeah, I don't think I'm going to ever look at Prisma. These graphs look cool and all, but let's just keep it simple, with a simple DB. Why use json? Weird protocol...
@CamembertDave
@CamembertDave Жыл бұрын
Graph Queel, omg I'm dying
@BattleMercy-uf2zy
@BattleMercy-uf2zy Жыл бұрын
15:44 Based.
@oscarmugambi
@oscarmugambi Жыл бұрын
Is there an archive for full length streams? Can't seem to find any on twitch
@SuperDevastetor
@SuperDevastetor Жыл бұрын
Where's the "yesterday's seething article" at?
@MahbuburRahman-uc7np
@MahbuburRahman-uc7np Жыл бұрын
Used Prisma on an internal project at work with SQL server that had about 100,000 records. Table Schema looked something like this: 1. Table A -> Table B -> Table C (arrow means one two many realtionship) One of the queries required that with Select * From Table A we load all realted Table B and Table C rows as well. Its a three table join. Running a simple FindMany to get all Table A rows that was created in the last month would simply fail with too many parameter exception. Our FIX: Moved to .Net Core and never had to look back. All the queries ran just fine, though not fast just becasue how many rows we were pulling in a single query. TLDR, Prisma is only good for small projects not production ready IMO.
@Pandazaar
@Pandazaar Жыл бұрын
prisma is production ready for years already lol
@electrolyteorb
@electrolyteorb Жыл бұрын
​@@Pandazaarproduction ready without JOINs
@UGPepe
@UGPepe Жыл бұрын
these web "technologies" are from the future when the plot of Idiocracy takes place
@xBiggs
@xBiggs Жыл бұрын
I use Prisma a lot and have never had any problems
@andresgutgon
@andresgutgon Жыл бұрын
The thing with not doing joins is a good reason to try Drizzel
@ChillAutos
@ChillAutos Жыл бұрын
Try drizzle with more than 10 tables lol. Shit is painfully slow right now, ts lang server 5-10s to catch up and even crashes.
@Xe054
@Xe054 Жыл бұрын
​@@ChillAutosthanks, this is the kind of thing that people never mention when a hot new technology comes out.
@kubre
@kubre Жыл бұрын
I don't know I hate kinda bcz it keeps me making restart typescript lsp
@FunctionGermany
@FunctionGermany Жыл бұрын
pin the generated client file in your IDE. it's annoying and a workaround, but it helps.
@jaymartinez311
@jaymartinez311 Жыл бұрын
Can somebody tell me how i can just use postgres. No orm’s no abstraction just postgres. Then maybe a package to handle migrations. I know rds for aws maybe with postgres but nothing else?
@thundergabriel
@thundergabriel Жыл бұрын
MORTALS: 🔱Use Graph DB like Neo4j and SHUT UP 🤫
@Nickname863
@Nickname863 Жыл бұрын
As having tried to build (and failed to do so) many c++ projects that use vcpkg in the last few days. I now understand why c++ isn't the dependency hell that javascript can be at times. Every single dependency in c++ is a big pain factor. Not that relevant to the video but i heard the word dependency and needed to vent my frustration.
@misterchief5378
@misterchief5378 Жыл бұрын
So, by making the integration of each package something that takes attention and lots of effort, c++ without package managers avoids dependency hell?
@Nickname863
@Nickname863 Жыл бұрын
@@misterchief5378 It is a different kind of hell. But there is no left pad :P
@indiesigi7807
@indiesigi7807 Жыл бұрын
I mostly just need ssl and mariadb the rest is usually up to me to implement and if i need anything else i can build and link it cause everything is a c lib anyway. Those libs are almost always in my systems package manager. I'm not waiting on some proprietary package manager to get locked into.
@SimonBuchanNz
@SimonBuchanNz Жыл бұрын
JSON wire protocol is probably about avoiding JIT time? AWS lambda has spectacularly terrible CPU, to the point that i could absolutely expect 1MB of source could take 1s to start.
@devmesh5340
@devmesh5340 Жыл бұрын
Dungeon what?😂😂
@austincodes
@austincodes Жыл бұрын
Everyone knows Jason is super fast
@jesper.ordrup
@jesper.ordrup Жыл бұрын
Prisma needs to solve the lack of true join. I suggest they open source the specific database drivers to allow more eyes/more experts/use communities knowledge.
@Dev-Siri
@Dev-Siri Жыл бұрын
"Ru$t"
@bartek...
@bartek... Жыл бұрын
Is that another first comment?
@ThePrimeTimeagen
@ThePrimeTimeagen Жыл бұрын
Probably
@electrolyteorb
@electrolyteorb Жыл бұрын
Prisma is Sht
@khazixfangirl6087
@khazixfangirl6087 Жыл бұрын
Hi I'm a comment
@wilsonwilson137
@wilsonwilson137 Жыл бұрын
😢
@Dev-Siri
@Dev-Siri Жыл бұрын
aren't you json?
@greendsnow
@greendsnow Жыл бұрын
Drizzle is still better.
@FeLiNe418
@FeLiNe418 Жыл бұрын
Just use spring boot
@dacam29
@dacam29 Жыл бұрын
Spring Bootstrap?
@CuteTechGuy
@CuteTechGuy Жыл бұрын
Third...
@KhaUh
@KhaUh Жыл бұрын
first comment
@raghavgohil2004
@raghavgohil2004 Жыл бұрын
FIrst
Tailwind Is Ugly Code But....
10:50
ThePrimeTime
Рет қаралды 97 М.
$400,000,000 Saved - NO MORE AWS
23:07
ThePrimeTime
Рет қаралды 225 М.
Turn Off the Vacum And Sit Back and Laugh 🤣
00:34
SKITSFUL
Рет қаралды 4,9 МЛН
Real Man relocate to Remote Controlled Car 👨🏻➡️🚙🕹️ #builderc
00:24
Hardest Part of Software | Prime Reacts
22:21
ThePrimeTime
Рет қаралды 57 М.
Migration Lesson: Don't Use Prisma | Prime Reacts
29:16
ThePrimeTime
Рет қаралды 159 М.
Drizzle vs Prisma: Which ORM is right for YOU?
5:59
Kodaps Academy
Рет қаралды 10 М.
The Truth About HTMX
12:27
Theo - t3․gg
Рет қаралды 173 М.
DONT USE AN ORM | Prime Reacts
25:46
ThePrimeTime
Рет қаралды 238 М.
Null-ls IS BEING ARCHIVED | Prime Reacts
32:02
ThePrimeTime
Рет қаралды 92 М.
That's It, I'm Done With Serverless*
23:58
Theo - t3․gg
Рет қаралды 205 М.
STOP Using Classes In JavaScript | Prime Reacts
14:02
ThePrimeTime
Рет қаралды 249 М.
Be An Engineer, Not A Frameworker | Prime Reacts
27:14
ThePrimeTime
Рет қаралды 401 М.
David Crawshaw   SQLite and Go
32:03
Go Northwest
Рет қаралды 37 М.
Turn Off the Vacum And Sit Back and Laugh 🤣
00:34
SKITSFUL
Рет қаралды 4,9 МЛН