Hands On System Design - Distributed Systems Implementation

Hands On System Design - Distributed Systems Implementation

Hands On Production-grade distributed log platform — Build LogStream (Java/Spring boot)

Day 16: Implement Protocol Buffers for Efficient Binary Serialization

Nov 25, 2025
∙ Paid

What We’re Building Today

Today we implement Protocol Buffers (protobuf) as a high-performance alternative to JSON serialization in our distributed log processing system. By the end of this lesson, you’ll have:

  • Binary serialization layer reducing message size by 60-80% compared to JSON

  • Type-safe schema definitions with automatic code generation for producers and consumersS

  • Backward and forward compatibility mechanisms enabling zero-downtime deployments

  • Performance benchmarking framework demonstrating measurable throughput improvements

  • Dual-format support allowing JSON and protobuf endpoints to coexist during migration


Why This Matters: The Serialization Tax at Scale

At 10,000 requests per second, serialization overhead becomes your bottleneck. Netflix processes billions of events daily across their microservices architecture. When they migrated critical paths from JSON to protobuf, they saw 3-5x throughput improvements and 70% reduction in network bandwidth. The smaller message size meant fewer network packets, lower latency, and reduced infrastructure costs.

The choice between JSON and binary formats represents a fundamental trade-off in distributed systems: developer ergonomics versus runtime efficiency. JSON’s human-readable format makes debugging straightforward but wastes bytes on structural overhead. Every field name is transmitted with every message. At scale, this redundancy becomes expensive.

Protobuf inverts this equation. Schema definitions live in .proto files, compiled into efficient accessor code. Messages transmit only field values with minimal metadata. The schema evolution capabilities—adding optional fields, deprecating old ones—enable rolling deployments without coordination. This is why gRPC, Google’s RPC framework powering their internal infrastructure, chose protobuf as its serialization layer.

User's avatar

Continue reading this post for free, courtesy of System Design Course.

Or purchase a paid subscription.
© 2026 Systemdr, Inc. · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture