SlideShare a Scribd company logo
1 of 17
Download to read offline
Kafka
10000 Feet View
BOUTKHOURST Youness
IBM A&T
07/11/2018
Agenda
- Some Background
- What is Kafka
- Kafka Benefits
- Kafka Core Concepts
- Example
- Steps to Produce the Example
Some Background. Messaging Systems
An enterprise messaging system (EMS) or messaging system in brief
[1]
is a set of published enterprise-wide
standards that allows organizations to send semantically precise messages between computer systems.
EMS systems promote loosely coupled architectures that allow changes in the formats of messages to have
minimum impact on message subscribers.
EMS systems are facilitated by the use of structured messages (such as using XML or JSON), and appropriate
protocols, such as DDS, MSMQ, AMQP or SOAP with web services.
Source : Wikipedia
Some Background. Types Of Messaging
Systems
Point-To-Point :
In this type of Messaging Systems a message can be consumed ONLY ONCE.
Producer Consumer 2
Consumer 3
Consumer 1
Queue X
X
Some Background. Types Of Messaging
Systems
Publish-Subscribe :
Messages are persisted in a topic and consumers can consume all the messages in that topic.
Producer Consumer 2
Consumer 3
Consumer 1
Queue
What is Kafka?
Initially conceived as a messaging queue, Kafka is based on an abstraction of a distributed commit log.
Kafka has evolved from messaging queue to a full-fledged streaming platform.
Kafka has 3 main characteristics :
● Publish + Subscribe : highly scalable, fault tolerant distributed system
● Store : Can be used as a source of truth like any other database
● Process : Manipulate that data as it arrives. This is what makes it a powerful streaming platform.
Kafka Benefits
● Reliability − Distributed, partitioned, replicated and fault tolerance.
● Scalability − Scales easily without down time..
● Durability − Uses Distributed commit log which means messages persists on disk as fast
as possible, hence it is durable..
● Performance − High throughput for both publishing and subscribing messages. It
maintains stable performance even many TB of messages are stored.
Kafka Core Concepts
- Topics are to Kafka what Tables are to Relational Databases
- One Topic holds a set of messages of the same category
- A Topic can be partitioned into multiple partitions
Topics :
Kafka Core Concepts
- A Partition is a single part of a Topic
- Helps scale horizontally across multiple Servers
- Each partition can be hosted on a different server
- Partition Strategies : Round Robin, Static, Hash
Partitions :
9 8 7 6 5 4 3 2 1 0
8 7 6 5 4 3 2 1 0
10 9 8 7 6 5 4 3 2 1 0
Partition 0
Partition 1
Partition 2
Messages
Topic
Kafka Core Concepts
- Producers are the publishers of messages
- Messages can be redirected to a specific partition using:
- The message key and a partitioner that will generate a hash of the key and map it to a specific
partition
- Producers send messages to a Leader Partition
Producers :
Kafka Core Concepts
- A consumer subscribes to one or more topics
- Consumers read messages sequentially from a Leader Partition
- Keeps track of the messages it has already consumed (via offsets)
- Work as part of a consumer group to consume a topic
- The group ensures that each partition is only consumed by one member of the group
Consumers :
9 8 7 6 5 4 3 2 1 0
8 7 6 5 4 3 2 1 0
10 9 8 7 6 5 4 3 2 1 0
Consumer 1
Consumer 2
Messages
Consumer
Group
- A single Kafka Server/Node
- Assigns offsets to messages received from producers
- A single broker can handle thousands of partitions and millions of messages/s
Kafka Core Concepts
Brokers :
- A set of kafka brokers
- One broker in the cluster acts as the Controller
Kafka Core Concepts
Clusters :
- Manages partition assignments
- Monitors Brokers
- Maintaining the leader/follower relationship for all the partitions
Controllers :
- Electing a controller
- Cluster membership
- Topic configuration
Kafka Core Concepts
Zookeeper :
Example
Example
In this example we have:
- 3 Brokers : Broker 1, Broker 2, Broker 3
- 1 Topic with 3 partitions and a replication factor of 3:
- The main partitions are : Partition 0 Leader, Partition 1 Leader, Partition 2 Leader
- Each Partition that is a Leader has 2 replicas (factor of replication is 3)
- The replicas never reside on the same server as the Leader Partition
- 1 Producer
- 2 Consumer Groups: Group 1, Group 2
- Group 1 has 3 consumers : So Each Consumer is assigned a Partition
- Group 2 has 2 consumers : One consumer takes charge of consuming messages from 2 partitions
- Producer and Consumers always write/read from Leader Partitions
Steps to Produce the Example
Read this File : https://github.com/youbout/kafka-10000-feet

