gRPC is a google implementation of remote procedure call
When you are creating micro web services you need to think about:
API
Data format ( json, xml, binary )
End point format ( e.g. GET /api/v1/user/123/post/456 or POST /api/v1/user/123/post)
Error patterns
Load Balancing
Latency
Scalability
Operability with different languages
Authentication
Logging
This is complicated and time consuming
gRPC allows us to define requests and response for RPC (Remote Procedure Calls) and it handles everything else for you.
Additional features:
It is built on top of HTTP/2
It is fast and efficient
Supports streaming
Is language independent
Easy to plug in authentication, load balancing, loggin and monitoring
On the client it looks like you are directly calling a function on the server:
Server code:
def createUser( User user ) {
}
Client code:
server.createUser( user )
Steps to get this working:
Define message and services using Protobuf
Then use a compiler to generate the code. A client stub is generated which you can use to call the server code. You will need to implement the server service code.
This not to disimilar to CORBA but is much easier to use.
The proto struct schema definition looks like:
Back: Overview of Tech
Page Author: JD