SlideShare a Scribd company logo
IoT Sensor Analytics with
Apache Kafka, KSQL,
TensorFlow and MQTT
Kafka-Native End-to-End IoT Data Integration and Processing
Kai Waehner
Technology Evangelist
Confluent
kai.waehner@confluent.io
LinkedIn
@KaiWaehner
www.confluent.io
www.kai-waehner.de
POLL:
What are your current Use
Cases for Apache Kafka?
Agenda
3
01 IoT Use Cases 06 IoT Data Processing
02 MQTT Standard 07
Live Demo: End-to-End Sensor
Analytics
03 Apache Kafka Ecosystem
04 TensorFlow for IoT Scenarios
05
End-to-End IoT Integration
Architecture(s)
IoT Use Cases
The Future of the Automotive Industry
is a Real Time Data Cluster
Front, rear and top
view cameras
Parking assistant
Environment pointer
Ultrasonic Sensors
Parking assistant with
front and rear camera plus
environment indicator
Crash Sensors
Front protection adaptivity
Side protection
Tail impact protection
Front Camera
Audi Active lane assistant
Speed limit indicator
Adaptive light
Infrared Camera
Rearview assistance with
Pedestrian recognition
Front and Rear
Radar Sensors
ACC with stop and go function
Side assist
The Future of the Automotive Industry
is a Real Time Data Cluster
Front, rear and top
view cameras
Ultrasonic SensorsCrash Sensors
Front Camera Infrared Camera
Front and Rear
Radar Sensors
Traffic Alerts
Hazard Alerts Personalization
Anomaly
Detection
MQTT MQTT
MQTT
MQTT MQTTMQTT
7
8
9
10
11
12
13
Architecture (High-Level)
14
POLL:
Which IoT scenarios do you
see in your company?
MQTT Standard
MQTT - Publish / subscribe messaging protocol
• Built on top of TCP/IP for constrained devices and unreliable networks
• Many (open source) broker implementations
• Many client libraries
• IoT-specific features for bad network / connectivity
• Widely used (mostly IoT, but also web and mobile apps via MQTT over WebSockets)
17
MQTT Architecture (large-scale)
18
MQTT Trade-Offs
PROs
● Lightweight
● Simple API
● Built for poor connectivity / high
latency scenario
● Many client connections (tens of
thousands per MQTT server)
19
CONs
● “Just” queuing, not stream
processing
● Can’t handle usage surges (no
buffering)
● Most MQTT brokers don’t support
high scalability
● Very asynchronous processing
(often offline for long time)
● No good integration to the rest of
the enterprise
● No reprocessing of events
Apache Kafka Ecosystem
Apache Kafka - The Rise of an Event Streaming
Platform
21
Log & Pub/Sub
22
Apache Kafka == Distributed Commit Log with
Replication
23
Apache Kafka at Scale at Tech Giants
24
> 7 trillion messages / day > 6 Petabytes / day
...you name it!
Kafka Trade-Offs (IoT Perspective)
PROs
● Stream processing, not just
queuing
● High throughput
● Large scale
● High availability
● Long term storage and buffering
● Reprocessing of events
● Good integration to the rest of the
enterprise
26
CONs
● Not built for tens of thousands
connections
● Requires stable network and good
infrastructure
● No IoT-specific features like keep
alive, last will or testament
(De facto) Standards for Processing IoT Data
27
...a match made in
Heaven
TensorFlow for IoT Scenarios
TensorFlow
TensorFlow is an open source software
library for high performance numerical
computation. Its flexible architecture allows
easy deployment of computation across a
variety of platforms (CPUs, GPUs, TPUs), and
from desktops to clusters of servers to mobile
and edge devices. Originally developed by
researchers and engineers from the Google
Brain team within Google’s AI organization, it
comes with strong support for machine
learning and deep learning and the flexible
numerical computation core is used across
many other scientific domains.
29
The first analytic models
30
How to deploy the models
in production?
…real-time processing?
…at scale?
…24/7 zero downtime?
Hidden Technical Debt in Machine Learning
Systems
https://papers.nips.cc/paper/5656-hidden-technical-debt-in-machine-learning-systems.pdf 31
Apache Kafka’s Open Source Ecosystem as
Infrastructure for ML
32
Apache Kafka’s Open Ecosystem as
Infrastructure for ML
33
Data Ingestion
34
Model Training
35
Model Training without additional Data Store
https://github.com/tensorflow/io/tree/master/tensorflow_io/kafka
36
● Native integration
between Kafka and
TensorFlow
● KafkaDataSet and
KafkaOutputSequence
for TensorFlow
● Written in C++ (linked
with librdkafka)
● Part of the graph in
TensorFlow
● Direct training and
inference from
streaming data
● No data storage like S3
or HDFS needed
Replayability — a log never forgets!
37
Analytic Model (Autoencoder for Anomaly
Detection)
38
Model Deployment #1: RPC Communication to do
Model Inference
39
Model deployment #2: Model inference natively
in the App
40
End-to-End IoT Integration
Architecture(s)
Architecture (high-level)
42
Architecture (High Level) – Machine Learning
Perspective
43
Kafka-Native Integration Options between MQTT
and Apache Kafka
Kafka Connect
MQTT Proxy
REST Proxy
44
Kafka-Native Integration Options between MQTT
and Apache Kafka
Kafka Connect
MQTT Proxy
REST Proxy
45
Integration with Kafka Connect (Source and
Sink)
46
Kafka Connect – Don‘t reinvent the wheel!
47
Kafka-Native Integration Options between MQTT
and Apache Kafka
Kafka Connect
MQTT Proxy
REST Proxy
48
MQTT Proxy
49
Kafka-Native Integration Options between MQTT
and Apache Kafka
Kafka Connect
MQTT Proxy
REST Proxy
50
REST Proxy
51
Confluent REST Proxy - Produce and Consume
Messages
52
IoT Data Processing
IoT Data Processing
54
Processing Options for MQTT Data with Kafka
55
The 3 stream processing modalities with
Confluent
56
The 3 stream processing modalities differ in
flexibility and ease of use
57
Using external processing systems leads to
complicated architectures
58
We can put it back together in a simpler way
59
Connect integration and pull queries enable end-
to-end streaming in just a few SQL statements
60
Live Demo:
End-to-End Sensor Analytics
KSQL and Deep Learning (Auto Encoder) for
Anomaly Detection
63
Model Training with Python, KSQL, TensorFlow,
Keras and Jupyter
https://github.com/kaiwaehner/python-jupyter-apache-kafka-ksql-tensorflow-keras
64
Model Deployment with Apache Kafka, KSQL and
TensorFlow
65
Live Demo:
End-to-End Sensor Analytics…
Deep Learning UDF for KSQL for Streaming
Anomaly Detection of MQTT IoT Sensor Data
https://github.com/kaiwaehner/ksql-udf-deep-learning-mqtt-iot
67
Demo: Predictive Analytics for 100000
Connected Cars
Kafka + KSQL + MQTT + TensorFlow + Kubernetes
68
https://www.kai-waehner.de/blog/2019/11/08/live-demo-
iot-100-000-connected-cars-kubernetes-kafka-mqtt-
tensorflow/
POLL:
What is the best choice for your IoT
integration between MQTT and
Kafka?
Stay in touch!
Try Confluent
cnfl.io/download
Confluent Blog
cnfl.io/blog
Community
cnfl.io/meetups
Thank You!
Kai Waehner
kai-waehner.de
@KaiWaehner
LinkedIn
IoT Sensor Analytics with Kafka, ksqlDB and TensorFlow

