SlideShare a Scribd company logo
1 of 21
Apache Kafka:
Theory 101
… with My little Ponies!
Alejandra Quetzalli
alejandra@shecodesnow.org
Agenda
• What is Apache Kafka?
• What can I use event streaming for?
• Where is Apache Kafka used?
• Kafka Theory 101 Overview
And maybe a pony or two.
What is Apache Kafka?
What is Apache Kafka?
• It is an 🙌 open-source 🙌 event streaming platform.
• Simply put, it is a way of moving data between systems.
• (i.e. between applications, and servers)
3 key capabilities for event streaming:
• To publish (write) and subscribe to (read) streams of events, including
continuous import/export of data from other systems.
• To store streams of events durably and reliably for as long as a dev needs.
• To process streams of events as they occur or retrospectively.
What does one use event streaming for?
What can I use event streaming for?
• To process payments and financial transactions in real-time
• stock exchanges
• banks
• insurances
• To track and monitor cars, trucks, fleets, and shipments in real-time
• logistics
• automotive industry
• To continuously capture and analyze sensor data from IoT devices/equipment
• factories
• wind parks
Event streaming – cont’d…
• To collect and immediately react to customer interactions and orders
• retail
• hotel and travel industry
• mobile applications
• To connect, store, and make available data produced by different divisions of
a company.
• To serve as the foundation for data platforms, event-driven architectures,
and microservices.
Where is Apache Kafka used in the world?
Where is Apache Kafka used?
• Netflix is using Kafka to apply
recommendations in real-time while
you're watching TV shows.
• Uber uses Kafka to gather user, taxi
and trip data in real-time to compute
and forecast demand and pricing in
real-time.
• LinkedIn uses Kafka to prevent spam in
their platform, collect user
interactions and make better
connection recommendations.
Concepts & Theory 101
T is for Topics and Twilight Sparkle
• A particular stream of data.
• A topic is identified by its name.
• Topics are split into partitions.
• Each partition is ordered.
• Each message within a partition gets an
incremental id, called offset.
• Central protagonist of the show
• Most intellectual member of the Mane Six
• Her cutie mark represents her talent
for magic and her love
for books and knowledge.
0 1 2 3 4
0 1 2 3
0 1 2 3 4 5 6
Partition 0
Partition 1
Partition 2
Topic Replication
Topic Replication is the process to offer fail-over
capability for a topic.
• If one broker (holds topics and partitions) is
down, the other broker can serve the data.
• This replication factor defines the number of
copies of a topic in a Kafka cluster (made up of
multiple Kafka brokers).
• Kafka stores messages in topics that
are partitioned and replicated across
multiple brokers in a cluster.
Broker 2
Broker 1
Partition 0
Topic A
Partition 1
Topic B
Partition 0
Topic A
B is for Brokers and Babs Seed
• Holds topics and partitions.
• Each broker is identified with its ID (integer).
• Each broker contains certain topic partitions.
• After connecting to any broker, you're
connected to an entire cluster.
• Apple Bloom's cousin from Manehattan.
• Former member of the Cutie Mark
Crusaders
P is for Partitions and Pinkie Pie
• An ordered, immutable record sequence.
• Once data is written to a partition, it can't be
changed (immutable).
• Data is assigned randomly to a partition, unless a key
is provided.
• At any one time, only ONE broker can be a leader for
a given partition.
• That leader can receive and serve data for a
partition.
• The other brokers will just be passive
replicas and synchronize the data.
• Each partition is going to have one leader, and
multiple ISR (in-sync replica).
• Baker at Sugarcube Corner.
• Toothless pet alligator, Gummy.
• Represents the element of laughter.
P is also for Producers and Pound Cake
• How do we get data in Kafka?
• Producers write data to topics (which are made up of
partitions).
• Producers automatically know to which broker and
partition to write to.
• Producers Message Keys: producers can choose to
send a key with a message. (i.e. string, number, .etc)
• If a key is sent, all messages for that key will
always go to the same partition.
• A key is sent if you need message ordering for a
specific field (i.e. truck_id).
• Parents are surprised to find out that
Pound Cake is a male Pegasus, and his twin
foal sister (Pumpkin Cake) is a female
unicorn… even though their parents are
both Earth ponies.
C is for Consumers and Princess Celestia
• How do we read data in Kafka?
• They read data from a topic (identified by name).
• Consumers know which broker to read from.
• In case of broker failures, consumers know how to recover.
• Data is read in order within each partition.
• Consumer Groups: consumers read data in consumer
groups.
• Each consumer within a group will read directly from
exclusive partitions.
• If you have more consumers than partitions, some will
be inactive.
• Most magical pony.
• Responsible for raising the sun to create
light in Equestria.
• Over 1,000 years old!
Z is for Zookeeper and Zecora
• Keeps track of status of the Kafka cluster nodes.
• Also keeps track of Kafka topics and partitions.
• Currently, Apache Kafka® uses Apache ZooKeeper™ to
store its metadata (i.e. location of partitions, the
configuration of topics).
⚠️ Apache Kafka is removing the Apache ZooKeeper
Dependency. ⚠️
• In 2019, they outlined a plan to break this
dependency and bring metadata management back
into Kafka itself.
• Female zebra shaman and herbalist.
• Always speaks in rhyme.
What next?
What now, developer?
• To get hands-on experience, follow the Quickstart.
• To learn more about Apache Kafka, check out the developer docs.
• Books and academic papers!
Gracias
Alejandra Quetzalli
alejandra@shecodesnow.org
twitter.com/QuetzalliAle
linkedin.com/in/alejandra-quetzalli

