SlideShare a Scribd company logo
Apache Kafka® 101
@yourtwitterhandle | developer.confluent.io
What’s Covered
1. Introduction
2. Hands On: Your First Kafka Application in 10
Minutes or Less
3. Topics
4. Partitioning
5. Hands On: Partitioning
6. Brokers
7. Replication
8. Producers
9. Consumers
10.Hands On: Consumers
11.Ecosystem
12.Kafka Connect
13.Hands On: Kafka Connect
14.Confluent Schema Registry
15.Hands On: Confluent Schema Registry
16.Kafka Streams
17.ksqlDB
18.Hands On: ksqlDB
Introduction
@yourtwitterhandle | developer.confluent.io
Event
● Internet of Things
@yourtwitterhandle | developer.confluent.io
Event
● Internet of Things
● Business process change
@yourtwitterhandle | developer.confluent.io
Event
● Internet of Things
● Business process change
● User Interaction
@yourtwitterhandle | developer.confluent.io
Event
● Internet of Things
● Business process change
● User Interaction
● Microservice output
@yourtwitterhandle | developer.confluent.io
Notification
+
State
@yourtwitterhandle | developer.confluent.io
Key
Value
Hands On: Your First Kafka Application
in 10 Minutes or Less
GET STARTED TODAY
Confluent Cloud
cnfl.io/confluent-cloud
PROMO CODE: KAFKA101
$101 of free usage
@yourtwitterhandle | developer.confluent.io
Hands On: Your First Kafka Application in 10 Minutes or
Less
Topics
@yourtwitterhandle | developer.confluent.io
Topics
@yourtwitterhandle | developer.confluent.io
Topics
● Named container for similar events
@yourtwitterhandle | developer.confluent.io
Topics
● Named container for similar events
○ System contains lots of topics
○ Can duplicate data between topics
@yourtwitterhandle | developer.confluent.io
Topics
● Named container for similar events
○ System contains lots of topics
○ Can duplicate data between topics
● Durable logs of events
@yourtwitterhandle | developer.confluent.io
Topics
● Named container for similar events
○ System contains lots of topics
○ Can duplicate data between topics
● Durable logs of events
○ Append only
@yourtwitterhandle | developer.confluent.io
Topics
● Named container for similar events
○ System contains lots of topics
○ Can duplicate data between topics
● Durable logs of events
○ Append only
○ Can only seek by offset, not indexed
@yourtwitterhandle | developer.confluent.io
Topics
● Named container for similar events
○ System contains lots of topics
○ Can duplicate data between topics
● Durable logs of events
○ Append only
○ Can only seek by offset, not indexed
● Events are immutable
@yourtwitterhandle | developer.confluent.io
Topics are durable
@yourtwitterhandle | developer.confluent.io
Retention period is configurable
Partitioning
@yourtwitterhandle | developer.confluent.io
Partition 0
Partition 1
Partition 2
Partitioned Topic
@yourtwitterhandle | developer.confluent.io
Partition 0
Partition 1
Partition 2
@yourtwitterhandle | developer.confluent.io
Partition 0
Partition 1
Partition 2
@yourtwitterhandle | developer.confluent.io
Partition 0
Partition 1
Partition 2
1 4 7
2 5 8
3 6 9
#
@yourtwitterhandle | developer.confluent.io
Partition 0
Partition 1
Partition 2
1 2 3
4 5 7
6 8 9
#
@yourtwitterhandle | developer.confluent.io
Partition 0
Partition 1
Partition 2
#
1 2 3
4 5 7
6 8 9
Hands On: Partitioning
@yourtwitterhandle | developer.confluent.io
Hands On: Partitioning
Brokers
@yourtwitterhandle | developer.confluent.io
Brokers
● An computer, instance, or container running the Kafka process
@yourtwitterhandle | developer.confluent.io
Brokers
● An computer, instance, or container running the Kafka process
● Manage partitions
● Handle write and read requests
@yourtwitterhandle | developer.confluent.io
Brokers
● An computer, instance, or container running the Kafka process
● Manage partitions
● Handle write and read requests
● Manage replication of partitions
@yourtwitterhandle | developer.confluent.io
Brokers
● An computer, instance, or container running the Kafka process
● Manage partitions
● Handle write and read requests
● Manage replication of partitions
● Intentionally very simple
Replication
@yourtwitterhandle | developer.confluent.io
Partition 0
Partition 1
Partition 2
Partitioned Topic
@yourtwitterhandle | developer.confluent.io
Replication
● Copies of data for fault tolerance
@yourtwitterhandle | developer.confluent.io
Replication
● Copies of data for fault tolerance
● One lead partition and N-1 followers
@yourtwitterhandle | developer.confluent.io
Replication
● Copies of data for fault tolerance
● One lead partition and N-1 followers
● In general, writes and reads happen to the leader
@yourtwitterhandle | developer.confluent.io
Replication
● Copies of data for fault tolerance
● One lead partition and N-1 followers
● In general, writes and reads happen to the leader
● An invisible process to most developers
@yourtwitterhandle | developer.confluent.io
Replication
● Copies of data for fault tolerance
● One lead partition and N-1 followers
● In general, writes and reads happen to the leader
● An invisible process to most developers
● Tunable in the producer
Producers
@yourtwitterhandle | developer.confluent.io
Partition 0
Partition 1
Partition 2
Partitioned Topic
Producer
@yourtwitterhandle | developer.confluent.io
{
final Properties props = KafkaProducerApplication.loadProperties(args[0]);
final String topic = props.getProperty(“output.topic.name”);
final Producer<String, String> producer = new KafkaProducer<>(props);
final KafkaProducerApplication producerApp = new KafkaProducerApplication(producer, topic);
}
@yourtwitterhandle | developer.confluent.io
{
final ProducerRecord<String, String> producerRecord = new ProducerRecord<>(outTopic, key, value);
return producer.send(producerRecord);
}
@yourtwitterhandle | developer.confluent.io
Producers
● Client application
● Puts messages into topics
● Connection pooling
● Network buffering
● Partitioning
@yourtwitterhandle | developer.confluent.io
Partition 0
Partition 1
Partition 2
Partitioned Topic
Producer
Consumers
@yourtwitterhandle | developer.confluent.io
{
final Properties consumerAppProps = KafkaConsumerApplication.loadProperties(args[0]);
final String filePath = consumerAppProps.getProperty(“file.path”);
final Consumer<String, String> consumer = new KafkaConsumer<>(consumerAppProps);
final ConsumerRecordsHandler<String, String> recordsHandler = new FilewritingrecordsHandler(Paths.get(filePa …
final KafkaConsumerapplication consumerApplication = new KafkaConsumerApplication(consumer, recordsHandler);
@yourtwitterhandle | developer.confluent.io
@ public void runConsume(final Properties consumerProps) {
try {
consumer.subscribe(Collections.singletonList(consumerProps.getProperty(“input.topic.name”)));
while (keepConsuming) {
final ConsumerRecords<String, String> consumerRecords
=vconsumer.poll(Duration.ofSeconds(1));
recordsHandler.process(consumerRecords);
}
@yourtwitterhandle | developer.confluent.io
@ public void process(final ConsumerRecords<String, String> consumerRecords) {
final List<String> valueList = new ArrayList<>();
consumerRecords.forEach(record -> valueList.add(record.value()));
if (!valueList.isEmpty()) {
try {
Files.write(path, valueList, StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption …
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
@yourtwitterhandle | developer.confluent.io
Consumers
● Client application
● Reads messages from topics
● Connection pooling
● Network protocol
● Horizontally and elastically scalable
● Maintains ordering within partitions at scale
@yourtwitterhandle | developer.confluent.io
Partition 0
Partition 1
Partition 2
Partitioned Topic
Consumer A
Consumer B
@yourtwitterhandle | developer.confluent.io
Partition 0
Partition 1
Partition 2
Partitioned Topic
Consumer A
@yourtwitterhandle | developer.confluent.io
Partition 0
Partition 1
Partition 2
Partitioned Topic
Consumer A
Consumer A
Consumer B
@yourtwitterhandle | developer.confluent.io
java application > configuration > dev.properties
1 group.id=movie_ratings
2
3 bootstrap.servers=localhost:29092
4
5 key.serializer=org.apache.kafka.common.serialization.StringSerializer
6 value.serializer=org.apache.kafka.common.serialization.StringSerializer
7 acks=all
8
9 #Properties below this line are specific to code in this application
10 input.topic.name=input-topic
11 output.topic.name=output-topic
@yourtwitterhandle | developer.confluent.io
Partition 0
Partition 1
Partition 2
Partitioned Topic
Consumer A
Consumer A
Consumer B
Consumer A
Hands On: Consumers
@yourtwitterhandle | developer.confluent.io
Hands On: Consumers
Ecosystem
Kafka Connect
@yourtwitterhandle | developer.confluent.io
Kafka Connect
● Data integration system and ecosystem
● Because some other systems are not Kafka
● External client process; does not run on brokers
@yourtwitterhandle | developer.confluent.io
Cluster
Data Source Kafka Connect Kafka Connect Data Sink
@yourtwitterhandle | developer.confluent.io
Kafka Connect
● Data integration system and ecosystem
● Because some other systems are not Kafka
● External client process; does not run on brokers
● Horizontally scalable
● Fault tolerant
@yourtwitterhandle | developer.confluent.io
{
“connector.class”: “io.confluent.connect.elasticsearch.ElasticsearchSinkConnector”,
“connector.url”: “http://elasticsearch:9200”,
“tasks.max”: “1”,
“topics”: “simple.elasticsearch.data”,
“name”: “simple-elasticsearch-connector”,
“type.name”: “doc”,
“value.converter”: “org.apache.kafka.connect.json.JsonConverter”
“value.converter.schemas.enable”: “false”
}
@yourtwitterhandle | developer.confluent.io
Kafka Connect
● Data integration system and ecosystem
● Because some other systems are not Kafka
● External client process; does not run on brokers
● Horizontally scalable
● Fault tolerant
● Declarative
@yourtwitterhandle | developer.confluent.io
Connectors
● Pluggable software component
@yourtwitterhandle | developer.confluent.io
Connectors
● Pluggable software component
● Interfaces to external system and to Kafka
@yourtwitterhandle | developer.confluent.io
Connectors
● Pluggable software component
● Interfaces to external system and to Kafka
● Also exist as runtime entities
@yourtwitterhandle | developer.confluent.io
Connectors
● Pluggable software component
● Interfaces to external system and to Kafka
● Also exist as runtime entities
● Source connectors act as producers
@yourtwitterhandle | developer.confluent.io
Connectors
● Pluggable software component
● Interfaces to external system and to Kafka
● Also exist as runtime entities
● Source connectors act as producers
● Sink connectors act as consumers
@yourtwitterhandle | developer.confluent.io
Hands On: Kafka Connect
@yourtwitterhandle | developer.confluent.io
Hands On: Kafka Connect
Confluent Schema Registry
@yourtwitterhandle | developer.confluent.io
New consumers will emerge
@yourtwitterhandle | developer.confluent.io
Schemas evolve with the business
@yourtwitterhandle | developer.confluent.io
Schema Registry
● Server process external to Kafka brokers
@yourtwitterhandle | developer.confluent.io
Schema Registry
● Server process external to Kafka brokers
● Maintains a database of schemas
@yourtwitterhandle | developer.confluent.io
Schema Registry
● Server process external to Kafka brokers
● Maintains a database of schemas
● HA deployment option available
@yourtwitterhandle | developer.confluent.io
Schema Registry
● Server process external to Kafka brokers
● Maintains a database of schemas
● HA deployment option available
● Consumer/Producer API component
@yourtwitterhandle | developer.confluent.io
Schema Registry
● Defines schema compatibility rules per topic
@yourtwitterhandle | developer.confluent.io
Schema Registry
● Defines schema compatibility rules per topic
● Producer API prevents incompatible messages from being produced
@yourtwitterhandle | developer.confluent.io
Schema Registry
● Defines schema compatibility rules per topic
● Producer API prevents incompatible messages from being produced
● Consumer API prevents incompatible messages from being consumer
@yourtwitterhandle | developer.confluent.io
Supported Formats
● JSON Schema
● Avro
● Protocol Buffers
Hands On: Confluent Schema Registry
@yourtwitterhandle | developer.confluent.io
Hands On: Confluent Schema Registry
Kafka Streams
@yourtwitterhandle | developer.confluent.io
Kafka Streams
● Functional Java API
@yourtwitterhandle | developer.confluent.io
Kafka Streams
● Functional Java API
● Filtering, grouping, aggregating, joining, and more
@yourtwitterhandle | developer.confluent.io
Kafka Streams
● Functional Java API
● Filtering, grouping, aggregating, joining, and more
● Scalable, fault-tolerant state management
@yourtwitterhandle | developer.confluent.io
Kafka Streams
● Functional Java API
● Filtering, grouping, aggregating, joining, and more
● Scalable, fault-tolerant state management
● Scalable computation based on consumer groups
@yourtwitterhandle | developer.confluent.io
Kafka Streams
● Integrates within your services as a library
@yourtwitterhandle | developer.confluent.io
Kafka Streams
● Integrates within your services as a library
● Runs in the context of your application
@yourtwitterhandle | developer.confluent.io
Kafka Streams
● Integrates within your services as a library
● Runs in the context of your application
● Does not require special infrastructure
@yourtwitterhandle | developer.confluent.io
Insert Code: https://youtu.be/UbNoL5tJEjc?t=443
ksqlDB
@yourtwitterhandle | developer.confluent.io
ksqlDB
● A database optimized for stream processing
@yourtwitterhandle | developer.confluent.io
ksqlDB
● A database optimized for stream processing
● Runs on its own scalable, fault-tolerant cluster adjacent to the Kafka
cluster
@yourtwitterhandle | developer.confluent.io
ksqlDB
● A database optimized for stream processing
● Runs on its own scalable, fault-tolerant cluster adjacent to the Kafka
cluster
● Stream processing programs written in SQL
@yourtwitterhandle | developer.confluent.io
src > main > ksql > rate-movies.sql
1
2 CREATE TABLE rated_movies AS
3 SELECT title,
4 SUM(rating)/COUNT(rating) AS avg_rating
5 FROM ratings
6 INNER JOIN movies
7 ON ratings.movie_id=movies.movie_id
8 GROUP BY title EMIT CHANGES;
@yourtwitterhandle | developer.confluent.io
ksqlDB
● Command line interface
● REST API for application integration
@yourtwitterhandle | developer.confluent.io
ksqlDB
● Command line interface
● REST API for application integration
● Java library
@yourtwitterhandle | developer.confluent.io
ksqlDB
● Command line interface
● REST API for application integration
● Java library
● Kafka Connect integration
Hands On: ksqlDB
@yourtwitterhandle | developer.confluent.io
Hands On: ksqlDB
Your Apache Kafka
journey begins here
developer.confluent.io
Apache Kafka 101 by Confluent Developer Friendly

More Related Content

Similar to Apache Kafka 101 by Confluent Developer Friendly (20)

PDF
Apache Kafka Introduction
Amita Mirajkar
 
PDF
Apache KAfka
Pedro Alcantara
 
PDF
Brick-by-Brick: Exploring the Elements of Apache Kafka®
HostedbyConfluent
 
PDF
Apache Kafka Architecture & Fundamentals Explained
confluent
 
PDF
DevOps Fest 2020. Сергій Калінець. Building Data Streaming Platform with Apac...
DevOps_Fest
 
PPTX
Streaming in Practice - Putting Apache Kafka in Production
confluent
 
PDF
Developing Realtime Data Pipelines With Apache Kafka
Joe Stein
 
PDF
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
Guido Schmutz
 
PPTX
Fundamentals and Architecture of Apache Kafka
Angelo Cesaro
 
PDF
Apache Kafka - Martin Podval
Martin Podval
 
PDF
Introducción a Stream Processing utilizando Kafka Streams
confluent
 
PPTX
kafka_session_updated.pptx
Koiuyt1
 
PDF
Apache Kafka Scalable Message Processing and more!
Guido Schmutz
 
PDF
Apache Kafka - From zero to hero
Apache Kafka TLV
 
PDF
Kafka zero to hero
Avi Levi
 
PPTX
Kafkha real time analytics platform.pptx
dummyuseage1
 
PDF
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
mumrah
 
PPTX
Understanding kafka
AmitDhodi
 
PDF
Developing Real-Time Data Pipelines with Apache Kafka
Joe Stein
 
PPTX
Kafka.pptx (uploaded from MyFiles SomnathDeb_PC)
somnathdeb0212
 
Apache Kafka Introduction
Amita Mirajkar
 
Apache KAfka
Pedro Alcantara
 
Brick-by-Brick: Exploring the Elements of Apache Kafka®
HostedbyConfluent
 
Apache Kafka Architecture & Fundamentals Explained
confluent
 
DevOps Fest 2020. Сергій Калінець. Building Data Streaming Platform with Apac...
DevOps_Fest
 
Streaming in Practice - Putting Apache Kafka in Production
confluent
 
Developing Realtime Data Pipelines With Apache Kafka
Joe Stein
 
Apache Kafka - Event Sourcing, Monitoring, Librdkafka, Scaling & Partitioning
Guido Schmutz
 
Fundamentals and Architecture of Apache Kafka
Angelo Cesaro
 
Apache Kafka - Martin Podval
Martin Podval
 
Introducción a Stream Processing utilizando Kafka Streams
confluent
 
kafka_session_updated.pptx
Koiuyt1
 
Apache Kafka Scalable Message Processing and more!
Guido Schmutz
 
Apache Kafka - From zero to hero
Apache Kafka TLV
 
Kafka zero to hero
Avi Levi
 
Kafkha real time analytics platform.pptx
dummyuseage1
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
mumrah
 
Understanding kafka
AmitDhodi
 
Developing Real-Time Data Pipelines with Apache Kafka
Joe Stein
 
Kafka.pptx (uploaded from MyFiles SomnathDeb_PC)
somnathdeb0212
 

Recently uploaded (20)

PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Ad

Apache Kafka 101 by Confluent Developer Friendly