SlideShare a Scribd company logo
Kafka & message bus
Robin GRAILLON & Alexandre ANDRÉ
12/10/2016
Synchronous
● Call
● Processing
○ Might be long
● Response
Asynchronous
● Call
● Response
● Post-Processing
Message Bus
● Events aggregation
● CQRS oriented
● µS oriented
● Event sourcing oriented
● Language agnostic
● Multiple implementations
○ RabbitMQ
○ Kafka
○ etc.
Apache Kafka
● LinkedIn creation
● Open sourced in 2011
● Filesystem oriented
● Wrote in Scala
● Highly scalable
● Used by big companies
○ LinkedIn
○ Netflix
○ Spotify
○ Meetic
LinkedIn statistics
● 800 billion m/day
○ 175 TB
● 13 million m/sec
○ 2.75 GB
● 1100 kafka instances
○ 60 clusters
Basic workflow
Producer 1
Producer 2
Producer 3
Producer X
Consumer 1
Consumer 2
Consumer 3
Consumer Y
Kafka Stack
Kafka stack
● Zookeeper : scalability, manager
● Kafka broker : kafka server instance
● Consumer : consumes events and do things
● Producer : produces events (like user as connected)
● topic : event name
● partition : way to split messages between brokers
Kafka partitions (1)
For one topic (let’s say “astronaut.connection”)
Kafka stack & partitions
Let’s play...
...but easily !
./console run
HELP
run:zk run zookeeper
kill:zk kill zookeeper
run:kk run kafka
kill:kk kill kafka
producer run producer on topic
consumer run consumer on topic
t:c create a topic
t:d delete a topic
t:l list topics
What do you want to do?
Step 1: launch Zookeeper!
What do you want to do? run:zk
Configuration file? [./zookeeper.properties]
Port? [2181]
./../bin/zookeeper-server-start.sh ./zookeeper.properties
What do you want to do?
Step 2: launch Kafka!
What do you want to do? run:kk
Step 3: list topics!
What do you want to do? t:l
Zookeeper host? [localhost:2181]
./../bin/kafka-topics.sh --list --zookeeper localhost:2181
What do you want to do?
Step 4: create a topic!
What do you want to do? t:c
Topic name? [test]
Zookeeper host? [localhost:2181]
Partitions? [1]
Replication factor? [1]
./../bin/kafka-topics.sh --create --zookeeper localhost:2181 --topic test
--partitions 1 --replication-factor 1
Created topic "test".
What do you want to do?
Step 5: list topics AGAIIIIN!
What do you want to do? t:l
Zookeeper host? [localhost:2181]
./../bin/kafka-topics.sh --list --zookeeper localhost:2181
test
What do you want to do?
Step 6: run a consumer!
New terminal !
$ ./console run
What do you want to do? consumer
Topic name? [test]
Zookeeper host? [localhost:2181]
From beginning? [1]
./../bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test
--from-beginning
Step 7: generate data!
What do you want to do? g
Message? [I'm an astronaut!]
How many times? [1] 10000000
File? [data_10000000.txt]
10000000/10000000 [============================] 100%
Step 8: produce events!
Back to the other terminal
What do you want to do? p
Topic name? [test]
brokers? [localhost:9092]
data_10000000.txt
Dataset to use? [data_10000000.txt]
./../bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test <
./data/data_10000000.txt
GroupId: experiment 1
● 2 groupId
● 2 partitions
● 2 consumers
GroupId: experiment 2
● 1 groupId
● 2 consumer
Documentation/resources
● Kafka quick setup
https://kafka.apache.org/quickstart
● Kafka at LinkedIn
https://engineering.linkedin.com/kafka/running-kafka-scale
● Why zookeeper ?
https://www.quora.com/What-is-the-actual-role-of-ZooKeeper-in-Kafka
Titre 1 Titre 2

More Related Content

What's hot (20)

KEY
Event machine
almeidaricardo
 
PDF
Cortex: Prometheus as a Service, One Year On
Kausal
 
PPTX
Scaling an ELK stack at bol.com
Renzo Tomà
 
PDF
PharoDAYS 2015: Pharo Status - by Markus Denker
Pharo
 
PPTX
BSides London - Scapy Workshop
Adam Maxwell
 
PDF
GeoDistributed datacenter: the DNS way
Moyd.co LTD
 
PDF
Ansible with AWS
Allan Denot
 
PDF
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Puppet
 
PDF
8 Ways Network Engineers use Snabb (RIPE 77)
Igalia
 
PDF
Fluentd v1 and future at techtalk
N Masahiro
 
PDF
Docker Workshop - Orchestrating Docker Containers
Hugo Henley
 
ODP
AGES Presentation on Web, Python, Django and GeoServer
Ng'eno Victor
 
PDF
Beyond Fault Tolerance with Actor Programming
Fabio Tiriticco
 
PDF
Woo: Writing a fast web server @ ELS2015
fukamachi
 
PDF
Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"
Fwdays
 
PPT
Ruby eventmachine pres at rubybdx
Mathieu Elie
 
PDF
Sphinx && Perl Houston Perl Mongers - May 8th, 2014
Brett Estrade
 
ODP
Developing high-performance network servers in Lisp
Vladimir Sedach
 
PDF
Pharo Status Fosdem 2015
Marcus Denker
 
KEY
Writing Better Haskell
nkpart
 
Event machine
almeidaricardo
 
Cortex: Prometheus as a Service, One Year On
Kausal
 
Scaling an ELK stack at bol.com
Renzo Tomà
 
PharoDAYS 2015: Pharo Status - by Markus Denker
Pharo
 
BSides London - Scapy Workshop
Adam Maxwell
 
GeoDistributed datacenter: the DNS way
Moyd.co LTD
 
Ansible with AWS
Allan Denot
 
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Puppet
 
8 Ways Network Engineers use Snabb (RIPE 77)
Igalia
 
Fluentd v1 and future at techtalk
N Masahiro
 
Docker Workshop - Orchestrating Docker Containers
Hugo Henley
 
AGES Presentation on Web, Python, Django and GeoServer
Ng'eno Victor
 
Beyond Fault Tolerance with Actor Programming
Fabio Tiriticco
 
Woo: Writing a fast web server @ ELS2015
fukamachi
 
Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"
Fwdays
 
Ruby eventmachine pres at rubybdx
Mathieu Elie
 
Sphinx && Perl Houston Perl Mongers - May 8th, 2014
Brett Estrade
 
Developing high-performance network servers in Lisp
Vladimir Sedach
 
Pharo Status Fosdem 2015
Marcus Denker
 
Writing Better Haskell
nkpart
 

Similar to Kafka Workshop (20)

PDF
Apache Kafka Introduction
Amita Mirajkar
 
PPTX
Message queue demo
DataArt
 
DOCX
Apache kafka configuration-guide
Chetan Khatri
 
PPTX
Introduction Apache Kafka
Joe Stein
 
PDF
Apache kafka
NexThoughts Technologies
 
ODP
Apache Kafka Demo
Edward Capriolo
 
PDF
Introduction to apache kafka
Samuel Kerrien
 
PDF
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
mumrah
 
PDF
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
Guido Schmutz
 
PDF
Apache KAfka
Pedro Alcantara
 
PPTX
Kafka blr-meetup-presentation - Kafka internals
Ayyappadas Ravindran (Appu)
 
PDF
14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...
Athens Big Data
 
PDF
Stream Processing with Apache Kafka and .NET
confluent
 
PPTX
Building an Event Bus at Scale
jimriecken
 
PPTX
Copy of Kafka-Camus
Deep Shah
 
PDF
Sparkstreaming
Marilyn Waldman
 
PDF
Developing Realtime Data Pipelines With Apache Kafka
Joe Stein
 
DOCX
Kafk a with zoo keeper setup documentation
Thiyagarajan saminadane
 
PDF
Introduction to Apache Kafka
Shiao-An Yuan
 
PDF
Apache Kafka Architecture & Fundamentals Explained
confluent
 
Apache Kafka Introduction
Amita Mirajkar
 
Message queue demo
DataArt
 
Apache kafka configuration-guide
Chetan Khatri
 
Introduction Apache Kafka
Joe Stein
 
Apache Kafka Demo
Edward Capriolo
 
Introduction to apache kafka
Samuel Kerrien
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
mumrah
 
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
Guido Schmutz
 
Apache KAfka
Pedro Alcantara
 
Kafka blr-meetup-presentation - Kafka internals
Ayyappadas Ravindran (Appu)
 
14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...
Athens Big Data
 
Stream Processing with Apache Kafka and .NET
confluent
 
Building an Event Bus at Scale
jimriecken
 
Copy of Kafka-Camus
Deep Shah
 
Sparkstreaming
Marilyn Waldman
 
Developing Realtime Data Pipelines With Apache Kafka
Joe Stein
 
Kafk a with zoo keeper setup documentation
Thiyagarajan saminadane
 
Introduction to Apache Kafka
Shiao-An Yuan
 
Apache Kafka Architecture & Fundamentals Explained
confluent
 
Ad

Recently uploaded (20)

PPT
New_school_Engineering_presentation_011707.ppt
VinayKumar304579
 
PDF
Halide Perovskites’ Multifunctional Properties: Coordination Engineering, Coo...
TaameBerhe2
 
PDF
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
PPTX
澳洲电子毕业证澳大利亚圣母大学水印成绩单UNDA学生证网上可查学历
Taqyea
 
PDF
MODULE-5 notes [BCG402-CG&V] PART-B.pdf
Alvas Institute of Engineering and technology, Moodabidri
 
PDF
Data structures notes for unit 2 in computer science.pdf
sshubhamsingh265
 
PPTX
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
PPTX
Distribution reservoir and service storage pptx
dhanashree78
 
PDF
Submit Your Papers-International Journal on Cybernetics & Informatics ( IJCI)
IJCI JOURNAL
 
PPTX
Numerical-Solutions-of-Ordinary-Differential-Equations.pptx
SAMUKTHAARM
 
PPTX
仿制LethbridgeOffer加拿大莱斯桥大学毕业证范本,Lethbridge成绩单
Taqyea
 
PPTX
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
PDF
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
PPTX
UNIT 1 - INTRODUCTION TO AI and AI tools and basic concept
gokuld13012005
 
PDF
REINFORCEMENT LEARNING IN DECISION MAKING SEMINAR REPORT
anushaashraf20
 
PDF
Bachelor of information technology syll
SudarsanAssistantPro
 
PDF
aAn_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
PPTX
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
PPTX
darshai cross section and river section analysis
muk7971
 
PPTX
MODULE 05 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
New_school_Engineering_presentation_011707.ppt
VinayKumar304579
 
Halide Perovskites’ Multifunctional Properties: Coordination Engineering, Coo...
TaameBerhe2
 
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
澳洲电子毕业证澳大利亚圣母大学水印成绩单UNDA学生证网上可查学历
Taqyea
 
MODULE-5 notes [BCG402-CG&V] PART-B.pdf
Alvas Institute of Engineering and technology, Moodabidri
 
Data structures notes for unit 2 in computer science.pdf
sshubhamsingh265
 
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
Distribution reservoir and service storage pptx
dhanashree78
 
Submit Your Papers-International Journal on Cybernetics & Informatics ( IJCI)
IJCI JOURNAL
 
Numerical-Solutions-of-Ordinary-Differential-Equations.pptx
SAMUKTHAARM
 
仿制LethbridgeOffer加拿大莱斯桥大学毕业证范本,Lethbridge成绩单
Taqyea
 
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
UNIT 1 - INTRODUCTION TO AI and AI tools and basic concept
gokuld13012005
 
REINFORCEMENT LEARNING IN DECISION MAKING SEMINAR REPORT
anushaashraf20
 
Bachelor of information technology syll
SudarsanAssistantPro
 
aAn_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
darshai cross section and river section analysis
muk7971
 
MODULE 05 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
Ad

Kafka Workshop

  • 1. Kafka & message bus Robin GRAILLON & Alexandre ANDRÉ 12/10/2016
  • 2. Synchronous ● Call ● Processing ○ Might be long ● Response
  • 4. Message Bus ● Events aggregation ● CQRS oriented ● µS oriented ● Event sourcing oriented ● Language agnostic ● Multiple implementations ○ RabbitMQ ○ Kafka ○ etc.
  • 5. Apache Kafka ● LinkedIn creation ● Open sourced in 2011 ● Filesystem oriented ● Wrote in Scala ● Highly scalable ● Used by big companies ○ LinkedIn ○ Netflix ○ Spotify ○ Meetic
  • 6. LinkedIn statistics ● 800 billion m/day ○ 175 TB ● 13 million m/sec ○ 2.75 GB ● 1100 kafka instances ○ 60 clusters
  • 7. Basic workflow Producer 1 Producer 2 Producer 3 Producer X Consumer 1 Consumer 2 Consumer 3 Consumer Y Kafka Stack
  • 8. Kafka stack ● Zookeeper : scalability, manager ● Kafka broker : kafka server instance ● Consumer : consumes events and do things ● Producer : produces events (like user as connected) ● topic : event name ● partition : way to split messages between brokers
  • 9. Kafka partitions (1) For one topic (let’s say “astronaut.connection”)
  • 10. Kafka stack & partitions
  • 12. ...but easily ! ./console run HELP run:zk run zookeeper kill:zk kill zookeeper run:kk run kafka kill:kk kill kafka producer run producer on topic consumer run consumer on topic t:c create a topic t:d delete a topic t:l list topics What do you want to do?
  • 13. Step 1: launch Zookeeper! What do you want to do? run:zk Configuration file? [./zookeeper.properties] Port? [2181] ./../bin/zookeeper-server-start.sh ./zookeeper.properties What do you want to do?
  • 14. Step 2: launch Kafka! What do you want to do? run:kk
  • 15. Step 3: list topics! What do you want to do? t:l Zookeeper host? [localhost:2181] ./../bin/kafka-topics.sh --list --zookeeper localhost:2181 What do you want to do?
  • 16. Step 4: create a topic! What do you want to do? t:c Topic name? [test] Zookeeper host? [localhost:2181] Partitions? [1] Replication factor? [1] ./../bin/kafka-topics.sh --create --zookeeper localhost:2181 --topic test --partitions 1 --replication-factor 1 Created topic "test". What do you want to do?
  • 17. Step 5: list topics AGAIIIIN! What do you want to do? t:l Zookeeper host? [localhost:2181] ./../bin/kafka-topics.sh --list --zookeeper localhost:2181 test What do you want to do?
  • 18. Step 6: run a consumer! New terminal ! $ ./console run What do you want to do? consumer Topic name? [test] Zookeeper host? [localhost:2181] From beginning? [1] ./../bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning
  • 19. Step 7: generate data! What do you want to do? g Message? [I'm an astronaut!] How many times? [1] 10000000 File? [data_10000000.txt] 10000000/10000000 [============================] 100%
  • 20. Step 8: produce events! Back to the other terminal What do you want to do? p Topic name? [test] brokers? [localhost:9092] data_10000000.txt Dataset to use? [data_10000000.txt] ./../bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test < ./data/data_10000000.txt
  • 21. GroupId: experiment 1 ● 2 groupId ● 2 partitions ● 2 consumers
  • 22. GroupId: experiment 2 ● 1 groupId ● 2 consumer
  • 23. Documentation/resources ● Kafka quick setup https://kafka.apache.org/quickstart ● Kafka at LinkedIn https://engineering.linkedin.com/kafka/running-kafka-scale ● Why zookeeper ? https://www.quora.com/What-is-the-actual-role-of-ZooKeeper-in-Kafka