More Related Content

Similar to Learning Apache Kafka Theory 101 w/ My Little Ponies

Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Erik Onnen
 

Similar to Learning Apache Kafka Theory 101 w/ My Little Ponies (20)

Ten reasons to choose Apache Pulsar over Apache Kafka for Event Sourcing_Robe...
Ten reasons to choose Apache Pulsar over Apache Kafka for Event Sourcing_Robe...Ten reasons to choose Apache Pulsar over Apache Kafka for Event Sourcing_Robe...
Ten reasons to choose Apache Pulsar over Apache Kafka for Event Sourcing_Robe...
 
Unleashing Real-time Power with Kafka.pptx
Unleashing Real-time Power with Kafka.pptxUnleashing Real-time Power with Kafka.pptx
Unleashing Real-time Power with Kafka.pptx
 
Fundamentals of Apache Kafka
Fundamentals of Apache KafkaFundamentals of Apache Kafka
Fundamentals of Apache Kafka
 
Python Kafka Integration: Developers Guide
Python Kafka Integration: Developers GuidePython Kafka Integration: Developers Guide
Python Kafka Integration: Developers Guide
 
What is Kafka & why is it Important? (UKOUG Tech17, Birmingham, UK - December...
What is Kafka & why is it Important? (UKOUG Tech17, Birmingham, UK - December...What is Kafka & why is it Important? (UKOUG Tech17, Birmingham, UK - December...
What is Kafka & why is it Important? (UKOUG Tech17, Birmingham, UK - December...
 
Apache Kafka Introduction
Apache Kafka IntroductionApache Kafka Introduction
Apache Kafka Introduction
 
Apache storm
Apache stormApache storm
Apache storm
 
Akka in Production - ScalaDays 2015
Akka in Production - ScalaDays 2015Akka in Production - ScalaDays 2015
Akka in Production - ScalaDays 2015
 
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
 
Current and Future of Apache Kafka
Current and Future of Apache KafkaCurrent and Future of Apache Kafka
Current and Future of Apache Kafka
 
Using Kafka as a Database For Real-Time Transaction Processing | Chad Preisle...
Using Kafka as a Database For Real-Time Transaction Processing | Chad Preisle...Using Kafka as a Database For Real-Time Transaction Processing | Chad Preisle...
Using Kafka as a Database For Real-Time Transaction Processing | Chad Preisle...
 
Kafka & Storm - FifthElephant 2015 by @bhaskerkode, Helpshift
Kafka & Storm - FifthElephant 2015 by @bhaskerkode, HelpshiftKafka & Storm - FifthElephant 2015 by @bhaskerkode, Helpshift
Kafka & Storm - FifthElephant 2015 by @bhaskerkode, Helpshift
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
 
CQRS + ES with Scala and Akka
CQRS + ES with Scala and AkkaCQRS + ES with Scala and Akka
CQRS + ES with Scala and Akka
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Kafka presentation
Kafka presentationKafka presentation
Kafka presentation
 
Kafka Streams: The Stream Processing Engine of Apache Kafka
Kafka Streams: The Stream Processing Engine of Apache KafkaKafka Streams: The Stream Processing Engine of Apache Kafka
Kafka Streams: The Stream Processing Engine of Apache Kafka
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !
 

Recently uploaded

Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
amitlee9823
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 

Recently uploaded (20)

Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFx
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 

Learning Apache Kafka Theory 101 w/ My Little Ponies

  • 1. Apache Kafka: Theory 101 … with My little Ponies! Alejandra Quetzalli alejandra@shecodesnow.org
  • 2. Agenda • What is Apache Kafka? • What can I use event streaming for? • Where is Apache Kafka used? • Kafka Theory 101 Overview And maybe a pony or two.
  • 3. What is Apache Kafka?
  • 4. What is Apache Kafka? • It is an 🙌 open-source 🙌 event streaming platform. • Simply put, it is a way of moving data between systems. • (i.e. between applications, and servers)
  • 5. 3 key capabilities for event streaming: • To publish (write) and subscribe to (read) streams of events, including continuous import/export of data from other systems. • To store streams of events durably and reliably for as long as a dev needs. • To process streams of events as they occur or retrospectively.
  • 6. What does one use event streaming for?
  • 7. What can I use event streaming for? • To process payments and financial transactions in real-time • stock exchanges • banks • insurances • To track and monitor cars, trucks, fleets, and shipments in real-time • logistics • automotive industry • To continuously capture and analyze sensor data from IoT devices/equipment • factories • wind parks
  • 8. Event streaming – cont’d… • To collect and immediately react to customer interactions and orders • retail • hotel and travel industry • mobile applications • To connect, store, and make available data produced by different divisions of a company. • To serve as the foundation for data platforms, event-driven architectures, and microservices.
  • 9. Where is Apache Kafka used in the world?
  • 10. Where is Apache Kafka used? • Netflix is using Kafka to apply recommendations in real-time while you're watching TV shows. • Uber uses Kafka to gather user, taxi and trip data in real-time to compute and forecast demand and pricing in real-time. • LinkedIn uses Kafka to prevent spam in their platform, collect user interactions and make better connection recommendations.
  • 12. T is for Topics and Twilight Sparkle • A particular stream of data. • A topic is identified by its name. • Topics are split into partitions. • Each partition is ordered. • Each message within a partition gets an incremental id, called offset. • Central protagonist of the show • Most intellectual member of the Mane Six • Her cutie mark represents her talent for magic and her love for books and knowledge. 0 1 2 3 4 0 1 2 3 0 1 2 3 4 5 6 Partition 0 Partition 1 Partition 2
  • 13. Topic Replication Topic Replication is the process to offer fail-over capability for a topic. • If one broker (holds topics and partitions) is down, the other broker can serve the data. • This replication factor defines the number of copies of a topic in a Kafka cluster (made up of multiple Kafka brokers). • Kafka stores messages in topics that are partitioned and replicated across multiple brokers in a cluster. Broker 2 Broker 1 Partition 0 Topic A Partition 1 Topic B Partition 0 Topic A
  • 14. B is for Brokers and Babs Seed • Holds topics and partitions. • Each broker is identified with its ID (integer). • Each broker contains certain topic partitions. • After connecting to any broker, you're connected to an entire cluster. • Apple Bloom's cousin from Manehattan. • Former member of the Cutie Mark Crusaders
  • 15. P is for Partitions and Pinkie Pie • An ordered, immutable record sequence. • Once data is written to a partition, it can't be changed (immutable). • Data is assigned randomly to a partition, unless a key is provided. • At any one time, only ONE broker can be a leader for a given partition. • That leader can receive and serve data for a partition. • The other brokers will just be passive replicas and synchronize the data. • Each partition is going to have one leader, and multiple ISR (in-sync replica). • Baker at Sugarcube Corner. • Toothless pet alligator, Gummy. • Represents the element of laughter.
  • 16. P is also for Producers and Pound Cake • How do we get data in Kafka? • Producers write data to topics (which are made up of partitions). • Producers automatically know to which broker and partition to write to. • Producers Message Keys: producers can choose to send a key with a message. (i.e. string, number, .etc) • If a key is sent, all messages for that key will always go to the same partition. • A key is sent if you need message ordering for a specific field (i.e. truck_id). • Parents are surprised to find out that Pound Cake is a male Pegasus, and his twin foal sister (Pumpkin Cake) is a female unicorn… even though their parents are both Earth ponies.
  • 17. C is for Consumers and Princess Celestia • How do we read data in Kafka? • They read data from a topic (identified by name). • Consumers know which broker to read from. • In case of broker failures, consumers know how to recover. • Data is read in order within each partition. • Consumer Groups: consumers read data in consumer groups. • Each consumer within a group will read directly from exclusive partitions. • If you have more consumers than partitions, some will be inactive. • Most magical pony. • Responsible for raising the sun to create light in Equestria. • Over 1,000 years old!
  • 18. Z is for Zookeeper and Zecora • Keeps track of status of the Kafka cluster nodes. • Also keeps track of Kafka topics and partitions. • Currently, Apache Kafka® uses Apache ZooKeeper™ to store its metadata (i.e. location of partitions, the configuration of topics). ⚠️ Apache Kafka is removing the Apache ZooKeeper Dependency. ⚠️ • In 2019, they outlined a plan to break this dependency and bring metadata management back into Kafka itself. • Female zebra shaman and herbalist. • Always speaks in rhyme.
  • 20. What now, developer? • To get hands-on experience, follow the Quickstart. • To learn more about Apache Kafka, check out the developer docs. • Books and academic papers!