|Original author(s)||Sadayuki Furuhashi|
|Written in||Various languages|
Data types and syntax
Data structures processed by MessagePack loosely correspond to those used in JSON format. They consist of the following element types:
- boolean (
- integer (up to 64 bits signed or unsigned)
- floating point numbers (IEEE single/double precision)
- byte array (string or binary data)
- list ("array")
- associative array ("map")
Comparison to other formats
MessagePack is more compact than JSON, but imposes limitations on array and integer sizes. On the other hand, it allows binary data and non UTF-8 encoded strings.
Compared to BSON, MessagePack is more space-efficient. For example, BSON requires zero-byte terminators at the end of all strings and inserts string indexes for list elements, while MessagePack doesn't. Also, MessagePack allows more compact representation of small integers, short lists and associative arrays.
The Protocol Buffers format aims to be compact and is on par with MessagePack. However, while JSON and MessagePack aim to serialize arbitrary data structures with type tags, Protocol Buffers require a schema to define the data types. Protocol Buffers compiler creates boilerplate code in target language to facilitate integration of serialization into the application code; MessagePack returns only dynamically-typed data structure and provides no automatic structure checks.
- "Implementation Projects". Retrieved 28 May 2013.