More Related Content

PDF
Apache Kafka as Event-Driven Open Source Streaming Platform (Prague Meetup)
PDF
Streaming Machine Learning with Python, Jupyter, TensorFlow, Apache Kafka and...
PDF
Service Mesh with Apache Kafka, Kubernetes, Envoy, Istio and Linkerd
PDF
Confluent REST Proxy and Schema Registry (Concepts, Architecture, Features)
PDF
Best Practices for Streaming IoT Data with MQTT and Apache Kafka
PDF
Event-Driven Stream Processing and Model Deployment with Apache Kafka, Kafka ...
PDF
Machine Learning Trends of 2018 combined with the Apache Kafka Ecosystem
PPTX
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
Apache Kafka as Event-Driven Open Source Streaming Platform (Prague Meetup)
Streaming Machine Learning with Python, Jupyter, TensorFlow, Apache Kafka and...
Service Mesh with Apache Kafka, Kubernetes, Envoy, Istio and Linkerd
Confluent REST Proxy and Schema Registry (Concepts, Architecture, Features)
Best Practices for Streaming IoT Data with MQTT and Apache Kafka
Event-Driven Stream Processing and Model Deployment with Apache Kafka, Kafka ...
Machine Learning Trends of 2018 combined with the Apache Kafka Ecosystem
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...