More Related Content

What's hot

Controlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESBControlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESBMani Rathnam Gudi
 
Mule threading profile & processing strategy
Mule threading profile & processing strategyMule threading profile & processing strategy
Mule threading profile & processing strategychetan singhal
 
Mule Script Transformer
Mule Script TransformerMule Script Transformer
Mule Script TransformerAnkush Sharma
 
RabbitMQ - message broker
RabbitMQ - message brokerRabbitMQ - message broker
RabbitMQ - message brokerVít Kutný
 
Performance tuning in mule
Performance tuning in mulePerformance tuning in mule
Performance tuning in muleSon Nguyen
 
Mule servlet connector
Mule servlet connectorMule servlet connector
Mule servlet connectorAnkush Sharma
 
Introduction to Apache ActiveMQ Artemis
Introduction to Apache ActiveMQ ArtemisIntroduction to Apache ActiveMQ Artemis
Introduction to Apache ActiveMQ ArtemisYoshimasa Tanabe
 
APACHE KAFKA / Kafka Connect / Kafka Streams
APACHE KAFKA / Kafka Connect / Kafka StreamsAPACHE KAFKA / Kafka Connect / Kafka Streams
APACHE KAFKA / Kafka Connect / Kafka StreamsKetan Gote
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013mumrah
 
Apache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in actionApache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in actiondejanb
 
Messaging With Apache ActiveMQ
Messaging With Apache ActiveMQMessaging With Apache ActiveMQ
Messaging With Apache ActiveMQBruce Snyder
 
Vm component in mule
Vm component in muleVm component in mule
Vm component in mulejaveed_mhd
 
Understanding kafka
Understanding kafkaUnderstanding kafka
Understanding kafkaAmitDhodi
 

What's hot (20)

Apache Kafka
Apache Kafka Apache Kafka
Apache Kafka
 
Controlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESBControlling Message Flow - Mule ESB
Controlling Message Flow - Mule ESB
 
Mule threading profile & processing strategy
Mule threading profile & processing strategyMule threading profile & processing strategy
Mule threading profile & processing strategy
 
Mule Script Transformer
Mule Script TransformerMule Script Transformer
Mule Script Transformer
 
Mule TCP Component
Mule TCP ComponentMule TCP Component
Mule TCP Component
 
RabbitMQ - message broker
RabbitMQ - message brokerRabbitMQ - message broker
RabbitMQ - message broker
 
Kafka basics
Kafka basicsKafka basics
Kafka basics
 
ES & Kafka
ES & KafkaES & Kafka
ES & Kafka
 
Event Hub & Kafka
Event Hub & KafkaEvent Hub & Kafka
Event Hub & Kafka
 
Performance tuning in mule
Performance tuning in mulePerformance tuning in mule
Performance tuning in mule
 
Mule servlet connector
Mule servlet connectorMule servlet connector
Mule servlet connector
 
Apache Kafka Demo
Apache Kafka DemoApache Kafka Demo
Apache Kafka Demo
 
Introduction to Apache ActiveMQ Artemis
Introduction to Apache ActiveMQ ArtemisIntroduction to Apache ActiveMQ Artemis
Introduction to Apache ActiveMQ Artemis
 
APACHE KAFKA / Kafka Connect / Kafka Streams
APACHE KAFKA / Kafka Connect / Kafka StreamsAPACHE KAFKA / Kafka Connect / Kafka Streams
APACHE KAFKA / Kafka Connect / Kafka Streams
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
 
Apache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in actionApache ActiveMQ - Enterprise messaging in action
Apache ActiveMQ - Enterprise messaging in action
 
Messaging With Apache ActiveMQ
Messaging With Apache ActiveMQMessaging With Apache ActiveMQ
Messaging With Apache ActiveMQ
 
Kafka: Internals
Kafka: InternalsKafka: Internals
Kafka: Internals
 
Vm component in mule
Vm component in muleVm component in mule
Vm component in mule
 
Understanding kafka
Understanding kafkaUnderstanding kafka
Understanding kafka
 

Similar to Kafka 10000 feet view

Copy of Kafka-Camus
Copy of Kafka-CamusCopy of Kafka-Camus
Copy of Kafka-CamusDeep Shah
 
apachekafka-160907180205.pdf
apachekafka-160907180205.pdfapachekafka-160907180205.pdf
apachekafka-160907180205.pdfTarekHamdi8
 
