4 ms·
No, a bit upper layer. You need to handle error codes, request and response parameters, naming for the API etc. Imagine having API with 100+ endpoints. How do
by divan 3y ago
No, a bit upper layer. You need to handle error codes, request and response parameters, naming for the API etc.
Imagine having API with 100+ endpoints. How do you add another one in gRPC? You edit .proto file and run codegenerator, which creates stub code for clients and server. You just need to connect that code to the rest of your app (say, talk to database here or display the response on the screen here). You don't write actual code for the network part.
With traditional HTTP/REST/JSON approach you would have to write handlers yourself for each codebase separately.
And there is no way to make sure they're in sync – only on organizational level (by static checks, four-eyes policies and such). I know it doesn't sound too big of a deal because most people used to it, but gRPC gives a different experience. Hence my initial comment that it's so much easier to work with.