VOOZH about

URL: https://thenewstack.io/apache-kafka-cornerstone-iot-data-platform/

⇱ Apache Kafka: The Cornerstone of an Internet-of-Things Data Platform - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2017-02-15 08:10:40
Apache Kafka: The Cornerstone of an Internet-of-Things Data Platform
analysis,
Cloud Native Ecosystem / Containers / Edge Computing / Tech Culture

Apache Kafka: The Cornerstone of an Internet-of-Things Data Platform

Feb 15th, 2017 8:10am by Janakiram MSV
👁 Featued image for: Apache Kafka: The Cornerstone of an Internet-of-Things Data Platform
Feature image: Salt Creek Falls, Oregon, by Nathan Anderson, via Unsplash.

When it comes to the Internet of Things (IoT), many developers think in terms of microcontrollers, system-on-chip boards, single-board computers, sensors, and various other electronic components. While devices are undoubtedly the foundation of IoT, the core value of a connected solution lies in the data generated by these devices.

The devices layer is only the tip of the iceberg with the underlying data platform that is below the watermark tackling the heavy lifting. One of the key pillars of a robust Internet of Things (IoT) data platform is Apache Kafka, an open source software designed to handle massive amounts of data ingestion. It acts as a gateway to the data processing pipeline powered in the data center by Apache Storm, Apache Spark, and Apache Hadoop clusters.

If you are a developer considering IoT as a career option, it is time for you to start investing in Apache Kafka. This article explores the role that Apache Kafka plays in deploying a scalable IoT solution.

Kafka: A High-Performance Ingestion Layer for Sensor Data

IoT devices comprise of a variety of sensors capable of generating multiple data points, which are collected at a high frequency. A simple thermostat may generate a few bytes of data per minute while a connected car or a wind turbine generates gigabytes of data in just a few seconds. These massive data sets are ingested into the data processing pipeline for storage, transformation, processing, querying, and analysis.

Each data set consists of multiple data points representing specific metrics. For example, a connected Heating, ventilation and air conditioning (HVAC) system would report ambient temperature, desired temperature, humidity, air quality, blower speed, load, and energy consumption metrics.

In a large shopping complex, these data points are frequently collected from hundreds of HVACs. Since these devices may not be powerful enough to run the full TCP networking stack, they use protocols like Z-Wave, and ZigBee to send the data to a central gateway that is capable of aggregating the data points and ingesting them into the system.

👁 Image

The gateway pushes the data set to an Apache Kafka cluster, where the data takes multiple paths. Data points that need to be monitored in real-time go through the hot path. In our HVAC scenario, it is important to track metrics like temperature, humidity, and air quality in real-time to take corrective action. These data points may go through an Apache Storm and Apache Spark cluster for near real-time processing.

Metrics such as load and power consumption are analyzed after collecting them over a period of time. These data points that are collected and analyzed through a batch process typically take the cold path of the data processing pipeline. A MapReduce job may be run within a Hadoop cluster for analyzing the energy efficiency of HVACs.

Irrespective of the path that the data points take, they need to be ingested into the system. Apache Kafka acts as the high-performance data ingestion layer dealing with massive amounts of data sets. The components of the data processing pipeline responsible for hot path and cold path analytics become subscribers of Apache Kafka.

Kafka vs. MQTT

Apache Kafka is not a replacement to MQTT, which is a message broker that is typically used for Machine-to-Machine (M2M) communication. The design goals of Kafka are very different from MQTT.

In an IoT solution, the devices can be classified into sensors and actuators. Sensors generate data points while actuators are mechanical components that may be controlled through commands. For example, the ambient lighting in a room may be used to adjust the brightness of an LED bulb. In this scenario, the light sensor needs to talk to the LED, which is an example of M2M communication. MQTT is the protocol optimized for sensor networks and M2M.

Since Kafka doesn’t use HTTP for ingestion, it delivers better performance and scale.

Since MQTT is designed for low-power devices, it cannot handle the ingestion of massive datasets. On the other hand, Apache Kafka may deal with high-velocity data ingestion but not with M2M.

Scalable IoT solutions use MQTT as an explicit device communication while relying on Apache Kafka for ingesting sensor data. It is also possible to bridge Kafka and MQTT for ingestion and M2M. But it is recommended to keep them separate by configuring the devices or gateways as Kafka producers while still participating in the M2M network managed by an MQTT broker.

Kafka vs. HTTP/REST

Apache Kafka exposes a TCP port based on a binary protocol. The client, which pushes the data, initiates a socket connection and then writes a sequence of request messages and reads back the corresponding response message. This protocol does not require a handshake for each connection or disconnection.

Since Kafka doesn’t use HTTP for ingestion, it delivers better performance and scale. The client can connect to one of the instances of the cluster to ingest data. This architecture combined with raw TCP sockets offers maximum scalability and throughput.

While it may be tempting to use an HTTP proxy for communicating with a Kafka cluster, it is recommended that the solution uses a native client. Since Kafka is written in Java, the native Java client library delivers the best possible performance. The community has built optimized client libraries for Go, Python, and even Node.js. Shopify has also contributed to an open source Go library for Kafka called as Sarama. The Mailgun team at Rackspace has built Kafka-Pixy, an open source HTTP proxy for Kafka. There are multiple libraries for Python, C#, Ruby, and other languages.

Most of the IoT gateways are powerful enough to run Java, Go or Python. For best performance and throughput, it is recommended to use a client library natively designed for Kafka.

Getting Started with Kafka

Apache Kafka is developed in Java, and its deployment is managed by Apache ZooKeeper. Any OS capable of running a JVM can be used to deploy a Kafka cluster. To test the waters, you may want to run Kafka in Docker.

If you don’t want to deal with the infrastructure, you can get started with a managed Kafka service in the cloud. IBM Bluemix has Message Hub, a  fully managed, cloud-based messaging service based on Kafka. Cloud Karafka is another streaming platform in the public cloud, designed for Apache Kafka workloads. Aiven.io offers hosted Kafka along with InfluxDB, Grafana, and Elasticsearch. If you are an existing Salesforce.com or Heroku developer, you can take advantage of Kafka on Heroku.

Apache Kafka is the foundation of many Big Data deployments. In the upcoming articles of this series, I will introduce the key concepts, architecture, and terminology of Kafka. Stay tuned.

TRENDING STORIES
Janakiram MSV (Jani) is a practicing architect, research analyst, and advisor to Silicon Valley startups. He focuses on the convergence of modern infrastructure powered by cloud-native technology and machine intelligence driven by generative AI. Before becoming an entrepreneur, he spent...
Read more from Janakiram MSV
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Docker.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.