← Lessons

quiz vs the machine

Platinum1750

System Design

gRPC and Protobuf

A binary contract first RPC framework built for fast, typed service to service calls.

5 min read · advanced · beat Platinum to climb

A contract first approach

gRPC is a remote procedure call framework where you call a method on a remote service as if it were local. The contract is written first in a protobuf schema that defines messages and service methods, and code is generated for both sides from it.

Why it is fast

  • Protobuf serializes to a compact binary format, smaller and quicker to parse than text.
  • It runs over HTTP 2, enabling multiplexed streams over one connection.
  • It supports streaming: server, client, and bidirectional streams, not just one shot calls.

Trade offs to weigh

  • The binary wire format is not human readable, so debugging needs tooling.
  • Browser support is limited without a proxy layer.
  • It shines for internal service to service traffic where performance and a strict typed contract matter most.

Generated stubs keep both ends in sync with the schema, so a field change surfaces as a compile error rather than a runtime surprise.

Key idea

gRPC uses a protobuf contract over HTTP 2 for fast typed streaming RPC, ideal for internal service to service calls.

Check yourself

Answer to earn rating on the learn ladder.

1. Why is gRPC typically faster on the wire than text based REST?

2. Where does gRPC fit best?