What's hot (20)

PDF
Deep Learning at Extreme Scale (in the Cloud) 
with the Apache Kafka Open Sou...
PDF
KSQL – The Open Source SQL Streaming Engine for Apache Kafka (Big Data Spain ...
PDF
Can Apache Kafka Replace a Database?
PPTX
Confluent Kafka and KSQL: Streaming Data Pipelines Made Easy
PDF
Cloud Native London 2019 Faas composition using Kafka and cloud-events
PDF
Kafka Connect and Streams (Concepts, Architecture, Features)
PDF
Apache Kafka and API Management / API Gateway – Friends, Enemies or Frenemies?
PDF
Deep Learning Streaming Platform with Kafka Streams, TensorFlow, DeepLearning...
PDF
Rethinking Stream Processing with Apache Kafka, Kafka Streams and KSQL
PDF
Benefits of Stream Processing and Apache Kafka Use Cases
PDF
GCP for Apache Kafka® Users: Stream Ingestion and Processing
PDF
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB)
PDF
KSQL – An Open Source Streaming Engine for Apache Kafka
PDF
Apache Kafka as Event Streaming Platform for Microservice Architectures
PDF
Best Practices for Streaming IoT Data with MQTT and Apache Kafka®
PDF
Apache Kafka 2.3 + Confluent Platform 5.3 => What's New?
PDF
Ten reasons to choose Apache Pulsar over Apache Kafka for Event Sourcing_Robe...
PDF
Kai Waehner - KSQL – The Open Source SQL Streaming Engine for Apache Kafka - ...
PDF
IoT Sensor Analytics with Python, Jupyter, TensorFlow, Keras, Apache Kafka, K...
PDF
0-60: Tesla's Streaming Data Platform ( Jesse Yates, Tesla) Kafka Summit SF 2019
Deep Learning at Extreme Scale (in the Cloud) 
with the Apache Kafka Open Sou...
KSQL – The Open Source SQL Streaming Engine for Apache Kafka (Big Data Spain ...
Can Apache Kafka Replace a Database?
Confluent Kafka and KSQL: Streaming Data Pipelines Made Easy
Cloud Native London 2019 Faas composition using Kafka and cloud-events
Kafka Connect and Streams (Concepts, Architecture, Features)
Apache Kafka and API Management / API Gateway – Friends, Enemies or Frenemies?
Deep Learning Streaming Platform with Kafka Streams, TensorFlow, DeepLearning...
Rethinking Stream Processing with Apache Kafka, Kafka Streams and KSQL
Benefits of Stream Processing and Apache Kafka Use Cases
GCP for Apache Kafka® Users: Stream Ingestion and Processing
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB)
KSQL – An Open Source Streaming Engine for Apache Kafka
Apache Kafka as Event Streaming Platform for Microservice Architectures
Best Practices for Streaming IoT Data with MQTT and Apache Kafka®
Apache Kafka 2.3 + Confluent Platform 5.3 => What's New?
Ten reasons to choose Apache Pulsar over Apache Kafka for Event Sourcing_Robe...
Kai Waehner - KSQL – The Open Source SQL Streaming Engine for Apache Kafka - ...
IoT Sensor Analytics with Python, Jupyter, TensorFlow, Keras, Apache Kafka, K...
0-60: Tesla's Streaming Data Platform ( Jesse Yates, Tesla) Kafka Summit SF 2019
Ad

