SlideShare a Scribd company logo
Nklmish
@nklmish
(SPRING) KAFKA - ONE MORE ARSENAL IN A
DISTRIBUTED TOOLBOX

“Therefore, just as water retains no constant shape, so in
warfare there are no constant conditions” - Sun Tzu
About me
•Independent consultant & contractor

•OSS contributor.

•Works for 

•Blog https://nklmish.wordpress.com/
•Swedish startup founded in 2012.

•Strong advocate of DDD & CQRS.

•Event store with billions of events.

•Millions of events every day.

•Every event is EQUALLY important - “I was thinking I might win 50 pounds
but when it went all the way to the jackpot I was shocked.” - Mega Fortune
£2,700,000 jackpot won on the 3rd spin.

•And… we have an amazing culture.
Do you Like Lego?
Simplicity is the key to complexity
You build complex system
Starting with a simple idea
Kafka in a nutshell
Kafka - NOT a service bus
•ESB - Integrate legacy & off the shelf systems.

•Messaging layer (Low throughput).

•Central teams governance (validations, schemas, etc.).

•Beware : Stay away from recreating ESB antipatterns with Kafka. 

•
Kafka - more than a message queue
•Supports both Point-to-point & publish-subscribe

•Extremely fast

•Massive msg throughput

•Msg replaying + retention

•Doesn’t slow down as the no. of consumers increases.

•Scalable

•Stronger ordering guarantees than a traditional messaging system
How
com
e?
Traditional queue, ordering guarantees
C0
C1
C2
Parallelconsumption
R0 R1 R2 R3 …
Server side: Queue retains records in-order
Async delivery
t=1, R0
t=2, R2
t=0, R1
M
essaging
system
solves
this
via
“exclusive
consum
er”
Kafka, ordering guarantees
R0 R1 R2 R3 …
Partition- 0
R0 R1 R2 R3 …
Partition- 1
R0 R1 R2 R3 …
Partition- 2
R0 R1 R2 R3 …
Partition- 3
Topic-X ConsumerGroup-foo
C1
Kafka, ordering guarantees
R0 R1 R2 R3 …
Partition- 0
R0 R1 R2 R3 …
Partition- 1
R0 R1 R2 R3 …
Partition- 2
R0 R1 R2 R3 …
Partition- 3
Topic-X ConsumerGroup-foo
C1
C2
Kafka, a database inside out
Kafka
Commit Log
Stream
Processor
KSQ
L
Kafka
Caching
Indexes
Query engine
Commit log
Traditional database
Kafka Is A Streaming Platform
Kafka, a streaming platform
Kafka
Streaming API (can be stateful)
Kafka Streams & KSQL
Utilities
Schema Registry, Replicator, Mirror Maker, confluent platform
Communication API
API Clients
…
Connector API
Pull & push data to/from, Kafka (S3, JDBC, HDFS…)
Our Challenge
Traditional Messaging + Distributed System = Our Challenge
Three Challenges
•Scalability

•Speed

•Resiliency
Sounds
Fam
iliar?
“In the midst of chaos, there is also opportunity”
Sun Tzu
MOM vs.
Kafka
Broker Centric Approach Client Centric Approach
Index structures (Btree or Hash Tables) Log structured
Retention impacts performance Designed for Retention
Outrage: Significant slow down
Outrage: won’t cause infrastructure to slow
down significantly
Really?
“Immutability changes everything”
Pat Helland
Scalability Comes From Simplicity
Simplicity - Partitioned Log
Log (append only journal)
Reads (single seek & scan)
Writes (Append only)
Caching Comes From Simplicity - Sequential Disk Access
•Relies heavily on the filesystem for storing & caching messages

•Cache will stay warm even if the service is restarted.
Massive Throughput - Comes From Simplicity
•Zero copy - while reading the data is copied directly from disk
buffer to the network buffer; bypassing importing into JVM; In a
nutshell we can saturate the network.
java.nio.channels.File
Channel#transferTo()
Logs Scaling - Comes From Simplicity
Writes Velocity - Comes From Simplicity
Kafka
Sync()
Operation
Avoids flushing i.e.
Replication
Achieves via
Kafka Broker

