System Design
10. API Design and ManagementAnimated
gRPC API Design
Typed RPC contracts in Protocol Buffers.
The idea
Define services and messages in .proto, generate code, and use streaming for large flows.
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
- 1Write the .proto
- 2Generate stubs
- 3Implement the server
- 4Clients call methods
Where it is used
Internal microservices.
Watch out for
Evolve fields carefully: never reuse field numbers.