Message Serialization Comparator
Compare IoT message formats by bytes, airtime, parsing work, and schema risk
Message Serialization Comparator
Watch the same sensor report move through encoding, transmission, decoding, and platform use while the comparator scores JSON, CBOR, MessagePack, Protocol Buffers, Avro, and raw binary against IoT constraints.
Payload shape
More fields, longer keys, and repeated readings change text and binary formats differently.
Wire cost
Bytes become airtime and daily fleet volume once link speed and report rate are known.
Runtime cost
Text parsing, schema libraries, RAM buffers, and compression all matter on small devices.
Lifecycle risk
Schema evolution, debugging, and ecosystem support can outweigh the smallest payload.
Encoding sensor report
Field names, type markers, tags, and fixed layouts decide what actually crosses the network.
a4 62 69 64 68 73 65 6e 73 2d 30 31 62 74 73 1a ...
CBOR byte sketch
Size model
JSON carries readable field names; schema formats replace names with compact tags.
Fleet impact
At the selected rate, the chosen format sends 0.0 MB/day across 1,000 devices.
Decision check
The best format depends on link budget, tooling, schema control, and diagnostics.
Technical Accuracy Notes
- Byte counts are teaching estimates, not library conformance tests.
- JSON uses UTF-8 text and normally repeats field names in every object.
- CBOR and MessagePack can still carry map keys; using numeric keys becomes a schema decision.
- Protocol Buffers and Avro assume sender and receiver share compatible schemas.
- Raw binary is compact only when layout, byte order, versioning, and validation are controlled.
Guided Checks
- Raise key length and compare JSON against schema-based formats.
- Drop link speed below 1 kbps and watch airtime dominate the choice.
- Enable optional future fields and notice why raw layouts become risky.
- Turn on compression only after checking CPU and RAM trade-offs.
Formula Trace
airtime_ms = payload_bytes x 8 / link_kbps. Daily fleet MB uses decimal networking units: bytes x reports/min x 1440 x devices / 1,000,000.