Define a minimal proto contract
Create a .proto file with one unary RPC (CreateNote), request/response messages, and correct field numbers. Generate stubs for one language of your choice.
Backend & Runtime / Knowledge library
high-performance rpc over http/2 with protobuf
gRPC provides fast, strongly-typed service-to-service communication with code generation, streaming, deadlines, and consistent contracts across languages. It reduces API drift and boilerplate compared with ad-hoc HTTP JSON patterns.
gRPC was open-sourced by Google in 2015, inspired by its internal Stubby RPC system. It standardized on Protocol Buffers (proto3) for compact, schema-first messages. HTTP/2 features (multiplexing, headers compression, streaming) enabled low-latency RPC. Ecosystem growth added many languages, interceptors, load balancing, and observability support. gRPC-Web emerged to connect browser apps to gRPC backends through compatible proxies.
Work through these exercises in order. Try the task before opening a reference.
Create a .proto file with one unary RPC (CreateNote), request/response messages, and correct field numbers. Generate stubs for one language of your choice.
Implement a client call with a 1-second deadline. On timeout, return DEADLINE_EXCEEDED handling and a user-friendly fallback message.
Build a backend with one unary RPC and one server-streaming RPC. Add an interceptor for request logging and include at least one unit test for each RPC.
Add TLS, health checks, and reflection to a small gRPC service. Verify behavior with grpcurl and document one failure scenario and recovery path.
Expose a gRPC service to browser clients using gRPC-Web through Envoy. Demonstrate one request from a web page and one from a native gRPC client.
A global retail chain managing thousands of localized inventory databases that must synchronize stock levels with a central order management system.
The existing REST-based architecture relies on JSON serialization and standard HTTP/1.1, causing significant latency and high CPU overhead during peak shopping hours when thousands of concurrent inventory updates occur.
gRPC utilizes Protocol Buffers for binary serialization and HTTP/2 for multiplexing, allowing the central order management system to maintain persistent, low-latency streams with regional inventory nodes, effectively reducing the overhead of repeated connection handshakes.
This diagram illustrates the flow of inventory data from regional nodes to the central management system via gRPC channels.
Local inventory database
HTTP/2 persistent connection
Order management service
Binary serialization format
The system achieves more consistent data propagation across regions with reduced network bandwidth consumption and lower server-side processing requirements.
gRPC requires both client and server to support HTTP/2, which can complicate integration with legacy load balancers or firewalls that only inspect HTTP/1.1 traffic. To check for this, monitor for connection reset errors or failed handshake attempts at the network perimeter.