Serialization Trade-Offs in Distributed Systems: A Comparative Analysis of JSON, Protocol Buffers, and FlatBuffers Under Varying Width and Nesting Depth
Loading...
Date
Editors
Authors
Journal Title
Journal ISSN
Volume Title
Publisher
IU International University of Applied Sciences
Abstract
Serialization is a core operation in distributed systems, yet existing studies often compare individual formats without systematically controlling structural properties of the transmitted data. This paper presents a controlled comparison of three serialization paradigms: textual encoding represented by JSON, binary schema-based encoding represented by Protocol Buffers, and zero-copy representation represented by FlatBuffers. Using a Rust-based benchmark suite, the study systematically varies record width and nesting depth across four datasets and measures serialization latency, data-access latency, throughput, and serialized message size. Quantitative measurements are complemented by CPU profiling to identify low-level performance drivers.
The results show that no format dominates across all dimensions. Protocol Buffers achieves the lowest serialization latency and the smallest message sizes across all datasets, supporting its suitability for write- and bandwidth-sensitive workloads. FlatBuffers provides substantially faster data access than both Protocol Buffers and JSON due to its zero-copy design, making it advantageous for read-dominated scenarios. JSON exhibits the highest access latency and generally larger payloads, but remains relevant where human readability, flexibility, and ecosystem compatibility are prioritized. Profiling attributes these differences to format-specific mechanisms: textual conversion and key emission in JSON, varint and field-wise byte encoding in Protocol Buffers, and offset/vtable resolution in FlatBuffers. The findings demonstrate that serialization format choice is a consequential architectural decision whose optimality depends on workload structure and read/write characteristics.