Serialization Scenarios

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.
Serialization IoT Scenarios Payload 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 fit Current decision
46 B Selected uplink payload
1.2 s Airtime per uplink

What moves

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
Serialization pipeline animation A packet token moves through sensor, serializer, envelope, radio link, decoder, and decision nodes. Sensor 5 fields reading Serializer CBOR wire shape Envelope 32 B overhead Link 0.3 kbps radio Decode integer keys Decision Good fit Raw: 37 B Encoded: 46 B Airtime: 1.2 s Fleet: 110 MB/day 1

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.

payload_bytes = serialization_bytes + envelope_bytes airtime_ms = payload_bytes * 8 / link_kbps daily_fleet_MB = payload_bytes * uplinks_per_day / 1,000,000