Infinite Loop

A blog about software engineering, software architecture, distributed systems, cloud computing, and technology leadership.

About

Hi, I'm Vinicius Serpa (or simply Mestre). I'm a staff-level software engineer, currently working as a Systems Architect at Nextpower Inc.

13 September 2025

Understanding gRPC: Google’s High-Performance RPC Framework

by Vinicius Serpa

In the world of distributed systems and microservices, efficient communication between services is critical. That’s where gRPC comes in—a high-performance, open-source Remote Procedure Call (RPC) framework originally developed by Google and now maintained by the Cloud Native Computing Foundation (CNCF).

gRPC is designed to make inter-service communication fast, lightweight, secure, and language-agnostic, making it a powerful tool for modern software architectures.

gRPC boilerplate

This boilerplate covers gRPC implementation and the use of Evans client

Why gRPC?

gRPC shines in scenarios where performance and scalability are key:

Official support includes:

Protocol Buffers (Protobuf)

At the heart of gRPC is Protocol Buffers, a language-neutral, platform-neutral, extensible mechanism for serializing structured data.

Unlike JSON, Protobuf is binary, which means:

JSON (Human-readable) Protocol Buffers (Binary)
Larger payload Smaller payload
Higher CPU usage Lower CPU usage
More network overhead Less network overhead
Slower processing Faster processing

Example .proto Schema

This schema defines the contract between client and server, ensuring both sides understand the structure of the data being exchanged.

syntax = "proto3";

message SearchRequest {
  string query = 1;
  int32 page_number = 2;
  int32 request_per_page = 3;
}

Communication Models with HTTP/2

gRPC uses HTTP/2, which brings several advantages:

gRPC Communication Types

REST vs gRPC comparison

Feature REST gRPC
Data Format JSON / Text Protocol Buffers (Binary)
Communication Unidirectional Bidirectional & Async
Latency Higher Lower
Contract Optional Required (.proto files)
Streaming Support No Yes
Design Constraints Predefined (HTTP verbs) Flexible
Tooling Third-party libs Native + Code Generation
tags: grpc - communication-protocols - distributed-systems - microservices - golang