Free tech learning for everyone, from basics to pro

IoT ArchitectureIoT SecurityIntermediate

IoT data pipelines and time-series databases

In short: An IoT data pipeline ingests messages from devices, buffers them in a durable queue, processes and enriches them, stores them, and serves them to dashboards and analytics. Time-series databases are built for the timestamped readings IoT produces. Retention, downsampling and access control keep the pipeline affordable and safe.

Why a pipeline?

Ten devices can write straight to a database. Ten thousand devices sending a reading every few seconds cannot, at least not reliably. Spikes, outages and slow consumers would lose data. A data pipeline breaks the flow into stages that each do one job and can scale independently.

An IoT data pipelineIngestbroker or APIQueuedurable streamProcessclean, enrichStoretime-series DBServedashboards,APIs
Figure 1. A typical pipeline moves IoT messages from ingestion through a durable queue to processing, storage and consumers.

The stages

  • Ingest: an MQTT broker, HTTPS endpoint or platform hub receives messages and authenticates devices.
  • Queue or stream: a durable log (for example Apache Kafka or a cloud streaming service) holds messages so that if processing slows or fails, nothing is lost.
  • Process: parse the payload, check it, convert units, add context such as the device's location, and drop duplicates.
  • Store: write to a time-series database for readings and object storage for raw archives.
  • Serve: dashboards, APIs, reports and machine learning read the stored data.
Hot path vs cold pathHot pathSeconds or lessAlerts and live viewsStream processingRecent data onlyCold pathMinutes to hoursReports and MLBatch processingFull history
Figure 2. Many pipelines split into a fast "hot" path for alerts and a slower "cold" path for history and analytics.

Time-series databases

IoT readings are almost always timestamp, source, values. A time-series database (TSDB) is designed for this shape: very fast appends, compression of similar values, and queries such as "average per hour for the last week". Popular choices include InfluxDB, TimescaleDB (an extension to PostgreSQL) and Prometheus for metrics, plus cloud equivalents.

ConceptMeaning
Measurement / tableA type of reading, such as temperature
Tags / labelsIndexed metadata: device ID, site, floor
Fields / valuesThe numbers themselves
Retention policyHow long raw data is kept before deletion
DownsamplingReplacing old raw data with averages to save space

A sensible plan keeps raw readings for weeks, hourly summaries for years, and deletes the rest automatically. Avoid tags with millions of unique values (such as a random message ID); this "high cardinality" slows many TSDBs badly.

Securing the pipeline

  1. Authenticate devices at ingest and reject unknown sources.
  2. Validate every message against a schema; discard or quarantine malformed data rather than crashing.
  3. Encrypt traffic between every stage, not just from the device.
  4. Give each service its own credentials with only the permissions it needs, for example the processor can read the queue and write to the database but not delete.
  5. Encrypt storage, back it up and test restores.
  6. Monitor pipeline health: queue lag, rejected messages and sudden volume changes can signal faults or attacks.

Tip: keep the raw, unmodified messages in cheap storage for a while. If a processing bug corrupts results, you can replay the raw data instead of losing it.

Practice

Why put a durable queue between ingestion and processing?
It absorbs spikes and keeps messages safe if processing slows or fails, so data is not lost and stages can scale independently.
What is downsampling?
Replacing older high-resolution data with summaries such as hourly averages to save storage while keeping trends.
Name one sign in pipeline monitoring that might indicate an attack.
A sudden surge in message volume, many rejected or malformed messages, or a device sending from an unexpected location.

Key takeaways

  • Pipelines split ingestion, queuing, processing, storage and serving into stages.
  • Durable queues prevent data loss during spikes and outages.
  • Hot paths serve alerts quickly; cold paths serve history and analytics.
  • Time-series databases suit timestamped readings; use retention and downsampling.
  • Validate, authenticate and encrypt at every stage.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.