[Paper Review] A Survey of JSON-compatible Binary Serialization Specifications
This paper provides a comprehensive survey of JSON-compatible binary serialization specifications, comparing schema-driven (e.g., Protocol Buffers, Avro) and schema-less (e.g., CBOR, MessagePack) formats. It analyzes encoding techniques like ZigZag and LEB128, evaluates schema evolution challenges, and offers a framework for selecting between schema-driven and schema-less approaches based on performance, compatibility, and design trade-offs.
In this paper, we present the recent advances that highlight the characteristics of JSON-compatible binary serialization specifications. We motivate the discussion by covering the history and evolution of binary serialization specifications across the years starting from 1960s to 2000s and onwards. We analyze the use cases of the most popular serialization specifications across the industries. Drawing on the schema-driven (ASN.1, Apache Avro, Microsoft Bond, Cap'n Proto, FlatBuffers, Protocol Buffers, and Apache Thrift) and schema-less (BSON, CBOR, FlexBuffers, MessagePack, Smile, and UBJSON) JSON-compatible binary serialization specifications, we compare and contrast their inner workings through our analysis. We explore a set of non-standardized binary integer encoding techniques (ZigZag integer encoding and Little Endian Base 128 variable-length integer encoding) that are essential to understand the various JSON-compatible binary serialization specifications. We systematically discuss the history, the characteristics, and the serialization processes of the selection of schema-driven and schema-less binary serialization specifications and we identify the challenges associated with schema evolution in the context of binary serialization. Through reflective exercise, we explain our observations of the selection of JSON-compatible binary serialization specifications. This paper aims to guide the reader to make informed decisions on the choice between schema-driven or schema-less JSON-compatible binary serialization specifications.
Motivation & Objective
- To analyze the historical evolution and current state of binary serialization formats compatible with JSON.
- To compare schema-driven and schema-less JSON-compatible binary serialization specifications in terms of design, efficiency, and interoperability.
- To investigate non-standardized binary integer encoding techniques (ZigZag, LEB128) critical to these formats.
- To evaluate challenges in schema evolution and propose a formal analysis framework for schema compatibility.
- To guide developers in selecting appropriate serialization formats based on use case, performance, and maintainability.
Proposed method
- Systematic review and comparative analysis of 12 major JSON-compatible binary serialization formats, including both schema-driven (e.g., Protocol Buffers, Cap’n Proto) and schema-less (e.g., CBOR, BSON) variants.
- Reverse-engineering of bit-string representations using a publicly available GitHub repository with input data, schema, and code for each format.
- Application of standardized test data (Figure 10) to evaluate encoding consistency and JSON compatibility across formats.
- Identification and analysis of common binary encoding patterns, particularly ZigZag and Little Endian Base 128 (LEB128) for integers.
- Evaluation of schema evolution compatibility through test cases involving common transformations (e.g., field addition, deletion, renaming).
- Proposed conceptual framework for schema-drivenness metric and semantic versioning for schemas, analogous to Big O-notation for algorithmic efficiency.
Experimental results
Research questions
- RQ1What are the key design characteristics and trade-offs of schema-driven versus schema-less JSON-compatible binary serialization formats?
- RQ2How do non-standardized binary integer encoding techniques (ZigZag and LEB128) influence the efficiency and structure of binary serialization formats?
- RQ3To what extent can existing binary serialization formats represent any valid JSON document without modification, indicating true JSON compatibility?
- RQ4What are the common schema evolution patterns supported by schema-driven formats, and how can compatibility be formally analyzed?
- RQ5What metrics or frameworks can be used to compare the degree of schema-drivenness across different serialization formats?
Key findings
- Most JSON-compatible binary serialization formats share common structural patterns in their bit-string representations, enabling inference of format internals after studying a few examples.
- The use of ZigZag and LEB128 encoding techniques significantly improves space efficiency for signed and variable-length integers, respectively, across multiple formats.
- Schema-driven formats like Protocol Buffers and Apache Avro exhibit stronger support for schema evolution through versioned schema changes, though compatibility is not guaranteed across all transformations.
- Schema-less formats such as CBOR and MessagePack demonstrate broader compatibility with arbitrary JSON documents, but lack native schema validation and versioning.
- The study identifies a gap in formal schema evolution compatibility analysis, with no standardized method to verify forward or backward compatibility of schema changes.
- A reproducible benchmarking setup is provided via a GitHub repository, enabling readers to regenerate all bit-string outputs and validate format behavior.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.