System Design
2. Networking FundamentalsAnimated
gRPC
Fast binary RPC over HTTP/2 with typed contracts.
The idea
gRPC uses Protocol Buffers for compact messages and generated clients, with streaming support.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- current message
- earlier
- failure or attack
A generated stub serialises the call to compact binary.
- step:
- 1/4
- from:
- Client stub
- to:
- gRPC server
1/4
Time runs downward. Solid arrows are requests, dashed arrows are replies.
Step by step
- 1Define a service in a .proto file
- 2Generate client and server code
- 3Call a method like a local function
- 4Messages travel as binary over HTTP/2
Where it is used
Service-to-service calls.
Watch out for
Hard to call directly from browsers without a proxy.