SlideShare a Scribd company logo
Being Ready for Apache Kafka:
Today’s Ecosystem and Future Roadmap
Michael G. Noll
@miguno
Developer Evangelist, Confluent Inc.
1Apache: Big Data Conference, Budapest, Hungary, September 29, 2015
 Developer Evangelist at Confluent since August ‘15
 Previously Big Data lead at .COM/.NET DNS operator Verisign
 Blogging at http://www.michael-noll.com/ (too little time!)
 PMC member of Apache Storm (too little time!)
 michael@confluent.io
2
 Founded in Fall 2014 by the creators of Apache Kafka
 Headquartered in San Francisco bay area
 We provide a stream data platform based on Kafka
 We contribute a lot to Kafka, obviously 
3
4
?
5
Apache Kafka is the distributed, durable equivalent of Unix pipes.
Use it to connect and compose your large-scale data apps.
this this
$ cat < in.txt | grep “apache” | tr a-z A-Z > out.txt
Example: LinkedIn before Kafka
6
Example: LinkedIn after Kafka
7
DB DB DB
Logs Sensors
Log search
Monitoring
Security
RT analytics
Filter
Transform
Aggregate
Data
Warehouse
Hadoop
HDFS
8
Apache Kafka is a high-throughput distributed messaging system.
“1,100,000,000,000 msg/day, totaling 175+ TB/day” (LinkedIn)
= 3 billion messages since the beginning of this talk
9
Apache Kafka is a publish-subscribe messaging
rethought as a distributed commit log.
Broker
Kafka Cluster
Broker Broker
Broker Broker Broker
Broker Broker Broker
Producer
Producer
Producer
Producer
Producer
Producer
Producer
Producer
Producer
Producer
Producer
Consumer
Producer
Producer
Consumer
Producer
Producer
Consumer
ZooKeeper
10
Apache Kafka is a publish-subscribe messaging
rethought as a distributed commit log.
Topic, e.g. “user_clicks”
NewestOldest
P P
CC
So where can Kafka help me?
Example, anyone?
11
12
13
YOU Why is Kafka a great fit here?
 Scalable Writes
 Scalable Reads
 Low latency
 Time machine
