📄Protocol Buffers (Protobuf)
Also known as Protobuf, .proto File, Google Protocol Buffers
A compact way to send data as bytes. It is smaller and faster than JSON.
Think of it like
Think of it like a numbered order form. You write 1 for the name and 2 for the age, so it stays short.
Example
Two services in an online shop talk thousands of times a second. They send Protobuf, so each message is small and quick to read.
Why it matters
Definition
Example code
protobuf
message Person {
string name = 1;
int32 age = 2;
}Common mistake
Key takeaways
- 1Schema first. You describe the data in a .proto file.
- 2Made code. A tool writes the packing code for you.
- 3Small and fast. Bytes, not text people can read.