(with 64 GB of
RAM)
Conclusion
Operates 1000x Faster Than Traditional
Messaging system
Replication built into the low-level design
Resiliency - Comes From Replication
•In sync replicas
Spring Kafka
Spring Kafka
•Spring ecosystem at disposal.

(e.g. Spring Integration)

•Headers improvements.

•Kafka Streams Support.

•Testing made easier.

• Embedded Kafka.

• TestUtils (conditions, helper-methods, etc).
DEMO
What we achieved so far
•Parallel Consumer Reads - 3,080,000/sec
•Single Producer Writes - 640,000/sec
•Total events : 30+ Billion events

•Replay time < 3-5 Hours

•NOTE : We hit hardware limitations rather than Kafka’s.
Nklmish
@nklmish
THANK YOU
FEEDBACK

More Related Content

What's hot

Crash course intro to cassandra
Crash course   intro to cassandraCrash course   intro to cassandra
Crash course intro to cassandraJon Haddad
 
REDIS (Remote Dictionary Server)
REDIS (Remote Dictionary Server)REDIS (Remote Dictionary Server)
REDIS (Remote Dictionary Server)
Ameya Vijay Gokhale
 
Running Open Source Solutions on Windows Azure
Running Open Source Solutions on Windows AzureRunning Open Source Solutions on Windows Azure
Running Open Source Solutions on Windows Azure
Simon Evans
 
SPA vs. MPA
SPA vs. MPASPA vs. MPA
SPA vs. MPA
Mehmet Ali Tastan
 
Dev-Friendly Ops
Dev-Friendly OpsDev-Friendly Ops
Dev-Friendly Ops
Josh Schramm
 
Evolution of server environments
Evolution of server environmentsEvolution of server environments
Evolution of server environments
vpetersson
 
mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012
Chris Westin
 
SQL Server Features That Will Blow Your Mind!
SQL Server Features That Will Blow Your Mind!SQL Server Features That Will Blow Your Mind!
SQL Server Features That Will Blow Your Mind!
Ed Leighton-Dick
 
In Memory Cahce Structure
In Memory Cahce StructureIn Memory Cahce Structure
In Memory Cahce Structure
Mehmet Ali Tastan
 
Introduction to Cassandra - Denver
Introduction to Cassandra - DenverIntroduction to Cassandra - Denver
Introduction to Cassandra - Denver
Jon Haddad
 
Dynamicly Scale Weblogic in the private Cloud clusters
Dynamicly Scale Weblogic in the private Cloud clusters   Dynamicly Scale Weblogic in the private Cloud clusters
Dynamicly Scale Weblogic in the private Cloud clusters
Getting value from IoT, Integration and Data Analytics
 
OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen Anh
OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen AnhOGDC Datastorage Solution_Mr.Dung, Dinh Nguyen Anh
OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen Anh
Buff Nguyen
 
Font End Development and Drupal: Gulp, Sass, Susy, and Mappy Breakpoints
Font End Development and Drupal: Gulp, Sass, Susy, and Mappy BreakpointsFont End Development and Drupal: Gulp, Sass, Susy, and Mappy Breakpoints
Font End Development and Drupal: Gulp, Sass, Susy, and Mappy Breakpoints
OPIN Software Inc.
 
Diagnosing Problems in Production - Cassandra
Diagnosing Problems in Production - CassandraDiagnosing Problems in Production - Cassandra
Diagnosing Problems in Production - Cassandra
Jon Haddad
 
JEE session 1
JEE session 1JEE session 1
JEE session 1
Smita B Kumar
 
RavenDB in the wild
RavenDB in the wildRavenDB in the wild
RavenDB in the wild
Mauro Servienti
 
Cassandra Core Concepts
Cassandra Core ConceptsCassandra Core Concepts
Cassandra Core Concepts
Jon Haddad
 