Example: Protecting your infrastructure against DDoS attacks
Kafka powers many use cases
• User behavior, click stream analysis
• Infrastructure monitoring and security, e.g. DDoS detection
• Fraud detection
• Operational telemetry data from mobile devices and sensors
• Analyzing system and app logging data
• Internet of Things (IoT) applications
• …and many more
• Yours is missing? Let me know via michael@confluent.io !
14
15https://cwiki.apache.org/confluence/display/KAFKA/Powered+By
Diverse and rapidly growing user base
across many industries and verticals.
A typical Kafka architecture
Yes, we now begin to approach “production”
16
17
Typical architecture => typical questions
18
Apps that
write to it
Source
systems
Apps that
read from it
Destination
systems
Question 3 Question 4
Data and
schemas
Question 5
Operations
Question 2
Question 6a Question 6b
Question 1
19
Wait a minute!
Kafka core
Question 1 or “What are the upcoming improvements to core Kafka?”
20
Apps that
write to it
Source
systems
Apps that
read from it
Destination
systems
Question 3 Question 4
Data and
schemas
Question 5
Operations
Question 2
Question 6a Question 6b
Kafka
Cluster
Question 1
Kafka core: upcoming changes in 0.9.0
• Kafka 0.9.0 (formerly 0.8.3) expected in November 2015
• ZooKeeper now only required for Kafka brokers
• ZK dependency removed from clients = producers and consumers
• Benefits include less load on ZK, lower operational complexity,
user apps don’t require interacting with ZK anymore
• New, unified consumer Java API
• We consolidated the previous “high-level” and “simple” consumer APIs
• Old APIs still available and not deprecated (yet)
21
New consumer Java API in 0.9.0
22
Configure
Subscribe
Process
Kafka core: upcoming changes in 0.9.0
• Improved data import/export via Copycat
• KIP-26: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=58851767
• Will talk about this later
• Improved security: SSL support for encrypted data transfer
• Yay, finally make your InfoSec team (a bit) happier!
• https://cwiki.apache.org/confluence/display/KAFKA/Deploying+SSL+for+Kafka
• Improved multi-tenancy: quotas aka throttling for Ps and Cs
• KIP-13: https://cwiki.apache.org/confluence/display/KAFKA/KIP-13+-+Quotas
• Quotas are defined per broker, will slow down clients if needed
• Reduces collateral damage caused by misbehaving apps/teams
23
Kafka operations
Question 2 or “How do I deploy, manage, monitor, etc. my Kafka clusters?”
24
Apps that
write to it
Source
systems
Apps that
read from it
Destination
systems
Question 3 Question 4
Data and
schemas
Question 5
Operations
Question 2
Question 6a Question 6b
Question 1
Deploying Kafka
• Hardware recommendations, configuration settings, etc.
• http://docs.confluent.io/current/kafka/deployment.html
• http://kafka.apache.org/documentation.html#hwandos
• Deploying Kafka itself = DIY at the moment
• Packages for Debian and RHEL OS families available via Confluent Platform
• http://www.confluent.io/developer
• Straight-forward to use orchestration tools like Puppet, Ansible
• Also: options for Docker, Mesos, YARN, …
25
Managing Kafka: CLI tools
• Kafka includes a plethora of CLI tools
• Managing topics, controlling replication, status of clients, …
• Can be tricky to understand which tool to use, when, and how
• Helpful pointers:
• https://cwiki.apache.org/confluence/display/KAFKA/System+Tools
• https://cwiki.apache.org/confluence/display/KAFKA/Replication+tools
• KIP-4 will eventually add better management APIs
26
Monitoring Kafka: metrics
• How to monitor
• Usual tools like Graphite, InfluxDB, statsd, Grafana, collectd, diamond
• What to monitor – some key metrics
• Host metrics: CPU, memory, disk I/O and usage, network I/O
• Kafka metrics: consumer lag, replication stats, message latency, Java GC
• ZooKeeper metrics: latency of requests, #outstanding requests
• Kafka exposes many built-in metrics via JMX
• Use e.g. jmxtrans to feed these metrics into Graphite, statsd, etc.
27
Monitoring Kafka: logging
• You can expect lots of logging data for larger Kafka clusters
• Centralized logging services help significantly
• You have one already, right?
• Elasticsearch/Kibana, Splunk, Loggly, …
• Further information about operations and monitoring at:
• http://docs.confluent.io/current/kafka/monitoring.html
• https://www.slideshare.net/miguno/apache-kafka-08-basic-training-
verisign
28
Kafka clients #1
Questions 3+4 or “How can my apps talk to Kafka?”
29
Apps that
write to it
Source
systems
Apps that
read from it
Destination
systems
Question 3 Question 4
Data and
schemas
Question 5
Operations
Question 2
Question 6a Question 6b
Question 1
Recommended* Kafka clients as of today
30
Language Name Link
Java <built-in> http://kafka.apache.org/
C/C++ librdkafka http://github.com/edenhill/librdkafka
Python kafka-python https://github.com/mumrah/kafka-python
Go sarama https://github.com/Shopify/sarama
Node kafka-node https://github.com/SOHU-Co/kafka-node/
Scala reactive kafka https://github.com/softwaremill/reactive-kafka
… … …
*Opinionated! Full list at https://cwiki.apache.org/confluence/display/KAFKA/Clients
Kafka clients: upcoming improvements
• Current problem: only Java client is officially supported
• A lot of effort and duplication for client maintainers to be compatible
with Kafka changes over time (e.g. protocol, ZK for offset management)
• Wait time for users until “their” client library is ready for latest Kafka
• Idea: use librdkafka (C) as the basis for Kafka clients and
provide bindings + idiomatic APIs per target language
• Benefits include:
• Full protocol support, SSL, etc. needs to be implemented only once
• All languages will benefit from the speed of the C implementation
• Of course you are always free to pick your favorite client!
31
Confluent Kafka-REST
• Open source, included in Confluent Platform
https://github.com/confluentinc/kafka-rest/
• Alternative to native clients
• Supports reading and writing data, status info, Avro, etc.
32
# Get a list of topics
$ curl "http://rest-proxy:8082/topics"
[ { "name":"userProfiles", "num_partitions": 3 },
{ "name":"locationUpdates", "num_partitions": 1 } ]
Kafka clients #2
Questions 3+4 or “How can my systems talk to Kafka?”
33
Apps that
write to it
Source
systems
Apps that
read from it
Destination
systems
Question 3 Question 4
Data and
schemas
Question 5
Operations
Question 2
Question 6a Question 6b
Question 1
34
? ?
Data import/export: status quo
• Until now this has been your problem to solve
• Only few tools available, e.g. LinkedIn Camus for Kafka  HDFS export
• Typically a DIY solution using the aforementioned client libs
• Kafka 0.9.0 will introduce Copycat
35
36
Copycat is the I/O redirection in your Unix pipelines.
Use it to get your data into and out of Kafka.
$ cat < in.txt | grep “apache” | tr a-z A-Z > out.txt
this this
Data import/export via Copycat
• Copycat is included in upcoming Kafka 0.9.0
• Federated Copycat “connector” development for e.g. HDFS, JDBC
• Light-weight, scales from simple testing and one-off jobs to large-scale
production scenarios serving an entire organization
• Process management agnostic, hence flexible deployment options
• Examples: Standalone, YARN, Mesos, or your own (e.g. Puppet w/ supervisord)
37
Copycat Copycat
<whatever> <whatever>
Data and schemas
Question 5 or “Je te comprends pas”
38
Apps that
write to it
Source
systems
Apps that
read from it
Destination
systems
Question 3 Question 4
Data and
schemas
Question 5
Operations
Question 2
Question 6a Question 6b
Question 1
39
40
Data and schemas
• Agree on contracts for data just like you do for, say, APIs
• Producers and consumers of data must understand each other
• Free-for-alls typically degenerate quickly into team deathmatches
• Benefit from clear contract, schema evolution, type safety, etc.
• Organizational problem rather than technical
• Hilarious /facepalm moments
• Been there, done that 
• Take a look at Apache Avro, Thrift, Protocol Buffers
• Cf. Avro homepage, https://github.com/miguno/avro-hadoop-starter
41
42
“Alternative” to schemas
43
Example: Avro schema for tweets
username
text
timestamp
44
“Tweet” = <definition>
“UserProfile” = <definition>
“Alert” = <definition>
<data> = <definition>
<data> = <definition>
<data> = <definition>
<data> = <definition>
<data> = <definition>
Schema registry
• Stores and retrieves your schemas
• Cornerstone for building resilient data pipelines
• Viable registry implementation missing until recently
• AVRO-1124 (2012-2014)
• So everyone started to roll their own schema registry
• Again: been there, done that 
• There must be a better way, right?
45
Confluent Schema Registry
• Open source, included in Confluent Platform
https://github.com/confluentinc/schema-registry/
• REST API to store and retrieve schemas etc.
• Integrates with Kafka clients, Kafka REST, Camus, ...
• Can enforce policies for your data, e.g. backwards compatibility
• Still not convinced you need a schema registry?
• http://www.confluent.io/blog/schema-registry-kafka-stream-processing-
yes-virginia-you-really-need-one
46
# List all schema versions registered for topic "foo"
$ curl -X GET -i http://registry:8081/subjects/foo/versions
Stream processing
Question 6 or “How do I actually process my data in Kafka?”
47
Apps that
write to it
Source
systems
Apps that
read from it
Destination
systems
Question 3 Question 4
Data and
schemas
Question 5
Operations
Question 2
Question 6a Question 6b
Question 1
Stream processing
• Currently three main options
• Storm: arguably powering the majority of production deployments
• Spark Streaming: runner-up, but gaining momentum due to “main” Spark
• DIY: write your own using Kafka client libs, typically with a narrower focus
48
49
Some people, when confronted with a
problem to process data in Kafka, think
“I know, I’ll use [ Storm | Spark | … ].”
Now they have two problems.
Stream processing
• Currently three main options
• Storm: arguably powering the majority of production deployments
• Spark Streaming: runner-up, but gaining momentum due to “main” Spark
• DIY: write your own using Kafka client libs, typically with a narrower focus
• Kafka 0.9.0 will introduce Kafka Streams
50
Four!
51
Kafka Streams is the commands in your Unix pipelines.
Use it to transform data stored in Kafka.
this this
$ cat < in.txt | grep “apache” | tr a-z A-Z > out.txt
Kafka Streams
• Kafka Streams included in Kafka 0.9.0
• KIP-28: https://cwiki.apache.org/confluence/display/KAFKA/KIP-28+-+Add+a+processor+client
• No need to run another framework like Storm alongside Kafka
• No need for separate infrastructure and trainings either
• Library rather than framework
• Won’t dictate your deployment, configuration management, packaging, …
• Use it like you’d use Apache Commons, Google Guava, etc.
• Easier to integrate with your existing apps and services
• 100% compatible with Kafka by definition
52
Kafka Streams
• Initial version will support
• Low-level API as well as higher-level API for Java 7+
• Operations such as join/filter/map/…
• Windowing
• Proper time modeling, e.g. event time vs. processing time
• Local state management with persistence and replication
• Schema and Avro support
• And more to come – details will be shared over the next weeks!
53
54
Example of higher-level API (much nicer with Java 8 and lambdas)
map()
filter()
Phew, we made it!
55
Apps that
write to it
Source
systems
Apps that
read from it
Destination
systems
Question 3 Question 4
Data and
schemas
Question 5
Operations
Question 2
Question 6a Question 6b
Question 1
56
Kafka
$ cat < in.txt | grep “apache” | tr a-z A-Z > out.txt
Kafka StreamsCopycat
Want to contribute to Kafka and open source?
57
Join the Kafka community
http://kafka.apache.org/
…in a great team with the creators of Kafka
and also getting paid for it?
Confluent is hiring 
http://confluent.io/
Questions, comments? Tweet with #ApacheBigData and /cc to @ConfluentInc

