GuideIoT & cloud

Designing an IoT Backend: MQTT, a Time-Series Database and Live Video Streaming

Your devices work. Now where does the data go? A practical architecture for device connectivity, data storage, dashboards and live camera streaming.

Short answer

Sensor telemetry
MQTT broker + time-series database
Live video to browsers
Media server with WebRTC or low-latency HLS
Recording and NVR-style use
RTSP into a recording server

Most IoT projects spend months on firmware and a week on the backend. Then the backend becomes the reason the product feels unreliable. A small, well-chosen architecture avoids that.

The building blocks

LayerJobTypical choice
Device connectivityReceive messages, authenticate devicesMQTT broker with TLS and per-device credentials
StorageKeep readings with timestampsTime-series database with retention rules
VideoDeliver live streams and recordingsMedia server: RTSP in, WebRTC or HLS out
Dashboards and alertsShow fleet health, notify on problemsDashboard tool plus alert rules
Device managementConfiguration and firmware updatesRetained messages or device shadows, OTA service

Design rules that prevent pain later

  1. One identity per device

    Never share credentials across devices. You must be able to revoke one unit.

  2. Buffer on the device

    Devices should store readings while offline and upload with timestamps when back.

  3. Agree on message formats early

    Version your payloads so firmware and server can evolve independently.

  4. Plan retention

    Decide how long raw data is kept before storage costs surprise you.

  5. Monitor the backend too

    Alert when ingestion drops, not only when devices misbehave.

Frequently asked questions

Should I use a cloud IoT platform or self-host?

Managed platforms are faster to start. Self-hosting gives more control and lower running costs at scale. Both can use the same device-side design.

How do I stream video from devices behind NAT?

Devices push streams outward to a media server, which then serves viewers. No inbound ports on the device.

How many devices can one server handle?

Hundreds to thousands for telemetry on modest hardware, depending on message rates. Video needs far more capacity.

See it in a real projectBuilding the Server Side: An IoT Backend for Sensor Data and Live Camera Streams
Nikhil Robinson

Embedded systems consultant at TechProgeny, Bengaluru. 7+ years and 29+ shipped products across firmware, embedded Linux, edge AI, apps and IoT servers.