An Introduction to Membase
An Introduction to MembaseAn Introduction to Membase
An Introduction to MembaseTim Lossen
 
Escalabilidade com Lambda e Elastic Beanstalk – Parte I
Escalabilidade com Lambda e Elastic Beanstalk – Parte IEscalabilidade com Lambda e Elastic Beanstalk – Parte I
Escalabilidade com Lambda e Elastic Beanstalk – Parte I
Leandro Silva
 
MySQL Resources
MySQL ResourcesMySQL Resources
MySQL Resources
radiocats
 

What's hot (20)

Crash course intro to cassandra
Crash course   intro to cassandraCrash course   intro to cassandra
Crash course intro to cassandra
 
REDIS (Remote Dictionary Server)
REDIS (Remote Dictionary Server)REDIS (Remote Dictionary Server)
REDIS (Remote Dictionary Server)
 
Running Open Source Solutions on Windows Azure
Running Open Source Solutions on Windows AzureRunning Open Source Solutions on Windows Azure
Running Open Source Solutions on Windows Azure
 
SPA vs. MPA
SPA vs. MPASPA vs. MPA
SPA vs. MPA
 
Dev-Friendly Ops
Dev-Friendly OpsDev-Friendly Ops
Dev-Friendly Ops
 
Evolution of server environments
Evolution of server environmentsEvolution of server environments
Evolution of server environments
 
mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012
 
SQL Server Features That Will Blow Your Mind!
SQL Server Features That Will Blow Your Mind!SQL Server Features That Will Blow Your Mind!
SQL Server Features That Will Blow Your Mind!
 
In Memory Cahce Structure
In Memory Cahce StructureIn Memory Cahce Structure
In Memory Cahce Structure
 
Introduction to Cassandra - Denver
Introduction to Cassandra - DenverIntroduction to Cassandra - Denver
Introduction to Cassandra - Denver
 
Dynamicly Scale Weblogic in the private Cloud clusters
Dynamicly Scale Weblogic in the private Cloud clusters   Dynamicly Scale Weblogic in the private Cloud clusters
Dynamicly Scale Weblogic in the private Cloud clusters
 
OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen Anh
OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen AnhOGDC Datastorage Solution_Mr.Dung, Dinh Nguyen Anh
OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen Anh
 
Font End Development and Drupal: Gulp, Sass, Susy, and Mappy Breakpoints
Font End Development and Drupal: Gulp, Sass, Susy, and Mappy BreakpointsFont End Development and Drupal: Gulp, Sass, Susy, and Mappy Breakpoints
Font End Development and Drupal: Gulp, Sass, Susy, and Mappy Breakpoints
 
Diagnosing Problems in Production - Cassandra
Diagnosing Problems in Production - CassandraDiagnosing Problems in Production - Cassandra
Diagnosing Problems in Production - Cassandra
 
JEE session 1
JEE session 1JEE session 1
JEE session 1
 
RavenDB in the wild
RavenDB in the wildRavenDB in the wild
RavenDB in the wild
 
Cassandra Core Concepts
Cassandra Core ConceptsCassandra Core Concepts
Cassandra Core Concepts
 
An Introduction to Membase
An Introduction to MembaseAn Introduction to Membase
An Introduction to Membase
 
Escalabilidade com Lambda e Elastic Beanstalk – Parte I
Escalabilidade com Lambda e Elastic Beanstalk – Parte IEscalabilidade com Lambda e Elastic Beanstalk – Parte I
Escalabilidade com Lambda e Elastic Beanstalk – Parte I
 
MySQL Resources
MySQL ResourcesMySQL Resources
MySQL Resources
 

Similar to (SPRING)KAFKA - ONE MORE ARSENAL IN A DISTRIBUTED TOOLBOX

Web Analytics using Kafka - August talk w/ Women Who Code
Web Analytics using Kafka - August talk w/ Women Who CodeWeb Analytics using Kafka - August talk w/ Women Who Code
Web Analytics using Kafka - August talk w/ Women Who Code
Purnima Kamath
 