More Related Content

What's hot (20)

PPTX
Fundamentals of Stream Processing with Apache Beam, Tyler Akidau, Frances Perry
confluent
 
PPTX
January 2016 Flink Community Update & Roadmap 2016
Robert Metzger
 
PPTX
Data Architectures for Robust Decision Making
Gwen (Chen) Shapira
 
PPT
Distributed and Fault Tolerant Realtime Computation with Apache Storm, Apache...
Folio3 Software
 
PPTX
Real Time Data Processing Using Spark Streaming
Hari Shreedharan
 
PPTX
Kafka connect-london-meetup-2016
Gwen (Chen) Shapira
 
PPTX
Performance Comparison of Streaming Big Data Platforms
DataWorks Summit/Hadoop Summit
 
PPTX
Spark Streaming Recipes and "Exactly Once" Semantics Revised
Michael Spector
 
PDF
Event-Driven Stream Processing and Model Deployment with Apache Kafka, Kafka ...
Kai Wähner
 
PDF
[Spark Summit EU 2017] Apache spark streaming + kafka 0.10 an integration story
Joan Viladrosa Riera
 
KEY
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Erik Onnen
 
PDF
Developing Real-Time Data Pipelines with Apache Kafka
Joe Stein
 
PDF
Operationalizing Machine Learning: Serving ML Models
Lightbend
 
PPTX
Exactly-once Stream Processing with Kafka Streams
Guozhang Wang
 
PPTX
Apache Samza: Reliable Stream Processing Atop Apache Kafka and Hadoop YARN
blueboxtraveler
 
PDF
Five Fabulous Sinks for Your Kafka Data. #3 will surprise you! (Rachel Pedres...
confluent
 
PPTX
Akka 2.4 plus new commercial features in Typesafe Reactive Platform
Legacy Typesafe (now Lightbend)
 
