Match serialization formats to IoT use cases and quantify payload cost
animation
serialization
bandwidth
iot
cost-analysis
schema-evolution
Interactive IoT serialization scenario lab for choosing JSON, CBOR, MessagePack, Protocol Buffers, Avro, or raw binary based on payload size, airtime, debugging, schema, and fleet cost constraints.
SerializationIoT ScenariosPayload Cost
Serialization Scenarios
Choose a deployment, adjust the constraints, then watch one reading become a wire payload. The lab keeps format choice tied to bytes, airtime, debugging value, schema discipline, and fleet-scale cost.
CBOR fitCurrent decision
46 BSelected uplink payload
1.2 sAirtime per uplink
TryLoad LPWAN soil node, choose CBOR, and press Step with the default Application fields.
ObserveFor 1 CBOR payload, Estimated bytes, Radio airtime, Fleet traffic, and Decision verdict update against the scenario budget.
ExplainAcross 1 encoded report, compact field keys and binary values reduce CBOR airtime, but the decision score also preserves schema evolution and debugging requirements.
Technical boundariesThe scenario calculator uses fixed field-size estimates and link rate; it omits protocol headers, retries, compression, encoder variation, CPU cost, security envelopes, and schema migration failures.
The packet token travels from sensor reading to encoded bytes, envelope, radio link, decoder, and format decision.
What changes
Scenario constraints change field count, reporting rate, link speed, batch size, schema risk, and operational debugging needs.
What to compare
Use the byte bars and diagnostics together. Small payloads can lose more to security framing than to serialization syntax.
Common trap
Choosing the smallest payload alone can create brittle firmware if schema changes, byte order, and decoding contracts are not managed.
1
Read fields
Sensor values, device id, timestamp, and optional text labels.
2
Serialize
Text, compact binary object, schema-based binary, or fixed layout.
3
Add envelope
Signatures, encryption tags, topic metadata, or batch framing.
4
Transmit
Payload bytes become airtime and network cost on the selected link.
5
Decode
Receiver applies field names, integer keys, or an agreed schema.
6
Decide
Best fit balances size, operations, evolvability, and implementation risk.
Scenario simulator
One IoT reading through the format decision
Battery soil nodes send compact environmental readings over a slow LPWAN link.
Good fit
CBOR payload sketch
{1: "soil-042", 2: 23.5, 3: 41}
Format byte comparison
RecommendationCBOR
Compact enough for constrained links while keeping typed fields and standard decoders.
Fleet bandwidth110 MB/day
Daily uplink volume from all devices before protocol headers.
Risk signalSchema controlled
Receiver and sender agree on integer keys, so compact encoding remains parseable.
Small links magnify syntax
On LPWAN or 802.15.4-class paths, field names, quotes, and repeated metadata can dominate a tiny sensor value.
Operations still matter
Readable JSON can be the right choice for field diagnostics or low-rate configuration, even when it is not byte-efficient.
Batching changes the answer
Avro and compression become more attractive when gateway batches amortize schema and framing over many records.
Technical accuracy notes
Payload sizes here are teaching estimates. Real byte counts depend on field types, integer ranges, string lengths, library choices, and whether map keys or array positions are used.
JSON is text and self-describing, which helps debugging and broad tool support, but repeated field names increase payload size.
CBOR and MessagePack are compact binary object encodings. They can carry self-describing maps, or applications can use shorter integer keys when both sides agree on them.
Protocol Buffers and Avro depend on schema discipline. They are compact when sender and receiver share compatible schemas, but they add process risk if versioning is unmanaged.
Raw binary can be smallest, but it requires a fixed contract for byte order, field widths, scaling, optional values, and future changes.
Security envelopes, transport headers, retransmissions, duty-cycle limits, and radio startup energy are outside the serialization byte count but often dominate end-to-end power.
Formula trace
Current calculation details will appear here after the first update.