kafka simplicity and complexity
kafka simplicity and complexitykafka simplicity and complexity
kafka simplicity and complexity
Paolo Platter
 
Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...
Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...
Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...
DataStax Academy
 
0-60: Tesla's Streaming Data Platform ( Jesse Yates, Tesla) Kafka Summit SF 2019
0-60: Tesla's Streaming Data Platform ( Jesse Yates, Tesla) Kafka Summit SF 20190-60: Tesla's Streaming Data Platform ( Jesse Yates, Tesla) Kafka Summit SF 2019
0-60: Tesla's Streaming Data Platform ( Jesse Yates, Tesla) Kafka Summit SF 2019
confluent
 
Sink Your Teeth into Streaming at Any Scale
Sink Your Teeth into Streaming at Any ScaleSink Your Teeth into Streaming at Any Scale
Sink Your Teeth into Streaming at Any Scale
Timothy Spann
 
Sink Your Teeth into Streaming at Any Scale
Sink Your Teeth into Streaming at Any ScaleSink Your Teeth into Streaming at Any Scale
Sink Your Teeth into Streaming at Any Scale
ScyllaDB
 
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
 
Streaming ETL with Apache Kafka and KSQL
Streaming ETL with Apache Kafka and KSQLStreaming ETL with Apache Kafka and KSQL
Streaming ETL with Apache Kafka and KSQL
Nick Dearden
 
Paris jug ksql - 2018-06-28
Paris jug ksql - 2018-06-28Paris jug ksql - 2018-06-28
Paris jug ksql - 2018-06-28
Florent Ramiere
 
Introduction to apache kafka
Introduction to apache kafkaIntroduction to apache kafka
Introduction to apache kafka
Dimitris Kontokostas
 
ksqlDB Workshop
ksqlDB WorkshopksqlDB Workshop
ksqlDB Workshop
confluent
 