PDF
Power of the Log: LSM & Append Only Data Structures
confluent
 
PDF
Flink at netflix paypal speaker series
Monal Daxini
 
PPTX
Why apache Flink is the 4G of Big Data Analytics Frameworks
Slim Baltagi
 
Fundamentals of Stream Processing with Apache Beam, Tyler Akidau, Frances Perry
confluent
 
January 2016 Flink Community Update & Roadmap 2016
Robert Metzger
 
Data Architectures for Robust Decision Making
Gwen (Chen) Shapira
 
Distributed and Fault Tolerant Realtime Computation with Apache Storm, Apache...
Folio3 Software
 
Real Time Data Processing Using Spark Streaming
Hari Shreedharan
 
Kafka connect-london-meetup-2016
Gwen (Chen) Shapira
 
Performance Comparison of Streaming Big Data Platforms
DataWorks Summit/Hadoop Summit
 
Spark Streaming Recipes and "Exactly Once" Semantics Revised
Michael Spector
 
Event-Driven Stream Processing and Model Deployment with Apache Kafka, Kafka ...
Kai Wähner
 
[Spark Summit EU 2017] Apache spark streaming + kafka 0.10 an integration story
Joan Viladrosa Riera
 
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Erik Onnen
 
Developing Real-Time Data Pipelines with Apache Kafka
Joe Stein
 
Operationalizing Machine Learning: Serving ML Models
Lightbend
 
Exactly-once Stream Processing with Kafka Streams
Guozhang Wang
 
Apache Samza: Reliable Stream Processing Atop Apache Kafka and Hadoop YARN
blueboxtraveler
 
Five Fabulous Sinks for Your Kafka Data. #3 will surprise you! (Rachel Pedres...
confluent
 
Akka 2.4 plus new commercial features in Typesafe Reactive Platform
Legacy Typesafe (now Lightbend)
 
Power of the Log: LSM & Append Only Data Structures
confluent
 
Flink at netflix paypal speaker series
Monal Daxini
 
Why apache Flink is the 4G of Big Data Analytics Frameworks
Slim Baltagi
 

Viewers also liked (6)

PPTX
Introducing Apache Kafka's Streams API - Kafka meetup Munich, Jan 25 2017
Michael Noll
 
PPTX
Tuning kafka pipelines
Sumant Tambe
 
PPTX
Apache Storm 0.9 basic training - Verisign
Michael Noll
 
PPTX
Apache Kafka 0.8 basic training - Verisign
Michael Noll
 
PPTX
Apache Kafka Best Practices
DataWorks Summit/Hadoop Summit
 
PDF
[Big Data Spain] Apache Spark Streaming + Kafka 0.10: an Integration Story
Joan Viladrosa Riera
 
Introducing Apache Kafka's Streams API - Kafka meetup Munich, Jan 25 2017
Michael Noll
 
Tuning kafka pipelines
Sumant Tambe
 
Apache Storm 0.9 basic training - Verisign
Michael Noll
 
Apache Kafka 0.8 basic training - Verisign
Michael Noll
 
Apache Kafka Best Practices
DataWorks Summit/Hadoop Summit
 
[Big Data Spain] Apache Spark Streaming + Kafka 0.10: an Integration Story
Joan Viladrosa Riera
 
Ad

Similar to Being Ready for Apache Kafka - Apache: Big Data Europe 2015 (20)

PPTX
Building streaming data applications using Kafka*[Connect + Core + Streams] b...
Data Con LA
 
PPT
Kafka Explainaton
NguyenChiHoangMinh
 
PDF
Building Streaming Data Applications Using Apache Kafka
Slim Baltagi
 
PPTX
Kafka Streams for Java enthusiasts
Slim Baltagi
 
PDF
Apache Kafka - Scalable Message-Processing and more !
Guido Schmutz
 
PPTX
Real-Time Log Analysis with Apache Mesos, Kafka and Cassandra
Joe Stein
 
PPTX
Introduction Apache Kafka
Joe Stein
 
PPTX
Building Event-Driven Systems with Apache Kafka
Brian Ritchie
 
PPTX
Data Pipelines with Kafka Connect
Kaufman Ng
 
PDF
OSSNA Building Modern Data Streaming Apps
Timothy Spann
 
PDF
Event-Driven Model Serving: Stream Processing vs. RPC with Kafka and TensorFl...
confluent
 
PDF
Big Data Open Source Security LLC: Realtime log analysis with Mesos, Docker, ...
DataStax Academy
 
PDF
Introducing Kafka's Streams API
confluent
 
PPTX
Sas 2015 event_driven
Sascha Möllering
 
PDF
Budapest Data/ML - Building Modern Data Streaming Apps with NiFi, Flink and K...
Timothy Spann
 
PPTX
Distributed messaging through Kafka
Dileep Kalidindi
 
PDF
Trivadis TechEvent 2016 Apache Kafka - Scalable Massage Processing and more! ...
Trivadis
 
PPTX
Stream your Operational Data with Apache Spark & Kafka into Hadoop using Couc...
Data Con LA
 
PPTX
Current and Future of Apache Kafka
Joe Stein
 
PDF
Python Kafka Integration: Developers Guide
Inexture Solutions
 
Building streaming data applications using Kafka*[Connect + Core + Streams] b...
Data Con LA
 
Kafka Explainaton
NguyenChiHoangMinh
 
Building Streaming Data Applications Using Apache Kafka
Slim Baltagi
 
