Protobuf
Protocol Buffers
, or Protobuf
, is a free and Open Source Cross-Platform data format used to serialize structured data. It is useful in developing programs to communicate with each other over a Network or for storing data. Protobuf
is more compact and Performant than REST.
Proto Files
Protocol Buffers
comes with its own DSL to describe the structure of data, called Proto
files.
There are two Proto
versions: proto2
and proto3
. These two versions are wire-compatible, but the DSLs are only compatible to some extend.
Code Generation
Protobuf
also comes with its own source code generator (Protoc
) which can generate source code from Proto
files into several languages, that can subsequently be used to serialize, deserialize, and stream the structured data.
The code generator also comes with an API that can be used to create your own code generator. The API provides an interface to every aspect of the DSL up to the comments. There is basically no limit to how this API can be used. One could:
- generate source code for Programming Languages that are not natively supported,
- generate your own code, differently from how
Protoc
does it, - use the declarations in the DSL to configure a Messaging platform, or
- use the DSL to generate documentation.