MessagePack-Spezifikation
MessagePack ist ein efficient binary serialization formatieren, wie ein compact JSON mit typed Werte.
Encoding Scheme
MessagePack uses a type-prefix byte to indicate the type and sometimes the length. Small integers, booleans, and nil have single-byte encodings. Strings, arrays, and maps use length-prefixed encoding with compact forms for small sizes. Binary data is natively supported without base64 encoding. The format is not self-describing, requiring a schema or out-of-band type knowledge.
- type prefix
- First byte indicates type
- native binary
- No base64 needed
- not self-describing
- Needs schema
compact forms bin type smaller than CBOR Performance and Use
MessagePack is faster and smaller than JSON for most data. It is widely used in RPC frameworks (gRPC alternatives, Redis). The format supports extension types for application-specific data. Schema evolution requires care as field types are not self-describing. Libraries are available for 50+ languages with mature implementations. MessagePack is a strong choice for high-performance serialization.
- speed
- Faster than JSON
- size
- Smaller than JSON
- RPC
- Used in messaging
less parsing compact ints Redis, Thrift