gRPC
Định nghĩa
gRPC là API protocol hiệu năng cao dùng Protocol Buffers làm schema/binary serialization và chạy trên HTTP/2.
Cách hiểu bằng lời của tôi
gRPC hợp với service-to-service hơn public web API: payload nhỏ, parse nhanh, codegen rõ contract, HTTP/2 multiplexing và streaming tốt. Đổi lại browser support và debug thủ công kém hơn REST JSON.
Khi dùng
- Microservices nội bộ cần latency thấp.
- Cần strict typing và generated client/server stubs.
- Cần unary, server streaming, client streaming hoặc bidirectional streaming.