Kafka Streams for Java enthusiasts
Slim Baltagi
 
Apache Kafka - Scalable Message-Processing and more !
Guido Schmutz
 
Real-Time Log Analysis with Apache Mesos, Kafka and Cassandra
Joe Stein
 
Introduction Apache Kafka
Joe Stein
 
Building Event-Driven Systems with Apache Kafka
Brian Ritchie
 
Data Pipelines with Kafka Connect
Kaufman Ng
 
OSSNA Building Modern Data Streaming Apps
Timothy Spann
 
Event-Driven Model Serving: Stream Processing vs. RPC with Kafka and TensorFl...
confluent
 
Big Data Open Source Security LLC: Realtime log analysis with Mesos, Docker, ...
DataStax Academy
 
Introducing Kafka's Streams API
confluent
 
Sas 2015 event_driven
Sascha Möllering
 
Budapest Data/ML - Building Modern Data Streaming Apps with NiFi, Flink and K...
Timothy Spann
 
Distributed messaging through Kafka
Dileep Kalidindi
 
Trivadis TechEvent 2016 Apache Kafka - Scalable Massage Processing and more! ...
Trivadis
 
Stream your Operational Data with Apache Spark & Kafka into Hadoop using Couc...
Data Con LA
 
Current and Future of Apache Kafka
Joe Stein
 
Python Kafka Integration: Developers Guide
Inexture Solutions
 
Ad

Recently uploaded (20)

PPTX
SlideEgg_501298-Agentic AI.pptx agentic ai
530BYManoj
 
PDF
Business implication of Artificial Intelligence.pdf
VishalChugh12
 
PPTX
在线购买英国本科毕业证苏格兰皇家音乐学院水印成绩单RSAMD学费发票
Taqyea
 
PDF
The Best NVIDIA GPUs for LLM Inference in 2025.pdf
Tamanna36
 
PPTX
thid ppt defines the ich guridlens and gives the information about the ICH gu...
shaistabegum14
 
PPTX
Powerful Uses of Data Analytics You Should Know
subhashenia
 
PPTX
SHREYAS25 INTERN-I,II,III PPT (1).pptx pre
swapnilherage
 
PPTX
Comparative Study of ML Techniques for RealTime Credit Card Fraud Detection S...
Debolina Ghosh
 
PDF
InformaticsPractices-MS - Google Docs.pdf
seshuashwin0829
 
PDF
Group 5_RMB Final Project on circular economy
pgban24anmola
 
PDF
apidays Singapore 2025 - Surviving an interconnected world with API governanc...
apidays
 
PDF
Unlocking Insights: Introducing i-Metrics Asia-Pacific Corporation and Strate...
Janette Toral
 
PDF
SQL for Accountants and Finance Managers
ysmaelreyes
 
PDF
Using AI/ML for Space Biology Research
VICTOR MAESTRE RAMIREZ
 
PPTX
What Is Data Integration and Transformation?
subhashenia
 
PDF
NIS2 Compliance for MSPs: Roadmap, Benefits & Cybersecurity Trends (2025 Guide)
GRC Kompas
 
PPTX
03_Ariane BERCKMOES_Ethias.pptx_AIBarometer_release_event
FinTech Belgium
 
PDF
1750162332_Snapshot-of-Indias-oil-Gas-data-May-2025.pdf
sandeep718278
 
PPTX
Listify-Intelligent-Voice-to-Catalog-Agent.pptx
nareshkottees
 
PDF
apidays Singapore 2025 - How APIs can make - or break - trust in your AI by S...
apidays
 
SlideEgg_501298-Agentic AI.pptx agentic ai
530BYManoj
 
Business implication of Artificial Intelligence.pdf
VishalChugh12
 
在线购买英国本科毕业证苏格兰皇家音乐学院水印成绩单RSAMD学费发票
Taqyea
 
The Best NVIDIA GPUs for LLM Inference in 2025.pdf
Tamanna36
 
thid ppt defines the ich guridlens and gives the information about the ICH gu...
shaistabegum14
 
Powerful Uses of Data Analytics You Should Know
subhashenia
 
SHREYAS25 INTERN-I,II,III PPT (1).pptx pre
swapnilherage
 
Comparative Study of ML Techniques for RealTime Credit Card Fraud Detection S...
Debolina Ghosh
 
InformaticsPractices-MS - Google Docs.pdf
seshuashwin0829
 
Group 5_RMB Final Project on circular economy
pgban24anmola
 
apidays Singapore 2025 - Surviving an interconnected world with API governanc...
apidays
 
Unlocking Insights: Introducing i-Metrics Asia-Pacific Corporation and Strate...
Janette Toral
 
SQL for Accountants and Finance Managers
ysmaelreyes
 
Using AI/ML for Space Biology Research
VICTOR MAESTRE RAMIREZ
 
What Is Data Integration and Transformation?
subhashenia
 
NIS2 Compliance for MSPs: Roadmap, Benefits & Cybersecurity Trends (2025 Guide)
GRC Kompas
 
03_Ariane BERCKMOES_Ethias.pptx_AIBarometer_release_event
FinTech Belgium
 
1750162332_Snapshot-of-Indias-oil-Gas-data-May-2025.pdf
sandeep718278
 
Listify-Intelligent-Voice-to-Catalog-Agent.pptx
nareshkottees
 
