tRPC: It’s Nothing Like gRPC

preview_player
Показать описание
I'm really tired of people assuming tRPC and gRPC are the same thing because three letters are the same. Hope this helps 😅

Idez killed it w/ this one so make sure he gets some love in the comments

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

YES you CAN use gRPC on client. You probably shouldn’t.

tdotgg
Автор

"Use the technologies for what they are build for and you'll have a much better experience" - a JS dev

nishantmogha
Автор

You can learn so much about trpc, grpc, graphql, REST, ... in a ton of articles, but no one ever explains when to use which and where, and especially why. So, thanks as alawys for your ranty, but valuable videos.

chrisbirkenmaier
Автор

Seriously man, gRPC is far superior also who told you that gRPC for server to server communication only this is totally wrong, gRPC provide clients for every platform native android, native IOS, flutter native desktop and web, also gRPC support most programming languages, unlike tRPC which typescript only.

amirosman
Автор

Saying trpc and gRPC have 'literally nothing to do with each other' is like saying two RDBMSs are completely unrelated. But then again, if Theo had actually explained that, he would've passed up his golden opportunity to play his favorite role: a condescending prick

craig-hfgf
Автор

You are causing confusion by saying http/json and gRPC, gRPC can use HTTP under the hood but without JSON.

bladekiller
Автор

It is not a stupid question if people ask about tRPC vs gRPC; people have doubts and want answers as the terms are very similar. I think your explanation is very good and left this point clear, but please don't call people stupid, as maybe the question was made by kids, junior developers, tech enthusiasts, etc. who just want to learn.

mbs
Автор

Huh? "They have nothing to do with each other"
I think this is wrong. They do have something to do with each other and the comment is a little misleading.
They essentially both make a data struct available. It's just that they have different approaches and different primary use cases.

GRPC - Schema driven struct API, performant data transfer (byte, packed structs) between consumer and server . One defines the protobuff file to bind the server and consumer implementations
TRPC - Code driven struct API, data transfer between consume and server (struct api made available locally). One defines code first in the server and is bound by TS structs in the consumer. You could totally make TRPC's generated types publicly available and have data.

and theres cap'n proto.

ngl this whole thing is confusing

Lantos
Автор

You're wrong about gRPC being for server to server communication only.

tRPC:
Typescript only.
Doesn't use code generation.
Focus only on web apps.
No backward Compatibility.
So Mobile app may break if server code is changed.

gRPC:
Any programming languages.
Uses code generation.
Includes backward Compatibility.

AhmedGubara
Автор

"We are here for dumb questions, not for stupid ones". LOL

Szergej
Автор

i guess the mistake is easy to make granted they both have 'RPC' in their name, maybe the main problem is that most people don't know what 'remote procedure call' is

PandaNuker
Автор

Thanks for the guy who asked that stupid question, now i know the differences and got a great intro to both of them

Thankyou Theo. Very informative

ashuvssut
Автор

I use grpc on the client all the time and I quite like it. I also write clients in more than just JS/Typescript so I don't mind the extra compile step

TheAcademik
Автор

alternatively, you can always communicate through excel spreadsheets over email - I've seen entire companies running like this

proosee
Автор

What a lot of nonsense.

The main difference between gRPC and tRPC is that gRPC is not language dependent. They serve the same (or similar) purposes. Using gRPC in the browser or any other client is not a problem.

Using tRPC between a Rust or Go server isn’t particularly easy.

terjeber
Автор

SQL and json are the language you communicate with db servers with - this is distinct from the protocol they use to communicate - most DBs have their own but some use grpc, thrift, or http

laurentogetatx
Автор

I’m not sure if this video was “more true” a year ago, but today I’m pretty sure gRPC (using http 2) is a good if not better solution than “http/json” for client-to-API communication. I know an insanely competent startup that uses this setup and is very happy with their results. They just generate all their types using a proto file, which they then use to serve their backend GO functions as an http API powered by gRPC, as well as their react-query calls on the frontend.

This seems like an ideal setup tbh. You get the same types on the frontend and backend, while the gRPC simply amounts to a little boilerplate that replaces your “http/json” boilerplate, making it faster and more scalable.

Cuptial-evtb
Автор

what tRPC is: it is an anti-pattern. It breaks ms flexibility in the choice of technology, so you are forced to write the gateways and client in typescript.

MsKATODO
Автор

Problem with tRPC is you're locked with NodeJS. 😵‍💫It probably would've skyrocketed if more languages were supported. New protocol connect-web looks quite promising.

shinebayar
Автор

You could also use TCP directly for inter-service communication instead of HTTP

philipedekobi