MessagePack contains field names in encoding, hence larger payload
Thrift, Protocol Buffers have schema and code generation and do not contain literal field names in the encoding, instead field tags are used
Avro uses Avro IDL (Interface Definition Language) and JSON Schema, and do not contain field tags in the encoding
Avro is more compact than Thrift and Protocol Buffers
Benefits of Schema based Binary encoding
Thrift, Protocol Buffers and Avro are much more compact than JSON/XML Based Binary variants
The schema is valuable form of documentation
Schema helps to check backward/forward compatibility
Schema enable code generation in statically typed languages providing type checking at compile time
Evolution
Compatibility
It is relationship between one process that encodes the data and another process that decodes it
Backward Compatibility
New code can read older data
New reader schema, Old writer schema
Forward Compatibility
Old code can read newer data
Old reader schema, New writer schema
Many services need to support rolling upgrades where a new version of a service is gradually deployed to few nodes at a time, rather than deploying to all nodes simultaneously
Forward and Backward Compatibility is important in such scenario
Versioning
REST API generally uses version number in the URL or in the HTTP Accept header
API keys can also identify the client’s requested version