Select Stars: A SQL DBA's Introduction to Azure Cosmos DB (SQL Saturday Orego...
Select Stars: A SQL DBA's Introduction to Azure Cosmos DB (SQL Saturday Orego...Select Stars: A SQL DBA's Introduction to Azure Cosmos DB (SQL Saturday Orego...
Select Stars: A SQL DBA's Introduction to Azure Cosmos DB (SQL Saturday Orego...
Bob Pusateri
 
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
 
Kafka - Linkedin's messaging backbone
Kafka - Linkedin's messaging backboneKafka - Linkedin's messaging backbone
Kafka - Linkedin's messaging backbone
Ayyappadas Ravindran (Appu)
 
SQL Server AlwaysOn for Dummies SQLSaturday #202 Edition
SQL Server AlwaysOn for Dummies SQLSaturday #202 EditionSQL Server AlwaysOn for Dummies SQLSaturday #202 Edition
SQL Server AlwaysOn for Dummies SQLSaturday #202 Edition
Mark Broadbent
 
Connecting Akka with Oracle Event Hub Cloud Service
Connecting Akka with Oracle Event Hub Cloud ServiceConnecting Akka with Oracle Event Hub Cloud Service
Connecting Akka with Oracle Event Hub Cloud Service
Dalibor Blazevic
 
10 Principals for Effective Event-Driven Microservices with Apache Kafka
10 Principals for Effective Event-Driven Microservices with Apache Kafka10 Principals for Effective Event-Driven Microservices with Apache Kafka
10 Principals for Effective Event-Driven Microservices with Apache Kafka
Ben Stopford
 
CosmosDB for DBAs & Developers
CosmosDB for DBAs & DevelopersCosmosDB for DBAs & Developers
CosmosDB for DBAs & Developers
Niko Neugebauer
 
Microservices in a Streaming World
Microservices in a Streaming WorldMicroservices in a Streaming World
Microservices in a Streaming World
Hans Jespersen
 
Introducing Apache Kafka and why it is important to Oracle, Java and IT profe...
Introducing Apache Kafka and why it is important to Oracle, Java and IT profe...Introducing Apache Kafka and why it is important to Oracle, Java and IT profe...
Introducing Apache Kafka and why it is important to Oracle, Java and IT profe...
Lucas Jellema
 

Similar to (SPRING)KAFKA - ONE MORE ARSENAL IN A DISTRIBUTED TOOLBOX (20)

Web Analytics using Kafka - August talk w/ Women Who Code
Web Analytics using Kafka - August talk w/ Women Who CodeWeb Analytics using Kafka - August talk w/ Women Who Code
Web Analytics using Kafka - August talk w/ Women Who Code
 
kafka simplicity and complexity
kafka simplicity and complexitykafka simplicity and complexity
kafka simplicity and complexity
 
Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...
Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...
Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...
 
0-60: Tesla's Streaming Data Platform ( Jesse Yates, Tesla) Kafka Summit SF 2019
0-60: Tesla's Streaming Data Platform ( Jesse Yates, Tesla) Kafka Summit SF 20190-60: Tesla's Streaming Data Platform ( Jesse Yates, Tesla) Kafka Summit SF 2019
0-60: Tesla's Streaming Data Platform ( Jesse Yates, Tesla) Kafka Summit SF 2019
 
Sink Your Teeth into Streaming at Any Scale
Sink Your Teeth into Streaming at Any ScaleSink Your Teeth into Streaming at Any Scale
Sink Your Teeth into Streaming at Any Scale
 
Sink Your Teeth into Streaming at Any Scale
Sink Your Teeth into Streaming at Any ScaleSink Your Teeth into Streaming at Any Scale
Sink Your Teeth into Streaming at Any Scale
 
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 !
 
Streaming ETL with Apache Kafka and KSQL
Streaming ETL with Apache Kafka and KSQLStreaming ETL with Apache Kafka and KSQL
Streaming ETL with Apache Kafka and KSQL
 
Paris jug ksql - 2018-06-28
Paris jug ksql - 2018-06-28Paris jug ksql - 2018-06-28
Paris jug ksql - 2018-06-28
 
Introduction to apache kafka
Introduction to apache kafkaIntroduction to apache kafka
Introduction to apache kafka
 
ksqlDB Workshop
ksqlDB WorkshopksqlDB Workshop
ksqlDB Workshop
 
Select Stars: A SQL DBA's Introduction to Azure Cosmos DB (SQL Saturday Orego...
Select Stars: A SQL DBA's Introduction to Azure Cosmos DB (SQL Saturday Orego...Select Stars: A SQL DBA's Introduction to Azure Cosmos DB (SQL Saturday Orego...
Select Stars: A SQL DBA's Introduction to Azure Cosmos DB (SQL Saturday Orego...
 
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...
 
Kafka - Linkedin's messaging backbone
Kafka - Linkedin's messaging backboneKafka - Linkedin's messaging backbone
Kafka - Linkedin's messaging backbone
 
SQL Server AlwaysOn for Dummies SQLSaturday #202 Edition
SQL Server AlwaysOn for Dummies SQLSaturday #202 EditionSQL Server AlwaysOn for Dummies SQLSaturday #202 Edition
SQL Server AlwaysOn for Dummies SQLSaturday #202 Edition
 
Connecting Akka with Oracle Event Hub Cloud Service
Connecting Akka with Oracle Event Hub Cloud ServiceConnecting Akka with Oracle Event Hub Cloud Service
Connecting Akka with Oracle Event Hub Cloud Service
 
10 Principals for Effective Event-Driven Microservices with Apache Kafka
10 Principals for Effective Event-Driven Microservices with Apache Kafka10 Principals for Effective Event-Driven Microservices with Apache Kafka
10 Principals for Effective Event-Driven Microservices with Apache Kafka
 
CosmosDB for DBAs & Developers
CosmosDB for DBAs & DevelopersCosmosDB for DBAs & Developers
CosmosDB for DBAs & Developers
 
Microservices in a Streaming World
Microservices in a Streaming WorldMicroservices in a Streaming World
Microservices in a Streaming World
 
Introducing Apache Kafka and why it is important to Oracle, Java and IT profe...
Introducing Apache Kafka and why it is important to Oracle, Java and IT profe...Introducing Apache Kafka and why it is important to Oracle, Java and IT profe...
Introducing Apache Kafka and why it is important to Oracle, Java and IT profe...
 

More from nklmish

Demystifying Kafka
Demystifying KafkaDemystifying Kafka
Demystifying Kafka
nklmish
 
Scaling CQRS in theory, practice, and reality
Scaling CQRS in theory, practice, and realityScaling CQRS in theory, practice, and reality
Scaling CQRS in theory, practice, and reality
nklmish
 
CQRS and EventSourcing with Spring & Axon
CQRS and EventSourcing with Spring & AxonCQRS and EventSourcing with Spring & Axon
CQRS and EventSourcing with Spring & Axon
nklmish
 
Kotlin boost yourproductivity
Kotlin boost yourproductivityKotlin boost yourproductivity
Kotlin boost yourproductivity
nklmish
 
Distributed tracing - get a grasp on your production
Distributed tracing - get a grasp on your productionDistributed tracing - get a grasp on your production
Distributed tracing - get a grasp on your production
nklmish
 
Spock
SpockSpock
Spock
nklmish
 
Microservice no fluff, the REAL stuff
Microservice no fluff, the REAL stuffMicroservice no fluff, the REAL stuff
Microservice no fluff, the REAL stuff
nklmish
 
Neo4J
Neo4JNeo4J
Neo4J
nklmish
 
Mongo - an intermediate introduction
Mongo - an intermediate introductionMongo - an intermediate introduction
Mongo - an intermediate introduction
nklmish
 
Detailed Introduction To Docker
Detailed Introduction To DockerDetailed Introduction To Docker
Detailed Introduction To Docker
nklmish
 

More from nklmish (10)

Demystifying Kafka
Demystifying KafkaDemystifying Kafka
Demystifying Kafka
 
Scaling CQRS in theory, practice, and reality
Scaling CQRS in theory, practice, and realityScaling CQRS in theory, practice, and reality
Scaling CQRS in theory, practice, and reality
 
CQRS and EventSourcing with Spring & Axon
CQRS and EventSourcing with Spring & AxonCQRS and EventSourcing with Spring & Axon
CQRS and EventSourcing with Spring & Axon
 
Kotlin boost yourproductivity
Kotlin boost yourproductivityKotlin boost yourproductivity
Kotlin boost yourproductivity
 
Distributed tracing - get a grasp on your production
Distributed tracing - get a grasp on your productionDistributed tracing - get a grasp on your production
Distributed tracing - get a grasp on your production
 
Spock
SpockSpock
Spock
 
Microservice no fluff, the REAL stuff
Microservice no fluff, the REAL stuffMicroservice no fluff, the REAL stuff
Microservice no fluff, the REAL stuff
 
Neo4J
Neo4JNeo4J
Neo4J
 
Mongo - an intermediate introduction
Mongo - an intermediate introductionMongo - an intermediate introduction
Mongo - an intermediate introduction
 
Detailed Introduction To Docker
Detailed Introduction To DockerDetailed Introduction To Docker
Detailed Introduction To Docker
 

Recently uploaded

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 

Recently uploaded (20)

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 

(SPRING)KAFKA - ONE MORE ARSENAL IN A DISTRIBUTED TOOLBOX

  • 1. Nklmish @nklmish (SPRING) KAFKA - ONE MORE ARSENAL IN A DISTRIBUTED TOOLBOX
 “Therefore, just as water retains no constant shape, so in warfare there are no constant conditions” - Sun Tzu
  • 2. About me •Independent consultant & contractor •OSS contributor. •Works for •Blog https://nklmish.wordpress.com/
  • 3. •Swedish startup founded in 2012. •Strong advocate of DDD & CQRS. •Event store with billions of events. •Millions of events every day. •Every event is EQUALLY important - “I was thinking I might win 50 pounds but when it went all the way to the jackpot I was shocked.” - Mega Fortune £2,700,000 jackpot won on the 3rd spin. •And… we have an amazing culture.
  • 4. Do you Like Lego?
  • 5.
  • 6.
  • 7. Simplicity is the key to complexity
  • 9. Starting with a simple idea
  • 10. Kafka in a nutshell
  • 11. Kafka - NOT a service bus •ESB - Integrate legacy & off the shelf systems. •Messaging layer (Low throughput). •Central teams governance (validations, schemas, etc.). •Beware : Stay away from recreating ESB antipatterns with Kafka. •
  • 12. Kafka - more than a message queue •Supports both Point-to-point & publish-subscribe •Extremely fast •Massive msg throughput •Msg replaying + retention •Doesn’t slow down as the no. of consumers increases. •Scalable •Stronger ordering guarantees than a traditional messaging system How com e?
  • 13. Traditional queue, ordering guarantees C0 C1 C2 Parallelconsumption R0 R1 R2 R3 … Server side: Queue retains records in-order Async delivery t=1, R0 t=2, R2 t=0, R1 M essaging system solves this via “exclusive consum er”
  • 14. Kafka, ordering guarantees R0 R1 R2 R3 … Partition- 0 R0 R1 R2 R3 … Partition- 1 R0 R1 R2 R3 … Partition- 2 R0 R1 R2 R3 … Partition- 3 Topic-X ConsumerGroup-foo C1
  • 15. Kafka, ordering guarantees R0 R1 R2 R3 … Partition- 0 R0 R1 R2 R3 … Partition- 1 R0 R1 R2 R3 … Partition- 2 R0 R1 R2 R3 … Partition- 3 Topic-X ConsumerGroup-foo C1 C2
  • 16. Kafka, a database inside out Kafka Commit Log Stream Processor KSQ L Kafka Caching Indexes Query engine Commit log Traditional database
  • 17. Kafka Is A Streaming Platform
  • 18. Kafka, a streaming platform Kafka Streaming API (can be stateful) Kafka Streams & KSQL Utilities Schema Registry, Replicator, Mirror Maker, confluent platform Communication API API Clients … Connector API Pull & push data to/from, Kafka (S3, JDBC, HDFS…)
  • 20. Traditional Messaging + Distributed System = Our Challenge
  • 23. “In the midst of chaos, there is also opportunity” Sun Tzu
  • 24. MOM vs. Kafka Broker Centric Approach Client Centric Approach Index structures (Btree or Hash Tables) Log structured Retention impacts performance Designed for Retention Outrage: Significant slow down Outrage: won’t cause infrastructure to slow down significantly
  • 28. Simplicity - Partitioned Log Log (append only journal) Reads (single seek & scan) Writes (Append only)
  • 29. Caching Comes From Simplicity - Sequential Disk Access •Relies heavily on the filesystem for storing & caching messages •Cache will stay warm even if the service is restarted.
  • 30. Massive Throughput - Comes From Simplicity •Zero copy - while reading the data is copied directly from disk buffer to the network buffer; bypassing importing into JVM; In a nutshell we can saturate the network. java.nio.channels.File Channel#transferTo()
  • 31. Logs Scaling - Comes From Simplicity
  • 32. Writes Velocity - Comes From Simplicity Kafka Sync() Operation Avoids flushing i.e. Replication Achieves via Kafka Broker
 (with 64 GB of RAM) Conclusion Operates 1000x Faster Than Traditional Messaging system Replication built into the low-level design
  • 33. Resiliency - Comes From Replication •In sync replicas
  • 35. Spring Kafka •Spring ecosystem at disposal.
 (e.g. Spring Integration) •Headers improvements. •Kafka Streams Support. •Testing made easier. • Embedded Kafka. • TestUtils (conditions, helper-methods, etc).
  • 36. DEMO
  • 37. What we achieved so far •Parallel Consumer Reads - 3,080,000/sec •Single Producer Writes - 640,000/sec •Total events : 30+ Billion events •Replay time < 3-5 Hours •NOTE : We hit hardware limitations rather than Kafka’s.