Kafka - Messaging System
Kafka - Messaging SystemKafka - Messaging System
Kafka - Messaging SystemTanuj Mehta
 
Distributed messaging with Apache Kafka
Distributed messaging with Apache KafkaDistributed messaging with Apache Kafka
Distributed messaging with Apache KafkaSaumitra Srivastav
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging QueuesNaukri.com
 
Introduction to Kafka and Event-Driven
Introduction to Kafka and Event-DrivenIntroduction to Kafka and Event-Driven
Introduction to Kafka and Event-Drivenarconsis
 
Introduction to Kafka and Event-Driven
Introduction to Kafka and Event-DrivenIntroduction to Kafka and Event-Driven
Introduction to Kafka and Event-DrivenDimosthenis Botsaris
 
Kafka and ibm event streams basics
Kafka and ibm event streams basicsKafka and ibm event streams basics
Kafka and ibm event streams basicsBrian S. Paskin
 
Session 23 - Kafka and Zookeeper
Session 23 - Kafka and ZookeeperSession 23 - Kafka and Zookeeper
Session 23 - Kafka and ZookeeperAnandMHadoop
 
Fundamentals and Architecture of Apache Kafka
Fundamentals and Architecture of Apache KafkaFundamentals and Architecture of Apache Kafka
Fundamentals and Architecture of Apache KafkaAngelo Cesaro
 
Kafka syed academy_v1_introduction
Kafka syed academy_v1_introductionKafka syed academy_v1_introduction
Kafka syed academy_v1_introductionSyed Hadoop
 
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 !Guido Schmutz
 
Introduction to Kafka Streams Presentation
Introduction to Kafka Streams PresentationIntroduction to Kafka Streams Presentation
Introduction to Kafka Streams PresentationKnoldus Inc.
 
Grokking TechTalk #24: Kafka's principles and protocols
Grokking TechTalk #24: Kafka's principles and protocolsGrokking TechTalk #24: Kafka's principles and protocols
Grokking TechTalk #24: Kafka's principles and protocolsGrokking VN
 

Similar to Kafka 10000 feet view (20)

Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Copy of Kafka-Camus
Copy of Kafka-CamusCopy of Kafka-Camus
Copy of Kafka-Camus
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
apachekafka-160907180205.pdf
apachekafka-160907180205.pdfapachekafka-160907180205.pdf
apachekafka-160907180205.pdf
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Kafka - Messaging System
Kafka - Messaging SystemKafka - Messaging System
Kafka - Messaging System
 
Distributed messaging with Apache Kafka
Distributed messaging with Apache KafkaDistributed messaging with Apache Kafka
Distributed messaging with Apache Kafka
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues
 
Introduction to Kafka and Event-Driven
Introduction to Kafka and Event-DrivenIntroduction to Kafka and Event-Driven
Introduction to Kafka and Event-Driven
 
Introduction to Kafka and Event-Driven
Introduction to Kafka and Event-DrivenIntroduction to Kafka and Event-Driven
Introduction to Kafka and Event-Driven
 
Kafka and ibm event streams basics
Kafka and ibm event streams basicsKafka and ibm event streams basics
Kafka and ibm event streams basics
 
Session 23 - Kafka and Zookeeper
Session 23 - Kafka and ZookeeperSession 23 - Kafka and Zookeeper
Session 23 - Kafka and Zookeeper
 
Fundamentals and Architecture of Apache Kafka
Fundamentals and Architecture of Apache KafkaFundamentals and Architecture of Apache Kafka
Fundamentals and Architecture of Apache Kafka
 
Kafka syed academy_v1_introduction
Kafka syed academy_v1_introductionKafka syed academy_v1_introduction
Kafka syed academy_v1_introduction
 
Kafka.pptx
Kafka.pptxKafka.pptx
Kafka.pptx
 
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 !
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Introduction to Kafka Streams Presentation
Introduction to Kafka Streams PresentationIntroduction to Kafka Streams Presentation
Introduction to Kafka Streams Presentation
 
Grokking TechTalk #24: Kafka's principles and protocols
Grokking TechTalk #24: Kafka's principles and protocolsGrokking TechTalk #24: Kafka's principles and protocols
Grokking TechTalk #24: Kafka's principles and protocols
 

Recently uploaded

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 

Recently uploaded (20)

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 

