Producing to Kafka - No Key
@KeithResar
P
0
P
1
P
2
P
3
Messages will be produced in a round
robin fashion
Slide 27
Slide 27 text
Producing to Kafka - No Key
@KeithResar
P
0
P
1
P
2
P
3
Messages will be produced in a round
robin fashion
Slide 28
Slide 28 text
Producing to Kafka - With Key
@KeithResar
P
0
P
1
P
2
P
3
hash(key) % numPartitions = N
Slide 29
Slide 29 text
Producing to Kafka - With Key
@KeithResar
P
0
P
1
P
2
P
3
hash(key) % numPartitions = N
Slide 30
Slide 30 text
Consumer from Kafka - Single
@KeithResar
P
0
P
1
P
2
P
3
Single consumer reads from all partitions
Slide 31
Slide 31 text
Consumer from Kafka - Multiple
@KeithResar
P
0
P
1
P
2
P
3
Consumers can be split into multiple
groups each of which operate in isolation
Slide 32
Slide 32 text
CONSUMER GROUP
COORDINATOR
CONSUMERS
CONSUMER GROUP
Slide 33
Slide 33 text
Consumer from Kafka - Multiple
@KeithResar
P
0
P
1
P
2
P
3
Consumers can be split into multiple
groups each of which operate in isolation
Slide 34
Slide 34 text
Consumer from Kafka - Multiple
@KeithResar
P
0
P
1
P
2
P
3
Consumers can be split into multiple
groups each of which operate in isolation
Slide 35
Slide 35 text
Grouped Consumers
@KeithResar
P
0
P
1
P
2
P
3
Consumers can be split into multiple
groups each of which operate in isolation
Slide 36
Slide 36 text
Grouped Consumers
@KeithResar
P
0
P
1
P
2
P
3
Consumers can be split into multiple
groups each of which operate in isolation
X
Slide 37
Slide 37 text
No content
Slide 38
Slide 38 text
Linearly Scalable Architecture
@KeithResar
Producers
● Many producers machines
● Many consumer machines
● Many Broker machines
Consumers
Single topic,
No Bottleneck!
Slide 39
Slide 39 text
Replicate for Fault Tolerance
@KeithResar
Broker A Broker B
Message
✓
Leader
Replicate
The log is a type
of durable
messaging
system
@KeithResar
Similar to a traditional
messaging system
(ActiveMQ, Rabbit, etc.)
but with:
• Far better scalability
• Built-in fault
tolerance/HA
• Storage
Slide 49
Slide 49 text
No content
Slide 50
Slide 50 text
Origins in Stream Processing
Serving Layer
(Microservices,
Elastic, etc.)
Java Apps with Kafka
Streams or ksqlDB
Continuous
Computation
High-Throughput
Event Streaming
Platform
API-Based
Clustering
Slide 51
Slide 51 text
Processing
51
@KeithResar
Slide 52
Slide 52 text
Streaming
is the toolset
for working with
events as they
move!
@KeithResar
Slide 53
Slide 53 text
What is stream processing?
@KeithResar
auth attempts possible fraud
Slide 54
Slide 54 text
What is stream processing?
@KeithResar
User Population
Coding Sophistication
Core developers who use Java/Scala
Core developers who don’t use Java/Scala
Data engineers, architects, DevOps/SRE
BI analysts
streams
Slide 55
Slide 55 text
Standing on the Shoulders of Streaming Giants
Producer,
Consumer APIs
Kafka Streams
ksqlDB Ease of use
Flexibility
ksqlDB UDFs
Powered by
Powered by
Slide 56
Slide 56 text
What is stream processing?
@KeithResar
CREATE STREAM possible_fraud AS
SELECT card_number, count(*)
FROM authorization_attempts
WINDOW TUMBLING (SIZE 5 MINUTE)
GROUP BY card_number
HAVING count(*) > 3;
Slide 57
Slide 57 text
What is stream processing?
@KeithResar
CREATE STREAM possible_fraud AS
SELECT card_number, count(*)
FROM authorization_attempts
WINDOW TUMBLING (SIZE 5 MINUTE)
GROUP BY card_number
HAVING count(*) > 3;
Slide 58
Slide 58 text
What is stream processing?
@KeithResar
CREATE STREAM possible_fraud AS
SELECT card_number, count(*)
FROM authorization_attempts
WINDOW TUMBLING (SIZE 5 MINUTE)
GROUP BY card_number
HAVING count(*) > 3;
Slide 59
Slide 59 text
What is stream processing?
@KeithResar
CREATE STREAM possible_fraud AS
SELECT card_number, count(*)
FROM authorization_attempts
WINDOW TUMBLING (SIZE 5 MINUTE)
GROUP BY card_number
HAVING count(*) > 3;
Slide 60
Slide 60 text
What is stream processing?
@KeithResar
CREATE STREAM possible_fraud AS
SELECT card_number, count(*)
FROM authorization_attempts
WINDOW TUMBLING (SIZE 5 MINUTE)
GROUP BY card_number
HAVING count(*) > 3;
Slide 61
Slide 61 text
What is stream processing?
@KeithResar
CREATE STREAM possible_fraud AS
SELECT card_number, count(*)
FROM authorization_attempts
WINDOW TUMBLING (SIZE 5 MINUTE)
GROUP BY card_number
HAVING count(*) > 3;
Slide 62
Slide 62 text
What is stream processing?
@KeithResar
CREATE STREAM possible_fraud AS
SELECT card_number, count(*)
FROM authorization_attempts
WINDOW TUMBLING (SIZE 5 MINUTE)
GROUP BY card_number
HAVING count(*) > 3;
Slide 63
Slide 63 text
No content
Slide 64
Slide 64 text
Wrap Up
64
@KeithResar
Slide 65
Slide 65 text
developer.confluent.io
Learn Kafka.
Start building with
Apache Kafka at
Confluent Developer.
Slide 66
Slide 66 text
Free eBooks
Designing Event-Driven Systems
Ben Stopford
Kafka: The Definitive Guide
Neha Narkhede, Gwen Shapira, Todd
Palino
Making Sense of Stream Processing
Martin Kleppmann
I ❤ Logs
Jay Kreps
http://cnfl.io/book-bundle