How message size and batching change your IoT cloud bill
Most IoT pricing counts messages or blocks of data, not bytes. That makes the way your devices package their readings one of the biggest cost levers you control, often bigger than which cloud you pick.
How each service counts
| Service | Counts usage as |
|---|---|
| Azure IoT Hub | Messages in 4 KB blocks, against a daily quota per unit |
| AWS IoT Core | Messages in 5 KB blocks, plus rules triggered and actions run |
| Azure Event Hubs | Events in 64 KB blocks, plus throughput units sized by events per second |
| Amazon Kinesis (on-demand) | GB written and GB read |
| Google Pub/Sub | Data volume, with a minimum size per request |
Two patterns follow from this:
- Tiny messages are expensive. A 200-byte reading is billed as a full 4 KB or 5 KB message on the gateway, and a full event on Event Hubs.
- Slightly-too-big messages are expensive too. A 4.1 KB message is two messages on IoT Hub. A 5.1 KB message is two on IoT Core.
Batching: the biggest single saving
Instead of sending each sensor reading the moment it’s taken, a device (or an edge gateway) collects readings for a few seconds and sends them as one message.
Take a machine with 20 sensors, each reading once a second, at about 100 bytes per reading:
- Unbatched: 20 messages per second, each billed as a full block. That’s over 50 million messages a month from one machine.
- Batched every second: 1 message per second of about 2 KB. Still under one block, and 20 times fewer messages.
- Batched every 5 seconds: 1 message of about 10 KB every 5 seconds. Two or three blocks on the gateway, but far fewer events everywhere downstream.
The trade-off is latency: a 5-second batch means alerts arrive up to 5 seconds later. For most factory monitoring that’s fine. For safety interlocks it isn’t, but those should run locally, not through the cloud.
Other ways to shrink the bill
- Send on change, not on schedule. A temperature that hasn’t moved doesn’t need re-sending every second. Many devices and edge runtimes support deadband (only send when the value moves by more than a set amount).
- Use a compact format. JSON with long field names can be several times larger than the same data in a binary format like Protocol Buffers or CBOR, or even JSON with short keys.
- Aim under the block size. If messages are just over 4 KB or 5 KB, trimming a few fields can halve the gateway charge.
- Aggregate at the edge. Send one-minute minimum, maximum and average instead of 60 raw readings, and keep raw data locally for troubleshooting. See edge runtimes compared.
See the effect in numbers
Our Industry 4.0 estimator takes message size and send rate as inputs. Try your current settings, then the batched version, and compare the gateway and streaming lines. For how each gateway’s pricing model works in more detail, see how IoT platform pricing works.