apidays Singapore 2025 - How APIs can make - or break - trust in your AI by S...
apidays
 

Being Ready for Apache Kafka - Apache: Big Data Europe 2015

  • 1. Being Ready for Apache Kafka: Today’s Ecosystem and Future Roadmap Michael G. Noll @miguno Developer Evangelist, Confluent Inc. 1Apache: Big Data Conference, Budapest, Hungary, September 29, 2015
  • 2.  Developer Evangelist at Confluent since August ‘15  Previously Big Data lead at .COM/.NET DNS operator Verisign  Blogging at http://www.michael-noll.com/ (too little time!)  PMC member of Apache Storm (too little time!)  [email protected] 2
  • 3.  Founded in Fall 2014 by the creators of Apache Kafka  Headquartered in San Francisco bay area  We provide a stream data platform based on Kafka  We contribute a lot to Kafka, obviously  3
  • 4. 4 ?
  • 5. 5 Apache Kafka is the distributed, durable equivalent of Unix pipes. Use it to connect and compose your large-scale data apps. this this $ cat < in.txt | grep “apache” | tr a-z A-Z > out.txt
  • 7. Example: LinkedIn after Kafka 7 DB DB DB Logs Sensors Log search Monitoring Security RT analytics Filter Transform Aggregate Data Warehouse Hadoop HDFS
  • 8. 8 Apache Kafka is a high-throughput distributed messaging system. “1,100,000,000,000 msg/day, totaling 175+ TB/day” (LinkedIn) = 3 billion messages since the beginning of this talk
  • 9. 9 Apache Kafka is a publish-subscribe messaging rethought as a distributed commit log. Broker Kafka Cluster Broker Broker Broker Broker Broker Broker Broker Broker Producer Producer Producer Producer Producer Producer Producer Producer Producer Producer Producer Consumer Producer Producer Consumer Producer Producer Consumer ZooKeeper
  • 10. 10 Apache Kafka is a publish-subscribe messaging rethought as a distributed commit log. Topic, e.g. “user_clicks” NewestOldest P P CC
  • 11. So where can Kafka help me? Example, anyone? 11
  • 12. 12
  • 13. 13 YOU Why is Kafka a great fit here?  Scalable Writes  Scalable Reads  Low latency  Time machine Example: Protecting your infrastructure against DDoS attacks
  • 14. Kafka powers many use cases • User behavior, click stream analysis • Infrastructure monitoring and security, e.g. DDoS detection • Fraud detection • Operational telemetry data from mobile devices and sensors • Analyzing system and app logging data • Internet of Things (IoT) applications • …and many more • Yours is missing? Let me know via [email protected] ! 14
  • 16. A typical Kafka architecture Yes, we now begin to approach “production” 16
  • 17. 17
  • 18. Typical architecture => typical questions 18 Apps that write to it Source systems Apps that read from it Destination systems Question 3 Question 4 Data and schemas Question 5 Operations Question 2 Question 6a Question 6b Question 1
  • 20. Kafka core Question 1 or “What are the upcoming improvements to core Kafka?” 20 Apps that write to it Source systems Apps that read from it Destination systems Question 3 Question 4 Data and schemas Question 5 Operations Question 2 Question 6a Question 6b Kafka Cluster Question 1
  • 21. Kafka core: upcoming changes in 0.9.0 • Kafka 0.9.0 (formerly 0.8.3) expected in November 2015 • ZooKeeper now only required for Kafka brokers • ZK dependency removed from clients = producers and consumers • Benefits include less load on ZK, lower operational complexity, user apps don’t require interacting with ZK anymore • New, unified consumer Java API • We consolidated the previous “high-level” and “simple” consumer APIs • Old APIs still available and not deprecated (yet) 21
  • 22. New consumer Java API in 0.9.0 22 Configure Subscribe Process
  • 23. Kafka core: upcoming changes in 0.9.0 • Improved data import/export via Copycat • KIP-26: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=58851767 • Will talk about this later • Improved security: SSL support for encrypted data transfer • Yay, finally make your InfoSec team (a bit) happier! • https://cwiki.apache.org/confluence/display/KAFKA/Deploying+SSL+for+Kafka • Improved multi-tenancy: quotas aka throttling for Ps and Cs • KIP-13: https://cwiki.apache.org/confluence/display/KAFKA/KIP-13+-+Quotas • Quotas are defined per broker, will slow down clients if needed • Reduces collateral damage caused by misbehaving apps/teams 23
  • 24. Kafka operations Question 2 or “How do I deploy, manage, monitor, etc. my Kafka clusters?” 24 Apps that write to it Source systems Apps that read from it Destination systems Question 3 Question 4 Data and schemas Question 5 Operations Question 2 Question 6a Question 6b Question 1
  • 25. Deploying Kafka • Hardware recommendations, configuration settings, etc. • http://docs.confluent.io/current/kafka/deployment.html • http://kafka.apache.org/documentation.html#hwandos • Deploying Kafka itself = DIY at the moment • Packages for Debian and RHEL OS families available via Confluent Platform • http://www.confluent.io/developer • Straight-forward to use orchestration tools like Puppet, Ansible • Also: options for Docker, Mesos, YARN, … 25
  • 26. Managing Kafka: CLI tools • Kafka includes a plethora of CLI tools • Managing topics, controlling replication, status of clients, … • Can be tricky to understand which tool to use, when, and how • Helpful pointers: • https://cwiki.apache.org/confluence/display/KAFKA/System+Tools • https://cwiki.apache.org/confluence/display/KAFKA/Replication+tools • KIP-4 will eventually add better management APIs 26
  • 27. Monitoring Kafka: metrics • How to monitor • Usual tools like Graphite, InfluxDB, statsd, Grafana, collectd, diamond • What to monitor – some key metrics • Host metrics: CPU, memory, disk I/O and usage, network I/O • Kafka metrics: consumer lag, replication stats, message latency, Java GC • ZooKeeper metrics: latency of requests, #outstanding requests • Kafka exposes many built-in metrics via JMX • Use e.g. jmxtrans to feed these metrics into Graphite, statsd, etc. 27
  • 28. Monitoring Kafka: logging • You can expect lots of logging data for larger Kafka clusters • Centralized logging services help significantly • You have one already, right? • Elasticsearch/Kibana, Splunk, Loggly, … • Further information about operations and monitoring at: • http://docs.confluent.io/current/kafka/monitoring.html • https://www.slideshare.net/miguno/apache-kafka-08-basic-training- verisign 28
  • 29. Kafka clients #1 Questions 3+4 or “How can my apps talk to Kafka?” 29 Apps that write to it Source systems Apps that read from it Destination systems Question 3 Question 4 Data and schemas Question 5 Operations Question 2 Question 6a Question 6b Question 1
  • 30. Recommended* Kafka clients as of today 30 Language Name Link Java <built-in> http://kafka.apache.org/ C/C++ librdkafka http://github.com/edenhill/librdkafka Python kafka-python https://github.com/mumrah/kafka-python Go sarama https://github.com/Shopify/sarama Node kafka-node https://github.com/SOHU-Co/kafka-node/ Scala reactive kafka https://github.com/softwaremill/reactive-kafka … … … *Opinionated! Full list at https://cwiki.apache.org/confluence/display/KAFKA/Clients
  • 31. Kafka clients: upcoming improvements • Current problem: only Java client is officially supported • A lot of effort and duplication for client maintainers to be compatible with Kafka changes over time (e.g. protocol, ZK for offset management) • Wait time for users until “their” client library is ready for latest Kafka • Idea: use librdkafka (C) as the basis for Kafka clients and provide bindings + idiomatic APIs per target language • Benefits include: • Full protocol support, SSL, etc. needs to be implemented only once • All languages will benefit from the speed of the C implementation • Of course you are always free to pick your favorite client! 31
  • 32. Confluent Kafka-REST • Open source, included in Confluent Platform https://github.com/confluentinc/kafka-rest/ • Alternative to native clients • Supports reading and writing data, status info, Avro, etc. 32 # Get a list of topics $ curl "http://rest-proxy:8082/topics" [ { "name":"userProfiles", "num_partitions": 3 }, { "name":"locationUpdates", "num_partitions": 1 } ]
  • 33. Kafka clients #2 Questions 3+4 or “How can my systems talk to Kafka?” 33 Apps that write to it Source systems Apps that read from it Destination systems Question 3 Question 4 Data and schemas Question 5 Operations Question 2 Question 6a Question 6b Question 1
  • 35. Data import/export: status quo • Until now this has been your problem to solve • Only few tools available, e.g. LinkedIn Camus for Kafka  HDFS export • Typically a DIY solution using the aforementioned client libs • Kafka 0.9.0 will introduce Copycat 35
  • 36. 36 Copycat is the I/O redirection in your Unix pipelines. Use it to get your data into and out of Kafka. $ cat < in.txt | grep “apache” | tr a-z A-Z > out.txt this this
  • 37. Data import/export via Copycat • Copycat is included in upcoming Kafka 0.9.0 • Federated Copycat “connector” development for e.g. HDFS, JDBC • Light-weight, scales from simple testing and one-off jobs to large-scale production scenarios serving an entire organization • Process management agnostic, hence flexible deployment options • Examples: Standalone, YARN, Mesos, or your own (e.g. Puppet w/ supervisord) 37 Copycat Copycat <whatever> <whatever>
  • 38. Data and schemas Question 5 or “Je te comprends pas” 38 Apps that write to it Source systems Apps that read from it Destination systems Question 3 Question 4 Data and schemas Question 5 Operations Question 2 Question 6a Question 6b Question 1
  • 39. 39
  • 40. 40
  • 41. Data and schemas • Agree on contracts for data just like you do for, say, APIs • Producers and consumers of data must understand each other • Free-for-alls typically degenerate quickly into team deathmatches • Benefit from clear contract, schema evolution, type safety, etc. • Organizational problem rather than technical • Hilarious /facepalm moments • Been there, done that  • Take a look at Apache Avro, Thrift, Protocol Buffers • Cf. Avro homepage, https://github.com/miguno/avro-hadoop-starter 41
  • 43. 43 Example: Avro schema for tweets username text timestamp
  • 44. 44 “Tweet” = <definition> “UserProfile” = <definition> “Alert” = <definition> <data> = <definition> <data> = <definition> <data> = <definition> <data> = <definition> <data> = <definition>
  • 45. Schema registry • Stores and retrieves your schemas • Cornerstone for building resilient data pipelines • Viable registry implementation missing until recently • AVRO-1124 (2012-2014) • So everyone started to roll their own schema registry • Again: been there, done that  • There must be a better way, right? 45
  • 46. Confluent Schema Registry • Open source, included in Confluent Platform https://github.com/confluentinc/schema-registry/ • REST API to store and retrieve schemas etc. • Integrates with Kafka clients, Kafka REST, Camus, ... • Can enforce policies for your data, e.g. backwards compatibility • Still not convinced you need a schema registry? • http://www.confluent.io/blog/schema-registry-kafka-stream-processing- yes-virginia-you-really-need-one 46 # List all schema versions registered for topic "foo" $ curl -X GET -i http://registry:8081/subjects/foo/versions
  • 47. Stream processing Question 6 or “How do I actually process my data in Kafka?” 47 Apps that write to it Source systems Apps that read from it Destination systems Question 3 Question 4 Data and schemas Question 5 Operations Question 2 Question 6a Question 6b Question 1
  • 48. Stream processing • Currently three main options • Storm: arguably powering the majority of production deployments • Spark Streaming: runner-up, but gaining momentum due to “main” Spark • DIY: write your own using Kafka client libs, typically with a narrower focus 48
  • 49. 49 Some people, when confronted with a problem to process data in Kafka, think “I know, I’ll use [ Storm | Spark | … ].” Now they have two problems.
  • 50. Stream processing • Currently three main options • Storm: arguably powering the majority of production deployments • Spark Streaming: runner-up, but gaining momentum due to “main” Spark • DIY: write your own using Kafka client libs, typically with a narrower focus • Kafka 0.9.0 will introduce Kafka Streams 50 Four!
  • 51. 51 Kafka Streams is the commands in your Unix pipelines. Use it to transform data stored in Kafka. this this $ cat < in.txt | grep “apache” | tr a-z A-Z > out.txt
  • 52. Kafka Streams • Kafka Streams included in Kafka 0.9.0 • KIP-28: https://cwiki.apache.org/confluence/display/KAFKA/KIP-28+-+Add+a+processor+client • No need to run another framework like Storm alongside Kafka • No need for separate infrastructure and trainings either • Library rather than framework • Won’t dictate your deployment, configuration management, packaging, … • Use it like you’d use Apache Commons, Google Guava, etc. • Easier to integrate with your existing apps and services • 100% compatible with Kafka by definition 52
  • 53. Kafka Streams • Initial version will support • Low-level API as well as higher-level API for Java 7+ • Operations such as join/filter/map/… • Windowing • Proper time modeling, e.g. event time vs. processing time • Local state management with persistence and replication • Schema and Avro support • And more to come – details will be shared over the next weeks! 53
  • 54. 54 Example of higher-level API (much nicer with Java 8 and lambdas) map() filter()
  • 55. Phew, we made it! 55 Apps that write to it Source systems Apps that read from it Destination systems Question 3 Question 4 Data and schemas Question 5 Operations Question 2 Question 6a Question 6b Question 1
  • 56. 56 Kafka $ cat < in.txt | grep “apache” | tr a-z A-Z > out.txt Kafka StreamsCopycat
  • 57. Want to contribute to Kafka and open source? 57 Join the Kafka community http://kafka.apache.org/ …in a great team with the creators of Kafka and also getting paid for it? Confluent is hiring  http://confluent.io/ Questions, comments? Tweet with #ApacheBigData and /cc to @ConfluentInc

