IoT Ecosystem: Devices, Gateways, Brokers, Apps
How IoT devices, gateways, brokers, and applications fit together, with a gateway sizing example and common architectural failure modes.
Contents & prerequisites
Every IoT deployment, whether it's ten temperature sensors on a factory floor or a fleet of ten million smart meters, is built from the same four architectural layers: devices, gateways, brokers, and applications. Getting the boundaries between these layers wrong is one of the most common causes of IoT projects that work as a demo but collapse at scale — wrong protocol choice at the edge, no buffering between unreliable links and the cloud, or a broker that can't handle the fan-in of concurrent connections. Understanding what each layer is actually responsible for is the first design decision in any IoT system.
The Four Layers
[ Device ] --wireless--> [ Gateway ] --IP/backhaul--> [ Broker ] <---> [ Application ]
sensor/ protocol message cloud
actuator translation, routing, services,
aggregation pub/sub dashboards,
rules, storage
| Layer | Primary job | Typical hardware/software | Typical protocols |
|---|---|---|---|
| Device | Sense/actuate physical world | MCU + sensor/actuator, radio | BLE, Zigbee, LoRa, Thread |
| Gateway | Protocol translation, local aggregation, buffering | SBC or embedded Linux box | MQTT, CoAP, HTTP uplink |
| Broker | Message routing, decoupling producers/consumers | Cloud service or on-prem server | MQTT, AMQP, Kafka |
| Application | Business logic, storage, visualization, control | Cloud backend, mobile/web app | REST, WebSocket, GraphQL |
Devices: The Perception Layer
Devices are the sensors and actuators that touch the physical world — a thermocouple, an accelerometer, a relay driving a valve. Architecturally, what matters here is the resource envelope: most IoT end devices are RFC 7228 Class 0/1 constrained nodes — kilobytes of RAM, tens to low hundreds of kHz-to-MHz MCUs, and battery or energy-harvested power budgets measured in microamps of average current.
Design implications:
- Radio choice drives everything else. A coin-cell door sensor using BLE or Zigbee cannot run a full TCP/IP+TLS stack economically; it needs a gateway to translate its lightweight protocol into something IP-routable.
- Duty cycling dominates power budget. A device that transmits a 20-byte payload once per minute and sleeps otherwise can run for years on a CR2032; the radio's active current (10–100 mA) matters far less than how long it stays on.
- Local intelligence is a spectrum, from "raw ADC sample, no processing" to "on-device inference, only send anomaly events" — pushing computation to the device reduces radio airtime and gateway/broker load at the cost of firmware complexity.
Gateways: The Translation and Aggregation Point
A gateway bridges the constrained, often non-IP world of devices to the IP-based backhaul (Wi-Fi, Ethernet, cellular) that reaches the cloud. It typically does four things:
- Protocol translation — e.g., terminating a BLE GATT connection or a Zigbee PAN and re-publishing the data as MQTT over cellular.
- Local aggregation — batching readings from dozens or hundreds of devices before forwarding, reducing per-message overhead and backhaul cost (critical when backhaul is metered cellular data).
- Store-and-forward buffering — queuing data locally during backhaul outages and replaying it once connectivity returns, which is essential for any deployment on lossy links (rural cellular, satellite backhaul).
- Edge processing — filtering, threshold checks, or light inference so only meaningful events (not every raw sample) reach the cloud, cutting bandwidth and cloud ingestion cost.
Worked example — sizing gateway fan-in and backhaul: Suppose a gateway aggregates 200 BLE sensors, each sending a 50-byte payload every 10 seconds.
- Per-device rate: 50 bytes / 10 s = 5 bytes/s → 40 bit/s
- Aggregate raw sensor data rate: 200 × 40 bit/s = 8,000 bit/s = 8 kbit/s
- Adding MQTT/TCP/IP overhead (~40–60 bytes header per publish): assume the gateway batches all 200 readings into one MQTT publish every 10 s: payload = 200 × 50 B = 10,000 B, plus ~50–60 B overhead ≈ 10,050–10,060 B per publish.
- Backhaul rate needed: ~10,055 B / 10 s ≈ 8.04 kbit/s sustained.
Check: this comfortably fits even a narrowband cellular (NB-IoT/CAT-M) uplink budget of tens of kbit/s, confirming that batching at the gateway — rather than 200 independent cellular-connected devices — is the right architectural choice both for cost (one SIM/data plan instead of 200) and for radio spectrum efficiency.
Brokers: Decoupling Producers from Consumers
The broker is the message-routing hub that decouples data producers (gateways, devices) from data consumers (applications, other services) using a publish/subscribe pattern. Instead of each device knowing the IP address of every application that needs its data, devices publish to a named topic (e.g., factory/line3/temp), and the broker fans that message out to every current subscriber.
Why this matters architecturally:
- Decoupling in time and space. Publishers and subscribers don't need to be online simultaneously (with QoS and persistent sessions) or know each other's network location — new applications can subscribe to existing topics without touching device firmware.
- QoS levels (MQTT example) — QoS 0 (at most once, fire-and-forget), QoS 1 (at least once, possible duplicates), QoS 2 (exactly once, highest overhead). Telemetry streams often use QoS 0/1; commands and firmware-update triggers typically need QoS 1 or 2 to guarantee delivery.
- Scalability is the broker's core engineering problem. A single broker instance handling millions of concurrent persistent connections requires clustering, topic partitioning, and often a split between an edge-facing MQTT broker and a backend stream processor (e.g., Kafka) for durable, replayable storage — MQTT is optimized for low-latency fan-out, not long-term log retention.
Applications: Turning Messages into Decisions
The application layer subscribes to broker topics (or queries a backend API) and implements the actual business logic: dashboards, alerting rules, historical analytics, digital twins, and command paths back down to devices. Architecturally, this layer usually includes:
- A time-series database for storing telemetry efficiently (see the related time-series data topic), since IoT data is overwhelmingly append-only, timestamped, and queried by time range.
- A rules/stream-processing engine that evaluates incoming messages against thresholds or models (e.g., "vibration RMS > 5 mm/s for 3 consecutive readings → raise alarm").
- A command path — a distinct data flow (not just the reverse of telemetry) with its own delivery guarantees, since a missed "close valve" command has very different consequences than a missed sensor reading.
Practical Failure Modes to Design Against
- No buffering at the gateway → any backhaul outage causes silent, permanent data loss instead of a delayed-but-complete dataset.
- Devices publishing directly to the cloud broker over cellular at scale → linear increase in SIM/data cost and radio contention that a gateway aggregation tier would have avoided.
- Undersized broker QoS/persistence for command topics → commands silently dropped when a device is briefly offline, with no retry.
- Application layer coupled directly to device protocol (e.g., parsing raw BLE payloads in the dashboard code) instead of via the broker's normalized topic structure → any device firmware change breaks the application.
Key Takeaways
- The device–gateway–broker–application chain is the standard structural decomposition of any IoT system; each layer has a distinct job and distinct failure modes.
- Devices are resource-constrained and radio-optimized; gateways translate protocols, aggregate, and buffer; brokers decouple producers from consumers via pub/sub; applications turn messages into stored data and decisions.
- Aggregating many constrained devices behind a gateway before hitting cellular/cloud backhaul is usually far cheaper and more robust than connecting each device directly.
- Broker QoS and persistence settings should be chosen per data-flow type — telemetry, command, and alarm traffic have different delivery-guarantee requirements.
- Store-and-forward buffering at the gateway and durable stream storage behind the broker are what make a system resilient to real-world connectivity outages, not just functional in a lab demo.
Learning
Sign in to track your progress.
Evidence
Public projects engineers linked to IoT Ecosystem: Devices, Gateways, Brokers, Apps.
No engineer has linked a project to this topic yet. Built something that proves it? Add the project and tag it with iot-connectivity-iot-ecosystem-devices-gateways-brokers-apps — it then shows here and on your public profile.
