gRPC and Protocol Buffers have been available since 2015. In 2020 they are increasingly common in enterprise microservices architectures for internal service communication.

The serialisation performance case

JSON serialisation and deserialisation is CPU-intensive for high-frequency service calls. Protocol Buffers (binary, strongly typed) produces smaller payloads and deserialises faster than JSON by a significant margin, benchmarks typically show 5-10x faster serialisation and 3-5x smaller payload size. For services exchanging millions of messages per hour, the difference is material in CPU costs and network bandwidth.

The contract-first development model

Protobuf .proto files define the API contract: message types, field names, types, and service method signatures. Generating client and server code from .proto files ensures that the contract is the source of truth, not the implementation. A breaking change in the .proto (removing a required field, changing a field type) is caught at code generation time, not at runtime. This is a stronger contract guarantee than OpenAPI code generation, where schema and implementation can drift.

gRPC streaming patterns

gRPC supports four communication patterns: unary (one request, one response), server streaming (one request, stream of responses), client streaming (stream of requests, one response), and bidirectional streaming (both sides stream simultaneously). These patterns enable real-time data feeds, file uploads, and live telemetry with low overhead. REST does not have native equivalents, server-sent events and WebSockets are separate protocols.

The .NET gRPC ecosystem

ASP.NET Core has first-class gRPC support via the Grpc.AspNetCore package. The grpc-dotnet library provides both server and client implementations in fully managed .NET code (no native gRPC binary dependency). The code generation tooling (protoc with the grpc_csharp_plugin or the Google.Protobuf NuGet package) generates strongly typed C# code from .proto files. gRPC-Web support allows gRPC services to be consumed from browsers via a proxy.