SlideShare a Scribd company logo
Confluent & Apache Kafka
Patterns / Anti-patterns
Marcelo Manta and Jean Louis Boudart
Problem ?
With
How
Store &ETL Process
Publish &
Subscribe
In short
From a simple idea
From a simple idea
with great properties !
• Scalability
• Retention
• Durability
• Replication
• Security
• Resiliency
• Throughput
• Ordering
• Exactly Once Semantic
• Transaction
• Idempotency
• Immutability
• …
8
So goooooood
What could potentially go wrong
?
Webinar patterns anti patterns
…which is true for any data
systems
Not thinking about Durability
Data durability
14
If you didn’t think
about it… it’s not
durable!
Webinar patterns anti patterns
Webinar patterns anti patterns
Webinar patterns anti patterns
And you might have lost data!
Data durability
1
9
Kafka is notwaiting
for a disk flush by
default.
Durability is achieved
through replication.
Webinar patterns anti patterns
Webinar patterns anti patterns
Webinar patterns anti patterns
Webinar patterns anti patterns
Data durability
24
It depends on your
configuration...
Webinar patterns anti patterns
Webinar patterns anti patterns
Webinar patterns anti patterns
Webinar patterns anti patterns
Data durability
29
acks=1 (default
value) good for
latency
acks=all
good for durability
Webinar patterns anti patterns
acks=all
3
1
The leader will wait
for the full setof
in-sync replicas to
acknowledge the
record.
Webinar patterns anti patterns
Webinar patterns anti patterns
Webinar patterns anti patterns
min.insync.replicas
35
minimum number of
replicas that must
acknowledge.
Default is 1.
Webinar patterns anti patterns
Data Durability while Producing ?
Tune it with the parameters acks
and min.insync.replicas
defaults
38
The default values
are optimized for
availability & latency.
If durability is more
important, tune it!
Deploying on multi datacenters
?
r ·-::i- _• ;.!!.c_:,;--... . , L.L:.-_::;;.
.--. •c - ?:
. '-:"
?"%
-:-
':..
¥.. 
c.
"
.;
'<
-..
".:-,:,'<',,,,"'=
,...,,../-.-,<.a!.J V(fl..?---..,..'.. '?,
8i''{..
·g
----,-,,.>- *cf" ,., '--. z _ _,.,....,-,;,,:_).
:; ?li-·-:-... _J
C re, .Dubli- ,',.7_ I(-<'---_
i {..'t
..J
· •--·/4·
.• "' /4,
_; . ,.c.,,;
-"->.

'·r
,
.& ( r ('..
.-,  ..._- r,.I, •:;-,
.c
..:;, •.:
.. r (
...
. ) "'IJ J_J
,,v ,/
>
;o
i.;
,
..
•'
.-..
-·
Multi-dc
41
It’s quite
complicated...
It’s easy to makeit
wrong on many
levels.
It could be a 3htalk.
Multi-dc Disaster recovery for
multi datacenter
42
What about the consumers
?
consumers
44
Consumer can read
only committed data.
Webinar patterns anti patterns
Think about data durability and
decide of the best trade-off for you
Throughput,
latency, durability,
availability
Optimizing your Apache
Kafka deployment
47
Focusing only on the happy path
Webinar patterns anti patterns
Webinar patterns anti patterns
Webinar patterns anti patterns
retries
52
It will cause theclient
to resend any record
whose send fails with
a potentially transient
error.
Default value : 0
Webinar patterns anti patterns
retries
54
Use built in retries !
Bump it from0 to
infinity!
retries
55
But you are exposed
to a different kind of
issue…
Webinar patterns anti patterns
enable.idempotence
57
When set to 'true',
the producer will
ensure that exactly
one copy of each
message is written.
Default value: false
Webinar patterns anti patterns
Webinar patterns anti patterns
Use built in idempotency!
But it does not save you from
- Managing exception and failure
- Developing Idempotent consumer
No Idempotent consumer
Webinar patterns anti patterns
At least once (default)
At most once
Exactly Once
Webinar patterns anti patterns
Webinar patterns anti patterns
Webinar patterns anti patterns
Webinar patterns anti patterns
Webinar patterns anti patterns
Webinar patterns anti patterns
commit
7
1
Manually committing
aggressively...
Add a huge workload
on Apache Kafka
Webinar patterns anti patterns
commit
73
Manually committing
aggressively...
Does not provide
exactly once
semantic
Embrace at least once
Rely on Kafka Streams
with Exactly Once !
No exception handling
Webinar patterns anti patterns
Future<RecordMetadata> send(ProducerRecord<K, V> record);
Future<RecordMetadata> send(ProducerRecord<K, V> record,
Callback callback);
producer.send(record, (metadata, exception) -> {
});
error handling
81
We don’t expect the
unexpected until the
unexpected is
expected.
Webinar patterns anti patterns
error handling
83
A message can not
be processed
error handling
84
A message can not
be processed
A message doesn’t
have the expected
schema
Retry
Webinar patterns anti patterns
Infinite retry
Webinar patterns anti patterns
Write to a dead letter queue and
continue
Webinar patterns anti patterns
Ignore and continue
Webinar patterns anti patterns
No silver bullet
Handle the exceptions
!
https://eng.uber.com/reliable-reprocessing/
No data governance
Webinar patterns anti patterns
Webinar patterns anti patterns
Webinar patterns anti patterns
governance
99
Changes in producers
might impact
consumers
governance
100
Schema registry
Webinar patterns anti patterns
Webinar patterns anti patterns
Share Schemas
Let bad citizens wander around
Webinar patterns anti patterns
Leverage Security, ACL and Quota
Security
Authorization and ACLs
Enforcing Client Quotas
Installing prod on Sunday night
Webinar patterns anti patterns
configuration
109
If you use thedefault
configuration…
You will have issues!
Please read the doc
Running Kafka in Production
Running ZooKeeper in Production
Not configuring your OS
Webinar patterns anti patterns
os
11
3
Tune at least your
open file descriptors
and mmap count.
Configure your os
Running Kafka in Production
Disregarding Apache Zookeeper
Not understanding Ordering
No monitoring
Too much partitions
Not enough partitions
Partition key choice
Topics vs Partitions
Call external services in Kafka
Streams
Questions

More Related Content

PDF
Apache Kafka – (Pattern and) Anti-Pattern
PPTX
Apache Kafka - Patterns anti-patterns
PPTX
Nyc kafka meetup 2015 - when bad things happen to good kafka clusters
PDF
Perfug 20-11-2019 - Kafka Performances
PPTX
Introducing Exactly Once Semantics To Apache Kafka
PPTX
Apache Kafka Reliability
PDF
Jacopo Nardiello - Monitoring Cloud-Native applications with Prometheus - Cod...
PDF
Paris Container Day 2016 : Etcd - overview and future (CoreOS)
Apache Kafka – (Pattern and) Anti-Pattern
Apache Kafka - Patterns anti-patterns
Nyc kafka meetup 2015 - when bad things happen to good kafka clusters
Perfug 20-11-2019 - Kafka Performances
Introducing Exactly Once Semantics To Apache Kafka
Apache Kafka Reliability
Jacopo Nardiello - Monitoring Cloud-Native applications with Prometheus - Cod...
Paris Container Day 2016 : Etcd - overview and future (CoreOS)

What's hot (20)

PDF
ZooKeeper - wait free protocol for coordinating processes
PPTX
No data loss pipeline with apache kafka
PPTX
Determinism in finance
PDF
Cloud Foundry on OpenStack - An Experience Report | anynines
PDF
Cloud Infrastructures Slide Set 8 - More Cloud Technologies - Mesos, Spark | ...
PDF
Puppet at the centre of everything
PPTX
Writing Serverless Application in Java with comparison of 3 approaches: AWS S...
PDF
Kafka ops-new
PDF
Monitoring Docker at Scale - Docker San Francisco Meetup - August 11, 2015
PDF
Using SLOs for Continuous Performance Optimizations of Your k8s Workloads
PDF
Devoxx university - Kafka de haut en bas
PDF
Docker and Maestro for fun, development and profit
PPTX
Paris Kafka Meetup - patterns anti-patterns
PPT
Reactive programming with examples
PPTX
Serverspec and Sensu - Testing and Monitoring collide
PDF
Introduction to Akka-Streams
PDF
Reliability Guarantees for Apache Kafka
PDF
Microservices: 5 things I wish I'd known - Vincent Kok - Codemotion Amsterdam...
PDF
Distributed fun with etcd
PPTX
Deterministic behaviour and performance in trading systems
ZooKeeper - wait free protocol for coordinating processes
No data loss pipeline with apache kafka
Determinism in finance
Cloud Foundry on OpenStack - An Experience Report | anynines
Cloud Infrastructures Slide Set 8 - More Cloud Technologies - Mesos, Spark | ...
Puppet at the centre of everything
Writing Serverless Application in Java with comparison of 3 approaches: AWS S...
Kafka ops-new
Monitoring Docker at Scale - Docker San Francisco Meetup - August 11, 2015
Using SLOs for Continuous Performance Optimizations of Your k8s Workloads
Devoxx university - Kafka de haut en bas
Docker and Maestro for fun, development and profit
Paris Kafka Meetup - patterns anti-patterns
Reactive programming with examples
Serverspec and Sensu - Testing and Monitoring collide
Introduction to Akka-Streams
Reliability Guarantees for Apache Kafka
Microservices: 5 things I wish I'd known - Vincent Kok - Codemotion Amsterdam...
Distributed fun with etcd
Deterministic behaviour and performance in trading systems
Ad

Similar to Webinar patterns anti patterns (20)

PPTX
Kafka reliability velocity 17
PDF
Exactly-once Semantics in Apache Kafka
PPTX
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
PPT
Kafka Reliability - When it absolutely, positively has to be there
PPT
Apache Kafka Reliability Guarantees StrataHadoop NYC 2015
PPTX
Redis Clustering Advanced___31Mar2025.pptx
PPTX
Lessons learnt on a 2000-core cluster
PDF
Exactly Once Delivery with Kafka - Kafka Tel-Aviv Meetup
PDF
Easier, Better, Faster, Safer Deployment with Docker and Immutable Containers
PDF
Crypto Strikes Back! (Google 2009)
ODP
Writing and testing high frequency trading engines in java
PPTX
Planning to Fail #phpne13
PPT
Advanced off heap ipc
PPS
Storm presentation
PDF
Common issues with Apache Kafka® Producer
ODP
MySQL 5.7 clustering: The developer perspective
PDF
Latency vs everything
PDF
STORMPresentation and all about storm_FINAL.pdf
PDF
Highly concurrent yet natural programming
PDF
Seek and Destroy Kafka Under Replication
Kafka reliability velocity 17
Exactly-once Semantics in Apache Kafka
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
Kafka Reliability - When it absolutely, positively has to be there
Apache Kafka Reliability Guarantees StrataHadoop NYC 2015
Redis Clustering Advanced___31Mar2025.pptx
Lessons learnt on a 2000-core cluster
Exactly Once Delivery with Kafka - Kafka Tel-Aviv Meetup
Easier, Better, Faster, Safer Deployment with Docker and Immutable Containers
Crypto Strikes Back! (Google 2009)
Writing and testing high frequency trading engines in java
Planning to Fail #phpne13
Advanced off heap ipc
Storm presentation
Common issues with Apache Kafka® Producer
MySQL 5.7 clustering: The developer perspective
Latency vs everything
STORMPresentation and all about storm_FINAL.pdf
Highly concurrent yet natural programming
Seek and Destroy Kafka Under Replication
Ad

More from confluent (20)

PDF
Stream Processing Handson Workshop - Flink SQL Hands-on Workshop (Korean)
PPTX
Webinar Think Right - Shift Left - 19-03-2025.pptx
PDF
Migration, backup and restore made easy using Kannika
PDF
Five Things You Need to Know About Data Streaming in 2025
PDF
Data in Motion Tour Seoul 2024 - Keynote
PDF
Data in Motion Tour Seoul 2024 - Roadmap Demo
PDF
From Stream to Screen: Real-Time Data Streaming to Web Frontends with Conflue...
PDF
Confluent per il settore FSI: Accelerare l'Innovazione con il Data Streaming...
PDF
Data in Motion Tour 2024 Riyadh, Saudi Arabia
PDF
Build a Real-Time Decision Support Application for Financial Market Traders w...
PDF
Strumenti e Strategie di Stream Governance con Confluent Platform
PDF
Compose Gen-AI Apps With Real-Time Data - In Minutes, Not Weeks
PDF
Building Real-Time Gen AI Applications with SingleStore and Confluent
PDF
Unlocking value with event-driven architecture by Confluent
PDF
Il Data Streaming per un’AI real-time di nuova generazione
PDF
Unleashing the Future: Building a Scalable and Up-to-Date GenAI Chatbot with ...
PDF
Break data silos with real-time connectivity using Confluent Cloud Connectors
PDF
Building API data products on top of your real-time data infrastructure
PDF
Speed Wins: From Kafka to APIs in Minutes
PDF
Evolving Data Governance for the Real-time Streaming and AI Era
Stream Processing Handson Workshop - Flink SQL Hands-on Workshop (Korean)
Webinar Think Right - Shift Left - 19-03-2025.pptx
Migration, backup and restore made easy using Kannika
Five Things You Need to Know About Data Streaming in 2025
Data in Motion Tour Seoul 2024 - Keynote
Data in Motion Tour Seoul 2024 - Roadmap Demo
From Stream to Screen: Real-Time Data Streaming to Web Frontends with Conflue...
Confluent per il settore FSI: Accelerare l'Innovazione con il Data Streaming...
Data in Motion Tour 2024 Riyadh, Saudi Arabia
Build a Real-Time Decision Support Application for Financial Market Traders w...
Strumenti e Strategie di Stream Governance con Confluent Platform
Compose Gen-AI Apps With Real-Time Data - In Minutes, Not Weeks
Building Real-Time Gen AI Applications with SingleStore and Confluent
Unlocking value with event-driven architecture by Confluent
Il Data Streaming per un’AI real-time di nuova generazione
Unleashing the Future: Building a Scalable and Up-to-Date GenAI Chatbot with ...
Break data silos with real-time connectivity using Confluent Cloud Connectors
Building API data products on top of your real-time data infrastructure
Speed Wins: From Kafka to APIs in Minutes
Evolving Data Governance for the Real-time Streaming and AI Era

Recently uploaded (20)

PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Understanding Forklifts - TECH EHS Solution
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Digital Strategies for Manufacturing Companies
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
System and Network Administration Chapter 2
PDF
System and Network Administraation Chapter 3
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Odoo Companies in India – Driving Business Transformation.pdf
Adobe Illustrator 28.6 Crack My Vision of Vector Design
VVF-Customer-Presentation2025-Ver1.9.pptx
Which alternative to Crystal Reports is best for small or large businesses.pdf
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Understanding Forklifts - TECH EHS Solution
How to Migrate SBCGlobal Email to Yahoo Easily
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Digital Strategies for Manufacturing Companies
Reimagine Home Health with the Power of Agentic AI​
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
System and Network Administration Chapter 2
System and Network Administraation Chapter 3
Odoo POS Development Services by CandidRoot Solutions
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Upgrade and Innovation Strategies for SAP ERP Customers
Lecture 3: Operating Systems Introduction to Computer Hardware Systems

Webinar patterns anti patterns