Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

IDIEP-75
Author
Sponsor
Created

  

Status

Status
colour

Grey

Green
title

DRAFT

ACTIVE


Table of Contents

Motivation

...

NameCommentsLicense
MessagePack
  • Schemaless binary format.
  • Compatible with JSON (can be directly converted convert to JSON and from JSON: an important use case)
  • The most popular among all. High-performance, well-maintained implementations exist for many languages.
  • Battle tested: used by Tarantool and Redis
Java: Apache 2.0, C#: MIT, C++: MIT (nlohmann/json), Python: Apache 2.0, JavaScript: MIT, PHP: MIT
CBOR
  • Based on MessagePack.
  • Less popular than MessagePack, fewer implementations, outdated PHP implementation.
  • Standardized (RFC7049), but MessagePack is simpler.
  • Included in stdlib in .NET 5.
  • "Use MsgPack instead of CBOR":  https://diziet.dreamwidth.org/6568.html
Java: Apache 2.0, C#: CC0, C++: MIT, Python: MIT, JavaScript: MIT, PHP: PHP License
FlexBuffers
  • "Schemaless cousin of Google's FlatBuffers". Can be accessed without parsing, copying, or allocation.
  • Can't serialize arbitrary objects at this point (in Java and C#)
  • Relatively new, has not gained traction

BSONDesigned for MongoDB storage and in-memory manipupation, not for network usage => more verbose than MessagePack/CBOR
UBJSONSeems to be abandoned, implementations (e.g. C#) are not maintained

...

  1. There is no true random access to fields by name in MsgPack - offsets are not stored, values are written sequentially. Though it is possible to skip values without reading them.
  2. Some types, like UUID and date/time, will require custom handling (e.g. UUID is written as string by default, which is not optimal). MsgPack allows up to 128 custom types to be defined.
  3. To be able to read user objects separately and efficiently without deserializing them (e.g. key and value in put operation), we'll have to wrap them one of the following ways:
    1. As a byte array (MsgPack bin format) - "MsgPack within MsgPack".
    2. Custom MsgPack type with size in the header

Discussion Links

...

Reference Links

...