gRPC vs GraphQL vs REST? What's the best API Technology for Golang?

  Рет қаралды 25,570

Mario Carrion

Mario Carrion

Күн бұрын

Пікірлер: 43
@MarioCarrion
@MarioCarrion 2 жыл бұрын
*Blog* mariocarrion.com/ *Software Architecture and System Design in Go* kzbin.info/aero/PL7yAAGMOat_GCd12Lrv_evJ3Zhv1dl8B- *All playlists* kzbin.infoplaylists *Keep it up!*
@benisrood
@benisrood Жыл бұрын
Completely agree with these pros & cons. People shouldn't underestimate just *how* much more expensive it can be to implement GraphQL, by the way, if you are doing anything at all complex and custom in your backend (i.e. not just reading from a database). It makes the problem of overfetching in REST very small by comparison. I would say, as a general rule, try to make REST work first.
@fruedal
@fruedal 2 жыл бұрын
Most underrated Go channel (see what I did there?) out there, amazing work Mario. Is there a way we can support your work?
@MarioCarrion
@MarioCarrion 2 жыл бұрын
Thanks Felipe, I think sharing it could be a nice way to support the channel, take care!
@kalmecakrc
@kalmecakrc 2 жыл бұрын
Me gusta como explicas, muy claro, seguiré viendo tus videos, gracias!!!
@yo_mono
@yo_mono 2 жыл бұрын
This is great information, beyond the scope of Golang actually. Thanks!
@MarioCarrion
@MarioCarrion 2 жыл бұрын
Thanks for watching Cristian, I'm glad it was useful.
@AbhishekRanaGuitar
@AbhishekRanaGuitar 2 жыл бұрын
Very clear and precise!
@arganaphangquestian4775
@arganaphangquestian4775 2 жыл бұрын
Awesome video as always!
@MarioCarrion
@MarioCarrion 2 жыл бұрын
Thanks Argana! Cheers
@littlevintagelady
@littlevintagelady 2 жыл бұрын
Thanks for creating this video, very clear explanation and easy to understand. Helps me as a product person to know better
@MarioCarrion
@MarioCarrion 2 жыл бұрын
I'm glad you found the video useful, take care.
@mateicheles4449
@mateicheles4449 Жыл бұрын
Regarding the under-fetching con in REST, you can just apply filters on a list endpoint and get only the permissions, w/o other users' details. sure, it's still a loop in your logic, but another endpoint like /users/{userId}/permissions to hit in each loop iteration is not really necessary.
@MarioCarrion
@MarioCarrion Жыл бұрын
Yes you can do that, but like you said that extra logic now lives on the backend side; if the goal is to dynamically get some fields over others, then why even considering REST in the first place? Go the down the GraphQL route instead. There are tradeoffs either way with whatever decision we make anyways.
@koro2467
@koro2467 2 жыл бұрын
thank you for sharing this information
@MarioCarrion
@MarioCarrion 2 жыл бұрын
Thank you for watching, take care
@jerryevarts9292
@jerryevarts9292 2 жыл бұрын
Nice recap! Thank you
@MarioCarrion
@MarioCarrion 2 жыл бұрын
Thanks for stopping by Jerry. Take care!
@ruizdani3016
@ruizdani3016 2 жыл бұрын
estoy confundido necesito consultar una db dgrpah con go, y tanta documentacion me dejo mas confundido donde puedo ir puntualmente para hacer esa gestion?
@Peter-xn9bk
@Peter-xn9bk 2 жыл бұрын
Thank you Mario. It's amazing video.
@MarioCarrion
@MarioCarrion 2 жыл бұрын
Thanks for watching, cheers!
@yiyao1522
@yiyao1522 Жыл бұрын
Worked at a company where we moved all our internal endpoints to gRPC, because the staff engineer that proposed it wants our backend communication protocol because it is language agnostic while our whole backend stack is written Java or in the process of migrating to Java. The engineer that proposed it got a promotion while the migration to gRPC provided no business and engineering value other than costing the company millions in lost engineering hours.
@MarioCarrion
@MarioCarrion Жыл бұрын
Being language agnostic is a nice feature, but the actual *practical* benefit when using gRPC (and really Protocol Buffers) is low latency and performance, so if there was no performance problem with your internal endpoints (assuming you mean east-west communication), then it makes no sense to change what you had at all.
@yiyao1522
@yiyao1522 Жыл бұрын
@@MarioCarrion Rest is actually language agnostic as well, because the payload is in JSON we can serialize/deserialize in any language and there are many libraries in most languages that does that. And I don't see much performance gains in real world scenarios, because a big portion of latency in real world systems is caused by inter service communication and i/o operations on databases. The performance advantage of gRPC is mainly that it serialize/deserialize faster than JSON, but if there is a JSON library that serialize as fast as gRPC then gRPC's performance advantage diminishes.
@MarioCarrion
@MarioCarrion Жыл бұрын
For the most part, I agree with you. Ultimately, I will consider using gRPC **if** an internal service is requested millions of times per minute. Otherwise, JSON over HTTP is more than enough.
@yiyao1522
@yiyao1522 Жыл бұрын
@@MarioCarrion At one of my previous companies we had millions of backend requests per minute and were quite performant and no latency issues. We implemented good strategies like caching, reduce the number redundent downstream network calls, had a performant backend framework that utilized asynchronous multithreading, and a performant json serialization library. There is more performance gain making those changes than the choice of network communication protocol.
@0xcBenevolent
@0xcBenevolent 2 жыл бұрын
Hey Mario you explain so nicely. Alright, I have a question. I want to build an app that will be having user profiles, calling features, geo-fencing, geo-tagging, voice & photo sharing(ephemeral) and a bit of social features. Could you tell me what backend programmer should I hire? Because right now, I do have a Golang programmer who works with GRPC as well as a NodeJS developer and he works with Appsync(GraphQL). Also, I do have an iOS developer who can connect the final endpoints to the Xcode using Swift once the backend is ready. I really would like to take the serverless approach this is why AWS Lambda fits well to me but a GRPC needs an active server hence it can not be used with Lambda. Could you tell me which programmer would be best at my case for building the app logic, business logic and the complete backend. Please do reply. Thanks.
@MarioCarrion
@MarioCarrion 2 жыл бұрын
Hello Alysha, I think you are already answering your question. If your goal is to build what it looks like like a mobile app using Lambdas, then GraphQL sounds like the better choice because of the pros, regarding what programmer to hire, I don't know, I think that's something you should decide and depends on their experience and/or willingness to learn/use something that they may not know yet.
@I3ull37
@I3ull37 2 жыл бұрын
What about gRPC-Web for Frontend to Backend gRPC use tho?
@MarioCarrion
@MarioCarrion 2 жыл бұрын
Yes, that is the way to use browser clients to talk to gRPC Backends; I should made it clearer because I didn't mean it wasn't possible but more like it requires an extra step. Best!
@kamalkamals
@kamalkamals Жыл бұрын
graphql with golang is extremely hard and complicate and cannot understand the world of golang is weak on this part, then most of plugins use schema first not code first like "graphql-go", and for my personal experience until now upload file with graphql not working in golang
@liftingisfun2350
@liftingisfun2350 2 жыл бұрын
Thanks for making this, good information and easy to digest
@MarioCarrion
@MarioCarrion 2 жыл бұрын
Thanks I'm glad you found it useful. Cheers
@liftingisfun2350
@liftingisfun2350 2 жыл бұрын
@@MarioCarrion whatever kid
@Jam.S.
@Jam.S. 2 жыл бұрын
What do you mean by mutations here?
@MarioCarrion
@MarioCarrion 2 жыл бұрын
In GraphQL Mutations define the possible actions used to modify values: Create, Update and Delete actions basically.
@prashlovessamosa
@prashlovessamosa Жыл бұрын
Thanks
@MarioCarrion
@MarioCarrion Жыл бұрын
Thanks for watching! Take care
@0xc0ffee_
@0xc0ffee_ Жыл бұрын
Only one thing to change about your else beautiful explanation: GraphQL is very inefficient performance wise. By many points of view. It also has very annoying N+1 problems that are not that easy to solve sometimes
@Alfrednohike9909
@Alfrednohike9909 10 ай бұрын
dataloader is the solution most of the time
@lesliestandifer
@lesliestandifer 2 жыл бұрын
PATCH
@abgthscode6326
@abgthscode6326 Жыл бұрын
I'm sorry, but your pronunciation is confusing.
@MarioCarrion
@MarioCarrion Жыл бұрын
Make sure you enable closed captioning, it typically works
REST, gRPC, or GraphQL: Which Should You Use?
13:17
Gui Ferreira
Рет қаралды 4,1 М.
JISOO - ‘꽃(FLOWER)’ M/V
3:05
BLACKPINK
Рет қаралды 137 МЛН
tRPC, gRPC, GraphQL or REST: when to use what?
10:46
Software Developer Diaries
Рет қаралды 91 М.
Where should you use gRPC? And where NOT to use it!
10:57
CodeOpinion
Рет қаралды 87 М.
Transactions in context values in Golang, is it OK? r/golang
15:57
Mario Carrion
Рет қаралды 3,3 М.
2024 gRPC Golang Tutorial - The tutorial I wish I had when I was learning
32:10
When RESTful architecture isn't enough...
21:02
Dreams of Code
Рет қаралды 285 М.
Microservices are Technical Debt
31:59
NeetCodeIO
Рет қаралды 686 М.
GraphQL, tRPC, REST and more - Pick Your Poison
17:12
Theo - t3․gg
Рет қаралды 109 М.
REST vs RPC vs GraphQL API - How do I pick the right API paradigm?
15:36
Is tRPC The End Of REST/GraphQL?
13:48
Web Dev Simplified
Рет қаралды 138 М.