SlideShare a Scribd company logo
1 of 58
Download to read offline
@lyaruu#Voxxed
Embracing Database Diversity
with Kafka and Debezium
Frank Lyaruu
@lyaruu#Voxxed
Embracing Database Diversity
with Kafka and Debezium
Frank Lyaruu
CTO Dexels
Amsterdam
• Service provider for professional and amateur team sports in the
Netherlands & Belgium
• 10+ years old
• Managing personal data, planning competitions, assigning officials,
supplying data feeds
• 2M+ players
• 6K+ clubs
• 40K matches a week
• Spikey but predictable load
Technology stack
• Oracle database
• Cluster of Java based application servers
• Diverse set of clients
Application Code
Client
Application
Code
Desktop client Desktop client Web client Web client Mobile client Mobile client
Application
Code
Application
Code
Application
Code
Challenge
• Move to a player centric model instead of a club centric
• Few orders of magnitude more users and load
• Moving away from Oracle is not feasible in the short term
• Scaling Oracle is just too expensive, if at all possible
Application Code
Client
Application Code
Client
Plan
1. Capture data in realtime
2. Dump into Kafka
3. Insert into MongoDB
Kafka
• Kafka Broker
• Kafka Connect API
• Kafka Streams API
Kafka
• Persistent pub/sub message bus
• High throughput
• Subscribers can consume at their own speed
• Subscribers can request a ‘rewind’ and re-consume a topic
• Has some tricks to keep the data volume down
• Having both fast and slow consumers is not a problem
Change Data Capture
https://www.confluent.io/blog/apache-kafka-samza-and-the-unix-philosophy-of-distributed-data/
Martin Kleppmann:
Write ahead log
• Archive Log (Oracle)
• Oplog (MongoDB)
• Write Ahead Log (Postgres)
• Binlog (MySQL)
Write ahead log
• Recovery
• Replication
Master / slave replication
Postgres (>=9.4)
46.2.1. Logical Decoding
Logical decoding is the process of extracting all persistent changes to a
database's tables into a coherent, easy to understand format which can be
interpreted without detailed knowledge of the database's internal state.
In PostgreSQL, logical decoding is implemented by decoding the contents of
the write-ahead log, which describe changes on a storage level, into an
application-specific form such as a stream of tuples or SQL statements.
Jeff Klukas / Postgres 9.4 docs
Debezium
• RedHat
• Standardize change data capture
• Uses Kafka Connect API
• Pretty young: 0.7.4
• Based on ‘Bottled Water’ research project
Debezium
• Postgres
• Mysql
• MongoDB
• Oracle*
Core Service
Source database
Java Application Server
Kafka
topic: PERSON
{
id: 123
name: “Alfredo”
dob: 1965-5-1
}
User Backend Service
MongoDB Database
Java Application Server
topic: PERSON
{
id: 123
name: “Alfredo”
dob: 1965-5-1
}
SELECT * FROM Communication C WHERE PersonId = 1
SELECT * FROM Person WHERE PersonId=1
Example
MongoDB
{
   “_id":1,
   "Name":"Alfredo",
   "DOB":"1990-1-1",
   "Communication":{
      "Mobile":"12345",
      "Email":"alfredo@aol.com",
      "Twitter":"@alfredo"
   }
}
Stream Processing
SQL Record SQL Record
Stream
transformation
MongoDB
Stream Processing
SQL Record SQL Record
Kafka Streams
MongoDB
RocksDB
Kafka Streams at Scale
• ± 500M rows of SQL data
• ± 50 joins
• 500 topics
• 400 Gb of Kafka Data
• 300 Gb of RocksDb data
• Building a complete replica from scratch takes many hours
• After that <100ms latency for changes
Development cycle
• Developing and testing is hard for stateful code
• Starting a new ‘generation’ is costly
• Contaminated data might show up
Conclusions
• Went into production last June
• Generally behaves well (aside from some glitches)
• Kafka Streams is in a lot better state than a year ago
Architecture
Microservice
API
Any private store
Code in whatever
language
Different parts need the same
data
… but in a different way
Application
UI
SQL Database
Code in some
language
Analytics code
Analytics UI
Application Service
UI
SQL Database
Code in some
language
Analytics UI
Analytics code
Analytics Service
Analytics Database
Analytics API
Application Service
UI
SQL Database
Code in some
language
Analytics UI
Analytics code
Analytics Service
Analytics Database
Analytics API
Event Driven Microservices
• Services push events instead of a request/response model
• Usually backed by a publish/subscribe bus
Application Service
SQL Database
Code in some language
Event Bus
topic: PERSON
{
id: 123
name: “Alfredo”
dob: 1965-5-1
}
Analytics Service
Analytics Database
Code in some language
topic: PERSON
{
id: 123
name: “Alfredo”
dob: 1965-5-1
}
Event Sourcing
Elasticsearch
• Add unstructured search to our application
• Reduces load on our source databases
• Users expect google-like interfaces
Neo4J
• Graph Database
• Some analytics are much easier to express in terms of graphs
Firebase Realtime
• Real-time database
• ‘Backend As a Service’
• Essentially one big JSON document
• Very easy to use client libraries for web and mobile
• Safe to develop
Caches
• We can use our streaming engine to update / invalidate caches
Push to clients
• We can push data to clients in real time
Mac book
Postgres Zookeeper Kafka
Kafka
Connect /
Debezium
Kafka
Streams
MongoDB
{
"_id" : "1001",
"Address" : [
{
"zip" : "76036",
"city" : "Euless",
"street" : "3183 Moore Avenue",
"id" : 10,
"state" : "Texas",
"customer_id" : 1001,
"type" : "SHIPPING"
}
],
"last_name" : "Thomas",
"id" : 1001,
"first_name" : "Sally",
"email" : "sally.thomas@acme.com"
}
MongoDB
Kafka
Postgres Debezium
Kafka
Streams
MongoDB
Kafka
Connect
Demo?
If all you have is a hammer…
If all you have is SQL…
you will always think relational
you will always think you need nothing else
Questions?
* Any question that is not: “Why don’t you use Postgres? Postgres can do anything”