Editor's Notes

  • #5: Audience check: Who has used Kafka before? In production? Happy with it?
  • #8: Among many other things Kafka allows you to decouple and simplify your architecture.
  • #14: Writes: Kafka is able to collect large volumes of data. Reads: Kafka supports many downstream consumers because of its great fan-out performance. Different apps, algorithms, teams can collaborate to defend DDoS attacks. Low latency: Kafka allows downstream applications to analyze this data in real-time. For DDoS attacks fast reaction time is crucial to minimize damage. Time machine: Kafka retains your data for days, weeks, or more. You can rewind in time to e.g. perform A/B tests, rectify miscomputation caused by bugs in your apps, etc. For DDoS attacks this helps to optimize algorithms to minimize false positives, which cause collateral damage.
  • #15: Kafka is an infrastructure tool which is why it's widely applicable. It uses a very specific data model to achieve high performance, but otherwise is very generic.
  • #18: Given the scope and time limits of the talk we will focus on breadth, not depth. Feel free to find me after the talk or reach out via email or Twitter if you have questions that weren’t answered in the talk! 
  • #20: We’ll cover many things and areas in the next slides. But don’t let this mislead you – Kafka is actually one of the most easiest Big Data tools to get started with and to operate in production. For example, in my experience you are significantly more likely to run into problems with any stream processing tools that integrate with Kafka, such as Storm or Spark Streaming.
  • #24: We’ll talk about Kafka Streams later.
  • #35: If you think the consensus problem in distributed systems is hard…
  • #38: Process and resource management is orthogonal to Copycat's runtime model. The framework is not responsible for starting/stopping/restarting processes and can be used with any process management strategy, including YARN, Mesos, Kubernetes, or none if you prefer to manage processes manually or through other orchestration tools. Copycat supports standalone mode. You could very easily use this to deliver logs to Kafka using standalone mode instances on all your servers.
  • #40: If you think the consensus problem in distributed systems is hard…
  • #41: If you think the consensus problem in distributed systems is hard…
  • #43: The alternative to schemas: meetings between teams, tribal knowledge, … = the opposite of being agile and fast
  • #55: Similar to Java API of Spark Streaming.