gRPC
Looking for magic 🪄
gRPC Remote Procedure Call
or Generic Remote Procedure Call
or Golden Retriever PanCakes [1]
It’s an RPC framework developed by Google
But no one knows what the G stands for, it’s a mystery.
[1] https://www.youtube.com/watch?v=njC24ts24Pg (YT @grpcio)
What is RPC?
Using HTTP as transport
IDL - Interface description language
Protocol Buffers is many things:
Generated code
Why care about the protocol?
… if it just works?
gRPC works
… until it doesn’t
Trailer headers
Part of HTTP/2 specification, allowing sending extra info after body
Unsupported by any browser
Crucial feature for gRPC
gRPC Status
HTTP/2 response is always OK,�200 OK.
New numeric table to learn:�https://grpc.io/docs/guides/status-codes/
Lucky 13 is new 500
gRPC Request
Always POST
URL defines package, service and called method
encoding agnostic
5 byte prefix:
gRPC Response
Shit hits the fan
Number and string,
can you handle it?
gOOGLE RPC Status
Protocol Buffers briefly
serialization data format for structured format
primary binary format, not self-describing
alternatively, canonical JSON format, ProtoJSON
Defined in .proto files, extendible IDL
Code generated by protoc
Have you noticed any magic?
gRPC summary:
🎩 The magic is HTTP/2 🎩