More Related Content

What's hot

From Newbie to Highly Available, a Successful Kafka Adoption Tale (Jonathan S...
From Newbie to Highly Available, a Successful Kafka Adoption Tale (Jonathan S...From Newbie to Highly Available, a Successful Kafka Adoption Tale (Jonathan S...
From Newbie to Highly Available, a Successful Kafka Adoption Tale (Jonathan S...
confluent
 

What's hot (20)

Developing a custom Kafka connector? Make it shine! | Igor Buzatović, Porsche...
Developing a custom Kafka connector? Make it shine! | Igor Buzatović, Porsche...Developing a custom Kafka connector? Make it shine! | Igor Buzatović, Porsche...
Developing a custom Kafka connector? Make it shine! | Igor Buzatović, Porsche...
 
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...
 
Shattering The Monolith(s) (Martin Kess, Namely) Kafka Summit SF 2019
Shattering The Monolith(s) (Martin Kess, Namely) Kafka Summit SF 2019 Shattering The Monolith(s) (Martin Kess, Namely) Kafka Summit SF 2019
Shattering The Monolith(s) (Martin Kess, Namely) Kafka Summit SF 2019
 
Guaranteed Event Delivery with Kafka and NodeJS | Amitesh Madhur, Nutanix
Guaranteed Event Delivery with Kafka and NodeJS | Amitesh Madhur, NutanixGuaranteed Event Delivery with Kafka and NodeJS | Amitesh Madhur, Nutanix
Guaranteed Event Delivery with Kafka and NodeJS | Amitesh Madhur, Nutanix
 
Making Kafka Cloud Native | Jay Kreps, Co-Founder & CEO, Confluent
Making Kafka Cloud Native | Jay Kreps, Co-Founder & CEO, ConfluentMaking Kafka Cloud Native | Jay Kreps, Co-Founder & CEO, Confluent
Making Kafka Cloud Native | Jay Kreps, Co-Founder & CEO, Confluent
 
How to over-engineer things and have fun? | Oto Brglez, OPALAB
How to over-engineer things and have fun? | Oto Brglez, OPALABHow to over-engineer things and have fun? | Oto Brglez, OPALAB
How to over-engineer things and have fun? | Oto Brglez, OPALAB
 
Real time Messages at Scale with Apache Kafka and Couchbase
Real time Messages at Scale with Apache Kafka and CouchbaseReal time Messages at Scale with Apache Kafka and Couchbase
Real time Messages at Scale with Apache Kafka and Couchbase
 
Scaling an Event-Driven Architecture with IBM and Confluent | Antony Amanse a...
Scaling an Event-Driven Architecture with IBM and Confluent | Antony Amanse a...Scaling an Event-Driven Architecture with IBM and Confluent | Antony Amanse a...
Scaling an Event-Driven Architecture with IBM and Confluent | Antony Amanse a...
 
Tradeoffs in Distributed Systems Design: Is Kafka The Best? (Ben Stopford and...
Tradeoffs in Distributed Systems Design: Is Kafka The Best? (Ben Stopford and...Tradeoffs in Distributed Systems Design: Is Kafka The Best? (Ben Stopford and...
Tradeoffs in Distributed Systems Design: Is Kafka The Best? (Ben Stopford and...
 
Securing the Message Bus with Kafka Streams | Paul Otto and Ryan Salcido, Raf...
Securing the Message Bus with Kafka Streams | Paul Otto and Ryan Salcido, Raf...Securing the Message Bus with Kafka Streams | Paul Otto and Ryan Salcido, Raf...
Securing the Message Bus with Kafka Streams | Paul Otto and Ryan Salcido, Raf...
 
Failing to Cross the Streams – Lessons Learned the Hard Way | Philip Schmitt,...
Failing to Cross the Streams – Lessons Learned the Hard Way | Philip Schmitt,...Failing to Cross the Streams – Lessons Learned the Hard Way | Philip Schmitt,...
Failing to Cross the Streams – Lessons Learned the Hard Way | Philip Schmitt,...
 
Running Kafka On Kubernetes With Strimzi For Real-Time Streaming Applications
Running Kafka On Kubernetes With Strimzi For Real-Time Streaming ApplicationsRunning Kafka On Kubernetes With Strimzi For Real-Time Streaming Applications
Running Kafka On Kubernetes With Strimzi For Real-Time Streaming Applications
 
Data integration with Apache Kafka
Data integration with Apache KafkaData integration with Apache Kafka
Data integration with Apache Kafka
 
From Newbie to Highly Available, a Successful Kafka Adoption Tale (Jonathan S...
From Newbie to Highly Available, a Successful Kafka Adoption Tale (Jonathan S...From Newbie to Highly Available, a Successful Kafka Adoption Tale (Jonathan S...
From Newbie to Highly Available, a Successful Kafka Adoption Tale (Jonathan S...
 
Understanding Apache Kafka® Latency at Scale
Understanding Apache Kafka® Latency at ScaleUnderstanding Apache Kafka® Latency at Scale
Understanding Apache Kafka® Latency at Scale
 
Change Data Capture using Kafka
Change Data Capture using KafkaChange Data Capture using Kafka
Change Data Capture using Kafka
 
Databus - LinkedIn's Change Data Capture Pipeline
Databus - LinkedIn's Change Data Capture PipelineDatabus - LinkedIn's Change Data Capture Pipeline
Databus - LinkedIn's Change Data Capture Pipeline
 
Real-Time Analytics Visualized w/ Kafka + Streamliner + MemSQL + ZoomData, An...
Real-Time Analytics Visualized w/ Kafka + Streamliner + MemSQL + ZoomData, An...Real-Time Analytics Visualized w/ Kafka + Streamliner + MemSQL + ZoomData, An...
Real-Time Analytics Visualized w/ Kafka + Streamliner + MemSQL + ZoomData, An...
 
Scaling a backend for a big data and blockchain environment by Rafael Ríos at...
Scaling a backend for a big data and blockchain environment by Rafael Ríos at...Scaling a backend for a big data and blockchain environment by Rafael Ríos at...
Scaling a backend for a big data and blockchain environment by Rafael Ríos at...
 
Strimzi - Where Apache Kafka meets OpenShift - OpenShift Spain MeetUp
Strimzi - Where Apache Kafka meets OpenShift - OpenShift Spain MeetUpStrimzi - Where Apache Kafka meets OpenShift - OpenShift Spain MeetUp
Strimzi - Where Apache Kafka meets OpenShift - OpenShift Spain MeetUp
 

Similar to Embracing Database Diversity with Kafka and Debezium

Similar to Embracing Database Diversity with Kafka and Debezium (20)

SQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The MoveSQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The Move
 
Postgres for Digital Transformation: NoSQL Features, Replication, FDW & More
Postgres for Digital Transformation:NoSQL Features, Replication, FDW & MorePostgres for Digital Transformation:NoSQL Features, Replication, FDW & More
Postgres for Digital Transformation: NoSQL Features, Replication, FDW & More
 
Introduction to Foxx by our community member Iskandar Soesman @ikandars
Introduction to Foxx by our community member Iskandar Soesman @ikandarsIntroduction to Foxx by our community member Iskandar Soesman @ikandars
Introduction to Foxx by our community member Iskandar Soesman @ikandars
 
Couchbase Mobile on Android
Couchbase Mobile on AndroidCouchbase Mobile on Android
Couchbase Mobile on Android
 
Integrate MongoDB & SQL data with a single REST API
Integrate MongoDB & SQL data with a single REST APIIntegrate MongoDB & SQL data with a single REST API
Integrate MongoDB & SQL data with a single REST API
 
Cosmos DB and Azure Functions A serverless database processing.pptx
Cosmos DB and Azure Functions  A serverless database processing.pptxCosmos DB and Azure Functions  A serverless database processing.pptx
Cosmos DB and Azure Functions A serverless database processing.pptx
 
DataWeekender 4_2 Cosmos DB and Azure Functions- A serverless database proces...
DataWeekender 4_2 Cosmos DB and Azure Functions- A serverless database proces...DataWeekender 4_2 Cosmos DB and Azure Functions- A serverless database proces...
DataWeekender 4_2 Cosmos DB and Azure Functions- A serverless database proces...
 
Whats new in Oracle Database 12c release 12.1.0.2
Whats new in Oracle Database 12c release 12.1.0.2Whats new in Oracle Database 12c release 12.1.0.2
Whats new in Oracle Database 12c release 12.1.0.2
 
MongoDB .local Munich 2019: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local Munich 2019: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local Munich 2019: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local Munich 2019: MongoDB Atlas Data Lake Technical Deep Dive
 
NoSQL Migration Technical Pitch Deck
NoSQL Migration Technical Pitch DeckNoSQL Migration Technical Pitch Deck
NoSQL Migration Technical Pitch Deck
 
Modern ETL: Azure Data Factory, Data Lake, and SQL Database
Modern ETL: Azure Data Factory, Data Lake, and SQL DatabaseModern ETL: Azure Data Factory, Data Lake, and SQL Database
Modern ETL: Azure Data Factory, Data Lake, and SQL Database
 
Adobe Spark Meetup - 9/19/2018 - San Jose, CA
Adobe Spark Meetup - 9/19/2018 - San Jose, CAAdobe Spark Meetup - 9/19/2018 - San Jose, CA
Adobe Spark Meetup - 9/19/2018 - San Jose, CA
 
Frame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine LearningFrame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine Learning
 
High Performance Enterprise Data Processing with Apache Spark with Sandeep Va...
High Performance Enterprise Data Processing with Apache Spark with Sandeep Va...High Performance Enterprise Data Processing with Apache Spark with Sandeep Va...
High Performance Enterprise Data Processing with Apache Spark with Sandeep Va...
 
Serverless SQL
Serverless SQLServerless SQL
Serverless SQL
 
Node.CQ - Creating Real-time Data Mashups with Node.JS and Adobe CQ
Node.CQ - Creating Real-time Data Mashups with Node.JS and Adobe CQNode.CQ - Creating Real-time Data Mashups with Node.JS and Adobe CQ
Node.CQ - Creating Real-time Data Mashups with Node.JS and Adobe CQ
 
Tackle Containerization Advisor (TCA) for Legacy Applications
Tackle Containerization Advisor (TCA) for Legacy ApplicationsTackle Containerization Advisor (TCA) for Legacy Applications
Tackle Containerization Advisor (TCA) for Legacy Applications
 
David Max SATURN 2018 - Migrating from Oracle to Espresso
David Max SATURN 2018 - Migrating from Oracle to EspressoDavid Max SATURN 2018 - Migrating from Oracle to Espresso
David Max SATURN 2018 - Migrating from Oracle to Espresso
 
Azure Data Factory V2; The Data Flows
Azure Data Factory V2; The Data FlowsAzure Data Factory V2; The Data Flows
Azure Data Factory V2; The Data Flows
 
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
 

More from Frank Lyaruu

More from Frank Lyaruu (8)

Too young to quit, too old to change
Too young to quit, too old to changeToo young to quit, too old to change
Too young to quit, too old to change
 
Non Blocking I/O for Everyone with RxJava
Non Blocking I/O for Everyone with RxJavaNon Blocking I/O for Everyone with RxJava
Non Blocking I/O for Everyone with RxJava
 
The Road To Reactive with RxJava JEEConf 2016
The Road To Reactive with RxJava JEEConf 2016The Road To Reactive with RxJava JEEConf 2016
The Road To Reactive with RxJava JEEConf 2016
 
Scripting Languages in OSGi
Scripting Languages in OSGiScripting Languages in OSGi
Scripting Languages in OSGi
 
ApacheCon Core: Service Discovery in OSGi: Beyond the JVM using Docker and Co...
ApacheCon Core: Service Discovery in OSGi: Beyond the JVM using Docker and Co...ApacheCon Core: Service Discovery in OSGi: Beyond the JVM using Docker and Co...
ApacheCon Core: Service Discovery in OSGi: Beyond the JVM using Docker and Co...
 
Developing Like There's No Tomorrow
Developing Like There's No TomorrowDeveloping Like There's No Tomorrow
Developing Like There's No Tomorrow
 
Service Discovery in OSGi: Beyond the JVM using Docker and Consul
Service Discovery in OSGi: Beyond the JVM using Docker and ConsulService Discovery in OSGi: Beyond the JVM using Docker and Consul
Service Discovery in OSGi: Beyond the JVM using Docker and Consul
 
Deploying OSGi on an Army of CubieTrucksSendrato powerpoint
Deploying OSGi on an Army of CubieTrucksSendrato powerpointDeploying OSGi on an Army of CubieTrucksSendrato powerpoint
Deploying OSGi on an Army of CubieTrucksSendrato powerpoint
 

Recently uploaded

audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
lolsDocherty
 
Production 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxProduction 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptx
ChloeMeadows1
 

Recently uploaded (17)

audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
 
GOOGLE Io 2024 At takes center stage.pdf
GOOGLE Io 2024 At takes center stage.pdfGOOGLE Io 2024 At takes center stage.pdf
GOOGLE Io 2024 At takes center stage.pdf
 
Development Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of appsDevelopment Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of apps
 
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
 
I’ll See Y’All Motherfuckers In Game 7 Shirt
I’ll See Y’All Motherfuckers In Game 7 ShirtI’ll See Y’All Motherfuckers In Game 7 Shirt
I’ll See Y’All Motherfuckers In Game 7 Shirt
 
Pvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdf
 
Thank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirtsThank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirts
 
Production 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxProduction 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptx
 
Statistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdfStatistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdf
 
Premier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdfPremier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdf
 
Bug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideBug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's Guide
 
Free scottie t shirts Free scottie t shirts
Free scottie t shirts Free scottie t shirtsFree scottie t shirts Free scottie t shirts
Free scottie t shirts Free scottie t shirts
 
Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital PresenceCyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
 
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWebiThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
 
How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?
 
Reggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirts
 
The Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyThe Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case Study
 

Embracing Database Diversity with Kafka and Debezium