tRPC, gRPC, GraphQL or REST: when to use what?

preview_player
Показать описание
In this video I'm explaining how tRPC, gRPC, GraphQL and REST APIs work, how to choose the right one and common best practices and pitfalls.

======⚡⚡⚡======
======⚡⚡⚡======

📚 Resources:

And don't forget to subscribe for more videos like this 😊
Рекомендации по теме
Комментарии
Автор

finally i understood about how TRPC, GRPC and GRAPHQL works & the concept. great video !

mikhacavin
Автор

Great video. Regarding GraphQL: You still have to write the code to get all the data. I think it should be made clear in the video.

khari_baat
Автор

Not against GraphQL but, in REST you can reques specific fields if you implement filtering (extra parameter for listing the fields you want) and you can get data from other nested resources if you implement extension (extra parameter for listing the objects you want to be extended instead of returning only their Ids). And both patterns can be combined. That also gives you the control on which of those you allow.

Rafa_informatico
Автор

Thanks for the informative video - when describing REST folks often forget about using ODATA REST endpoint which gives you additional features such as selecting the fileds, the number of records (limit) using query string arguments giving you one additional query layer rather than having to create a bunch of rest endoints in a standard way. The ODATA query params syntax is somewhat ugly but there is editor tooling and plugins available. I mention this because although not as granular as using QL it accomplishes alot of the same requirements

fredp
Автор

Cool, thats very clear explanation, thank u

ojklnqr
Автор

i already knew everything but could never have explained it so well. huth ab ;)

axel_huth
Автор

Nice explanation! I think you miss some of the nuances, but that's rather difficult in these short informative videos.

Some remarks I didn't spot in the comments yet:
* If you create an external API, don't use tRPC/gRPC. It's not well enough supported when your users can pick any language they want.
* Schema's can generate code for both the client and server. If you prefer code-first implementations you can usually generate a schema and use that schema to generate typings for the other side (client/server)

LaKoentjuh
Автор

A very clear and succinct video on the pros and cons of using tRPC, gRPC, GraphQL, and REST for client/server communication.

Thank you, Guseyn

{2023-06-28}

Pareshbpatel
Автор

I think he made at least two mistakes in REST and gRPC talks:
1. In REST you do not need to under/over fetch. You can use query params.
2. In gRPC you do not need to use HTTP2. It's also mostly not supposed by reverse proxies, app gateways and so on. Correct me if I'm wrong please.

jeniamtl
Автор

Very good points.
tRPC is awesome but it’s kinda risky to stick with just typescript. Mobile apps (android and iOS) doesn’t support it.
I have built a project with REST api backend and I’m thinking of replacing it with GraphQL. My main concern is the complexity, I guess I can’t have them all XD.

abdulazeez.
Автор

Some treats of all of these methods can be achieved just by breaking the standards of the other. For instance: use POST for reading and include the filter criteria in the body (GET should have a body BTW, this is one reason why I hate REST)

skeletala
Автор

this is awesome please never stop posting

rwrnzcj
Автор

Seems like gRPC carries the least amount of risk. Less complexity than GraphQL, faster and simpler to reason about, and the highest compatibility across all client types. I can’t get myself psyched about GraphQL, after taking a full course on it and completing a couple corporate projects with it. It just doesn’t do much for you. Another set of schemas in your stack, and you still have to do all the heavy lifting on the backend, on requests. It’s not like it eases the burden of querying your data. It’s decent for integrating disparate services, but it comes with weight and complexity.

VincentJenks
Автор

Wow thanks, very well explained! Keep it up you do a great job.

nicolascosmefernandez
Автор

Ive seen geaphql just creat more problems. More glue code, more start services thay cost time, more security concerns. If it only works well when its set up perfectly it's really not gonna work well at many workplaces.

steveaguay
Автор

Can you create videos on microsecice communications with grpc. Best practices and all.

sourishdutta
Автор

> as long as you use it perfectly it will work (paraphrased, about GraphQL)

Strictly speaking this can be said or anything.

marksmith
Автор

U r sooo cool man... Loved it. Just subscribed... thanks. And u are also sooo charming, did u know that? Tnx for the free gem, plz keep up the good work <3

afazeli
Автор

Amazing informative important video !!! You're amazing.

rdegetf
Автор

why i will get all user data in rest ? the way we send fields to fetch in graphql, the same way i can send fields in rest api and obvioulsy api woul be getting data from db and it will get only those fields not all the data, overfetching and underfetching can be easily can be solved in rest like graphql . Any solid reason instead of typechecking to use grqphql over rest ? because overfetching and underfetching is not the reason, we can easily do that in rest also, send field name when requesting and from db only get that field and return ? So please help me to understand it better .

naumanjabbar