Similar to IoT Sensor Analytics with Kafka, ksqlDB and TensorFlow (20)

PDF
Processing IoT Data from End to End with MQTT and Apache Kafka
PDF
Simplified Machine Learning Architecture with an Event Streaming Platform (Ap...
PDF
Unleashing Apache Kafka and TensorFlow in the Cloud

PDF
Io t data streaming
PDF
Viele Autos, noch mehr Daten: IoT-Daten-Streaming mit MQTT & Kafka (Kai Waehn...
PDF
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
PPTX
Apache Kafka® + Machine Learning for Supply Chain 
PPTX
IIoT with Kafka and Machine Learning for Supply Chain Optimization In Real Ti...
PDF
2019 04 seattle_meetup___kafka_machine_learning___kai_waehner
PDF
IoT meets Big Data
PDF
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
PDF
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
PDF
Apache Kafka® and Analytics in a Connected IoT World
PDF
IoT Architectures for Apache Kafka and Event Streaming - Industry 4.0, Digita...
PDF
MQTT. Kafka. InfluxDB. SQL. IoT Harmony. #tutorial by Stefan Bocutiu
PPTX
IoT and Event Streaming at Scale with Apache Kafka
PDF
Getting insights from IoT data with Apache Spark and Apache Bahir
PDF
Kai Waehner - Deep Learning at Extreme Scale in the Cloud with Apache Kafka a...
PDF
Flexible and Scalable Integration in the Automation Industry/Industrial IoT
PDF
IIoT / Industry 4.0 with Apache Kafka, Connect, KSQL, Apache PLC4X
Processing IoT Data from End to End with MQTT and Apache Kafka
Simplified Machine Learning Architecture with an Event Streaming Platform (Ap...
Unleashing Apache Kafka and TensorFlow in the Cloud

Io t data streaming
Viele Autos, noch mehr Daten: IoT-Daten-Streaming mit MQTT & Kafka (Kai Waehn...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Apache Kafka® + Machine Learning for Supply Chain 
IIoT with Kafka and Machine Learning for Supply Chain Optimization In Real Ti...
2019 04 seattle_meetup___kafka_machine_learning___kai_waehner
IoT meets Big Data
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
Apache Kafka® and Analytics in a Connected IoT World
IoT Architectures for Apache Kafka and Event Streaming - Industry 4.0, Digita...
MQTT. Kafka. InfluxDB. SQL. IoT Harmony. #tutorial by Stefan Bocutiu
IoT and Event Streaming at Scale with Apache Kafka
Getting insights from IoT data with Apache Spark and Apache Bahir
Kai Waehner - Deep Learning at Extreme Scale in the Cloud with Apache Kafka a...
Flexible and Scalable Integration in the Automation Industry/Industrial IoT
IIoT / Industry 4.0 with Apache Kafka, Connect, KSQL, Apache PLC4X
Ad

More from Kai Wähner (20)

PDF
Apache Kafka as Data Hub for Crypto, NFT, Metaverse (Beyond the Buzz!)
PDF
When NOT to use Apache Kafka?
PDF
Kafka for Live Commerce to Transform the Retail and Shopping Metaverse
PDF
The Heart of the Data Mesh Beats in Real-Time with Apache Kafka
PDF
Apache Kafka vs. Cloud-native iPaaS Integration Platform Middleware
PDF
Data Warehouse vs. Data Lake vs. Data Streaming – Friends, Enemies, Frenemies?
PDF
Serverless Kafka and Spark in a Multi-Cloud Lakehouse Architecture
PDF
Resilient Real-time Data Streaming across the Edge and Hybrid Cloud with Apac...
PDF
Data Streaming with Apache Kafka in the Defence and Cybersecurity Industry
PDF
Apache Kafka in the Healthcare Industry
PDF
Apache Kafka in the Healthcare Industry
PDF
Apache Kafka for Real-time Supply Chain in the Food and Retail Industry
PDF
Kafka for Real-Time Replication between Edge and Hybrid Cloud
PDF
Apache Kafka for Predictive Maintenance in Industrial IoT / Industry 4.0
PDF
Apache Kafka Landscape for Automotive and Manufacturing
PDF
Kappa vs Lambda Architectures and Technology Comparison
PPTX
The Top 5 Apache Kafka Use Cases and Architectures in 2022
PDF
Event Streaming CTO Roundtable for Cloud-native Kafka Architectures
PDF
Apache Kafka in the Public Sector (Government, National Security, Citizen Ser...
PDF
Telco 4.0 - Payment and FinServ Integration for Data in Motion with 5G and Ap...
Apache Kafka as Data Hub for Crypto, NFT, Metaverse (Beyond the Buzz!)
When NOT to use Apache Kafka?
Kafka for Live Commerce to Transform the Retail and Shopping Metaverse
The Heart of the Data Mesh Beats in Real-Time with Apache Kafka
Apache Kafka vs. Cloud-native iPaaS Integration Platform Middleware
Data Warehouse vs. Data Lake vs. Data Streaming – Friends, Enemies, Frenemies?
Serverless Kafka and Spark in a Multi-Cloud Lakehouse Architecture
Resilient Real-time Data Streaming across the Edge and Hybrid Cloud with Apac...
Data Streaming with Apache Kafka in the Defence and Cybersecurity Industry
Apache Kafka in the Healthcare Industry
Apache Kafka in the Healthcare Industry
Apache Kafka for Real-time Supply Chain in the Food and Retail Industry
Kafka for Real-Time Replication between Edge and Hybrid Cloud
Apache Kafka for Predictive Maintenance in Industrial IoT / Industry 4.0
Apache Kafka Landscape for Automotive and Manufacturing
Kappa vs Lambda Architectures and Technology Comparison
The Top 5 Apache Kafka Use Cases and Architectures in 2022
Event Streaming CTO Roundtable for Cloud-native Kafka Architectures
Apache Kafka in the Public Sector (Government, National Security, Citizen Ser...
Telco 4.0 - Payment and FinServ Integration for Data in Motion with 5G and Ap...

Recently uploaded (20)

PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Introduction to Artificial Intelligence
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Online Work Permit System for Fast Permit Processing
PDF
top salesforce developer skills in 2025.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Digital Strategies for Manufacturing Companies
PDF
System and Network Administraation Chapter 3
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Nekopoi APK 2025 free lastest update
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
ai tools demonstartion for schools and inter college
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Transform Your Business with a Software ERP System
PDF
medical staffing services at VALiNTRY
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
Which alternative to Crystal Reports is best for small or large businesses.pdf
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Introduction to Artificial Intelligence
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Design an Analysis of Algorithms I-SECS-1021-03
CHAPTER 2 - PM Management and IT Context
Online Work Permit System for Fast Permit Processing
top salesforce developer skills in 2025.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Digital Strategies for Manufacturing Companies
System and Network Administraation Chapter 3
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Operating system designcfffgfgggggggvggggggggg
Nekopoi APK 2025 free lastest update
2025 Textile ERP Trends: SAP, Odoo & Oracle
ai tools demonstartion for schools and inter college
How to Choose the Right IT Partner for Your Business in Malaysia
Transform Your Business with a Software ERP System
medical staffing services at VALiNTRY
VVF-Customer-Presentation2025-Ver1.9.pptx

IoT Sensor Analytics with Kafka, ksqlDB and TensorFlow