Maximum size
Try to serialize a Protobuf message past 2 GiB, and it just won't happen. The format's byte lengths and offsets are encoded as 32-bit signed integers, and that ceiling is baked into the wire format itself, not a setting you can raise. Cross it, and a standard parser throws an overflow error and refuses to read the payload.
Practical sizes
Keep a message under 1 MB, and you're in the sweet spot in practice, even though the official recommendation only asks for a few megabytes. Protobuf was built for small, fast payloads, not sprawling ones.
Push past 10 MB, and the CPU and memory cost of parsing becomes hard to ignore. For moving large datasets, the standard pattern is to chunk the data into a stream of smaller messages.
Whole-message parsing
Deserialize a Protobuf payload, and the parser doesn't stop until it has read the entire binary stream and built a complete object graph in memory. That's the whole design. Protobuf expects a message to load in one shot, not spread across multiple reads.
That in-memory copy is bigger than the wire bytes, sometimes a lot bigger. Pointers, object overhead, padding on your data structures, it all adds up, and memory usage can land at several times the size of the original payload. Most serialization formats work this way. Protobuf is no exception.
Further Reading
- Protobuf Tip #2: Compress your Protos!
Wire size tradeoffs matter less than they used to; compression is everywhere.
Next
Descriptors
A schema compiled into Protobuf data. Descriptors are what reflection, dynamic decoding, and breaking-change detection read.