Kafka 10000 feet view

  • 1. Kafka 10000 Feet View BOUTKHOURST Youness IBM A&T 07/11/2018
  • 2. Agenda - Some Background - What is Kafka - Kafka Benefits - Kafka Core Concepts - Example - Steps to Produce the Example
  • 3. Some Background. Messaging Systems An enterprise messaging system (EMS) or messaging system in brief [1] is a set of published enterprise-wide standards that allows organizations to send semantically precise messages between computer systems. EMS systems promote loosely coupled architectures that allow changes in the formats of messages to have minimum impact on message subscribers. EMS systems are facilitated by the use of structured messages (such as using XML or JSON), and appropriate protocols, such as DDS, MSMQ, AMQP or SOAP with web services. Source : Wikipedia
  • 4. Some Background. Types Of Messaging Systems Point-To-Point : In this type of Messaging Systems a message can be consumed ONLY ONCE. Producer Consumer 2 Consumer 3 Consumer 1 Queue X X
  • 5. Some Background. Types Of Messaging Systems Publish-Subscribe : Messages are persisted in a topic and consumers can consume all the messages in that topic. Producer Consumer 2 Consumer 3 Consumer 1 Queue
  • 6. What is Kafka? Initially conceived as a messaging queue, Kafka is based on an abstraction of a distributed commit log. Kafka has evolved from messaging queue to a full-fledged streaming platform. Kafka has 3 main characteristics : ● Publish + Subscribe : highly scalable, fault tolerant distributed system ● Store : Can be used as a source of truth like any other database ● Process : Manipulate that data as it arrives. This is what makes it a powerful streaming platform.
  • 7. Kafka Benefits ● Reliability − Distributed, partitioned, replicated and fault tolerance. ● Scalability − Scales easily without down time.. ● Durability − Uses Distributed commit log which means messages persists on disk as fast as possible, hence it is durable.. ● Performance − High throughput for both publishing and subscribing messages. It maintains stable performance even many TB of messages are stored.
  • 8. Kafka Core Concepts - Topics are to Kafka what Tables are to Relational Databases - One Topic holds a set of messages of the same category - A Topic can be partitioned into multiple partitions Topics :
  • 9. Kafka Core Concepts - A Partition is a single part of a Topic - Helps scale horizontally across multiple Servers - Each partition can be hosted on a different server - Partition Strategies : Round Robin, Static, Hash Partitions : 9 8 7 6 5 4 3 2 1 0 8 7 6 5 4 3 2 1 0 10 9 8 7 6 5 4 3 2 1 0 Partition 0 Partition 1 Partition 2 Messages Topic
  • 10. Kafka Core Concepts - Producers are the publishers of messages - Messages can be redirected to a specific partition using: - The message key and a partitioner that will generate a hash of the key and map it to a specific partition - Producers send messages to a Leader Partition Producers :
  • 11. Kafka Core Concepts - A consumer subscribes to one or more topics - Consumers read messages sequentially from a Leader Partition - Keeps track of the messages it has already consumed (via offsets) - Work as part of a consumer group to consume a topic - The group ensures that each partition is only consumed by one member of the group Consumers : 9 8 7 6 5 4 3 2 1 0 8 7 6 5 4 3 2 1 0 10 9 8 7 6 5 4 3 2 1 0 Consumer 1 Consumer 2 Messages Consumer Group
  • 12. - A single Kafka Server/Node - Assigns offsets to messages received from producers - A single broker can handle thousands of partitions and millions of messages/s Kafka Core Concepts Brokers :
  • 13. - A set of kafka brokers - One broker in the cluster acts as the Controller Kafka Core Concepts Clusters : - Manages partition assignments - Monitors Brokers - Maintaining the leader/follower relationship for all the partitions Controllers :
  • 14. - Electing a controller - Cluster membership - Topic configuration Kafka Core Concepts Zookeeper :
  • 16. Example In this example we have: - 3 Brokers : Broker 1, Broker 2, Broker 3 - 1 Topic with 3 partitions and a replication factor of 3: - The main partitions are : Partition 0 Leader, Partition 1 Leader, Partition 2 Leader - Each Partition that is a Leader has 2 replicas (factor of replication is 3) - The replicas never reside on the same server as the Leader Partition - 1 Producer - 2 Consumer Groups: Group 1, Group 2 - Group 1 has 3 consumers : So Each Consumer is assigned a Partition - Group 2 has 2 consumers : One consumer takes charge of consuming messages from 2 partitions - Producer and Consumers always write/read from Leader Partitions
  • 17. Steps to Produce the Example Read this File : https://github.com/youbout/kafka-10000-feet