SlideShare a Scribd company logo
1 of 45
Download to read offline
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Can Apache Kafka Replace a Database?
Kafka’s Capabilities and Trade-Offs for Storage, Queries, Processing, Transactions, Connectivity
Kai Waehner
Field CTO
contact@kai-waehner.de
@KaiWaehner
www.confluent.io
www.kai-waehner.de
linkedin.com/in/kaiwaehner
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Is Kafka a Database?
This was answered [with ‘yes’] a few years ago…
2
https://www.confluent.io/kafka-summit-SF18/is-kafka-a-database/
… and many things changed [= improved] since then!
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Yes.
Kafka is
a database!
Can
replace
another
Database?
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Agenda
4
1. What is a Database?
2. What is Apache Kafka?
3. Storage in Kafka
4. Queries and Processing in Kafka
5. Transactions in Kafka
6. Connectivity
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Agenda
5
1. What is a Database?
2. What is Apache Kafka?
3. Storage in Kafka
4. Queries and Processing in Kafka
5. Transactions in Kafka
6. Connectivity
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
What is a Database?
6
Database Concepts
1960s: Navigational DBMS
1970s, Relational DBMS
Late 1970s: SQL DBMS
1980s: On the desktop
1990s: Object-oriented
2000s: NoSQL / NewSQL
2010s: DBaaS
Database Features
Storage
Queries (CRUD)
Processing
Transactions
Backup
Replication
…
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Database Theorems
7
Atomicity
Consistency
Isolation
Durability
Consistency
Availability
Partitioning
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Database Examples
8
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Database Examples
9
I thought
Kafka is for
data in motion?
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Agenda
10
1. What is a Database?
2. What is Apache Kafka?
3. Storage in Kafka
4. Queries and Processing in Kafka
5. Transactions in Kafka
6. Connectivity
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Apache Kafka is an Event Streaming Platform
MES
ERP
Sensors
Mobile
Customer 360
Real-time
Alerting System
Data warehouse
Producers
Consumers
Streams and storage of real time events
Stream
processing
apps
Connectors
Connectors
Stream
processing
apps
Supplier
Alert
Forecast
Inventory Customer
Order
11
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
ETL/Data Integration Messaging
Highly Scalable
Durable
Persistent
Ordered
Real-time Difficult to Scale
No Persistence After
Consumption
No Replay
Batch
Expensive
Time Consuming
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Highly Scalable
Persistent
ETL/Data Integration Messaging
ETL/Data Integration Messaging
Messaging
Batch
Expensive
Time Consuming
Difficult to Scale
No Persistence After
Consumption
No Replay
Real-time
Highly Scalable
Durable
Persistent
Ordered
Real-time
Event Streaming
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Improve
Customer
Experience
(CX)
Increase
Revenue
(make money)
Business
Value
Decrease
Costs
(save money)
Core Business
Platform
Increase
Operational
Efficiency
Migrate to
Cloud
Mitigate Risk
(protect money)
Key Drivers
Strategic Objectives
(sample)
Fraud
Detection
IoT sensor
ingestion
Digital replatforming/
Mainframe Offload
Connected Car: Navigation & improved in-
car experience: Audi
Customer 360
Simplifying Omni-channel Retail at Scale:
Target
Faster transactional
processing / analysis
incl. Machine Learning / AI
Mainframe Offload: RBC
Microservices
Architecture
Online Fraud Detection
Online Security
(syslog, log aggregation,
Splunk replacement)
Middleware
replacement
Regulatory
Digital
Transformation
Application Modernization: Multiple
Examples
Website / Core
Operations
(Central Nervous System)
The [Silicon Valley] Digital Natives; LinkedIn,
Netflix, Uber, Yelp...
Predictive Maintenance: Audi
Streaming Platform in a regulated
environment (e.g. Electronic Medical
Records): Celmatix
Real-time app
updates
Real Time Streaming Platform for
Communications and Beyond: Capital One
Developer Velocity - Building Stateful
Financial Applications with Kafka Streams:
Funding Circle
Detect Fraud & Prevent Fraud in Real Time:
PayPal
Kafka as a Service - A Tale of Security and
Multi-Tenancy: Apple
Example Use Cases
$↑
$↓
$↔
Example Case Studies
(of many)
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Agenda
15
1. What is a Database?
2. What is Apache Kafka?
3. Storage in Kafka
4. Queries and Processing in Kafka
5. Transactions in Kafka
6. Connectivity
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Kafka’s Distributed Commit Log is the Storage
(and enables real decoupling and domain-driven design)
16
https://www.confluent.io/blog/microservices-apache-kafka-domain-driven-design/
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Kafka Stores Your Data Durably.
https://www.confluent.io/blog/publishing-apache-kafka-new-york-times/
Kafka is the source of truth.
Powers NYTimes.com, and stores
all articles ever published since 1851.
September 30, 1851, Page 1
Kafka is the leading system.
Account Activity Replay API to recover events
that weren’t delivered for various reasons
https://blog.twitter.com/engineering/en_us/topics/infrastructure/2020/kafka-as-a-storage-system.html
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Confluent Tiered Storage for Kafka
18
(Only available in Confluent Platform)
Store data forever
Hot and cold storage
Cheap object store
Easy scale up/down
No changes in clients
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Tiered Storage for Apache Kafka
KIP-405 –
Add Tiered Storage Support to Kafka
Confluent is actively working on this with the
open source community -
Uber is leading this initiative
Confluent Tiered Storage is available today in
Confluent Platform and used under the hood in
Confluent Cloud
https://cwiki.apache.org/confluence/display/KAFKA/KIP-405%3A+Kafka+Tiered+Storage
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Log Compaction with Compacted Topics
20
Retain last known value
for each message key
No retention time
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Stateful Kafka Applications
Kafka Streams and ksqlDB embed RocksDB
21
Do I really need
another database for
my microservice?
streams
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Kafka as Single Source of Truth
22
The Leading System is
Real-Time and Scalable
Real Decoupling
Handling Slow Consumers
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Agenda
23
1. What is a Database?
2. What is Apache Kafka?
3. Storage in Kafka
4. Queries and Processing in Kafka
5. Transactions in Kafka
6. Connectivity
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Kafka
C++ Client
Kafka Cluster
Monolith
Kafka Decouples Storage and Compute
Cloud DWH
Snowflake
Connector
Schema Registry
Storage
Compute Compute
(+ non-Kafka Storage)
KSQL
App
KSQL
App
KSQL
App
Compute
Compute Compute
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Confluent & The Future of SQL
ksqlDB’s model is
leading the way to the
new official standard.
What is it?
Confluent collaborates with other DB vendors
in the US Standards Body (INCITS DM32) on adding
Streaming SQL to the SQL standard.
Here, we discuss how to represent:
• Streams vs. Tables
• Traditional vs. Continuous queries
• Mutable vs. Immutable data
• Event-time vs. Processing-time
• Historical queries vs. Present-time queries
and more
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Query and Event Processing in Kafka
26
PUSH à Continuously process and forward events
PULL à Client requests events (like you know it from your favourite database)
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
ksqlDB - The Event Streaming Database
27
-- Continuously look up data in a table; query keeps running
SELECT * FROM myTable WHERE ... EMIT CHANGES
-- Continuously look up data in a stream; query keeps running
SELECT * FROM myStream WHERE ... EMIT CHANGES
-- Look up data in a table once; query then terminates
SELECT * FROM myTable WHERE ...
app
app
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
ksqlDB - The Event Streaming Database
• Project created by Confluent, source-available license: https://ksqldb.io/
• A ksqlDB cluster runs in a distributed manner across many server nodes
• Tightly integrates with Apache Kafka® as its persistent storage layer
• Has projections, transformations, aggregations, windowing, joins, etc.
• Distinguishes between event-time and processing-time
• Handles out-of-order and late data
• Streaming import-export for external data systems
• DDL and DML via SQL-like statements
• Security features like role-based access control
• Run it yourself or use SaaS offering in Confluent Cloud
28
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Continuous Queries and Processing
29
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Queries through the Kafka Consumer
30
• Continuous consumption of the latest events (in real time or batch)
• Just specific time frames or partitions
• All data from the beginning
connect
Cluster Linking
REST Proxy
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Queries for Consuming Historical Events
Give me all events from time A to time B
Real-time Producer
Time
• New consumer application
• Error-handling
• Compliance / regulatory processing
• Query and analyze existing events
• Schema changes in analytics platform
• Model training
Real-time Consumer
Consumer of Historical Data
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Interactive Queries
Query values from the client applications’ state store
Optional Proxy (e.g. HTTP or WebSockets)
Limitation: Only Key/Value or table scans,
but no complex queries or ANSI SQL
32
streams
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Interactive Queries
Table Scan Example
33
streams
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
ANSI SQL Queries against the Kafka Log
3rd Party Add-Ons help
Integration with any Business Intelligence Tool
34
https://www.confluent.io/blog/analytics-with-apache-kafka-and-rockset/
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Agenda
35
1. What is a Database?
2. What is Apache Kafka?
3. Storage in Kafka
4. Queries and Processing in Kafka
5. Transactions in Kafka
6. Connectivity
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Exactly-Once Semantics (EOS) in Kafka
No Two-Phase-Commit (because that does not scale)
Idempotent Producer and Transactions API
Supported by the whole Kafka Ecosystem (not just Messaging)
36
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Transaction API in Apache Kafka
https://cwiki.apache.org/confluence/display/KAFKA/KIP-98+-+Exactly+Once+Delivery+and+Transactional+Messaging
https://www.confluent.io/kafka-summit-london18/dont-repeat-yourself-introducing-exactly-once-semantics-in-apache-kafka/
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
From the Mainframe to ksqlDB in the Cloud
Bi-Directional End-to-End Referential Integrity
ksqlDB
App
CICS
Mainframe
Transactions
Bi-Directional Integration
Secured Referential Integrity
End-to-End “Transactions”
Low Latency
Database
change
Microservices
events
SaaS
data
Customer
experiences
Streams of real time events
Kafka
Exactly-Once
Semantics
using librdkafka
IMS
DB
Cobol App
Kafka
Exactly-Once
Semantics
using ksqlDB
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Agenda
39
1. What is a Database?
2. What is Apache Kafka?
3. Storage in Kafka
4. Queries and Processing in Kafka
5. Transactions in Kafka
6. Connectivity
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Kafka Connect
Integration between Databases, Applications, APIs, SaaS
Kafka-native (no other middleware required)
Sources and Sinks
Legacy and Modern
Real-Time and Batch
40
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Turn the Database Inside Out!
Materialized Views
The heart is real-time, scalable and durable
Integration with any Database for specific use cases and queries
41
https://www.confluent.io/blog/turning-the-database-inside-out-with-apache-samza/
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Global Event Streaming
Streaming Replication between Kafka Clusters
Bridge to Databases, Data Lakes, Apps, APIs, SaaS
Aggregate Small Footprint
Edge Deployments with
Replication (Aggregation)
Simplify Disaster Recovery
Operations with
Multi-Region Clusters
with RPO=0 and RTO=0
Stream Data Globally with
Replication and Cluster Linking
42
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Yes.
But it does not replace
all other databases!
Can
replace a
Database?
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
TL;DR
• Kafka can store data forever in a durable and high available manner providing ACID
guarantees
• Different options to query historical data are available in Kafka
• Kafka-native add-ons like ksqlDB or Tiered Storage make Kafka more powerful than ever
before for processing data in motion and event-based long-term storage
• Stateful applications can be built leveraging Kafka clients (microservices, business
applications) without the need for another external database
• Not a replacement for existing databases like MySQL, MongoDB, Elasticsearch or
Hadoop
• Other databases and Kafka complement each other; the right solution has to be
selected for a problem; often purpose-built materialized views are created and updated
in real time from the central event-based infrastructure
• Different options are available for bi-directional pull and push based
integration between Kafka and databases to complement each other
@KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database?
Kai Waehner
Field CTO
contact@kai-waehner.de
@KaiWaehner
www.kai-waehner.de
www.confluent.io
linkedin.com/in/kaiwaehner
Questions? Feedback?
Let’s connect!

More Related Content

What's hot

Kafka as your Data Lake - is it Feasible? (Guido Schmutz, Trivadis) Kafka Sum...
Kafka as your Data Lake - is it Feasible? (Guido Schmutz, Trivadis) Kafka Sum...Kafka as your Data Lake - is it Feasible? (Guido Schmutz, Trivadis) Kafka Sum...
Kafka as your Data Lake - is it Feasible? (Guido Schmutz, Trivadis) Kafka Sum...
HostedbyConfluent
 
Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...
Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...
Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...
confluent
 
Can Apache Kafka Replace a Database?
Can Apache Kafka Replace a Database?Can Apache Kafka Replace a Database?
Can Apache Kafka Replace a Database?
Kai Wähner
 

What's hot (20)

Saga pattern and event sourcing with kafka
Saga pattern and event sourcing with kafkaSaga pattern and event sourcing with kafka
Saga pattern and event sourcing with kafka
 
Webinar | Better Together: Apache Cassandra and Apache Kafka
Webinar  |  Better Together: Apache Cassandra and Apache KafkaWebinar  |  Better Together: Apache Cassandra and Apache Kafka
Webinar | Better Together: Apache Cassandra and Apache Kafka
 
Kafka as your Data Lake - is it Feasible? (Guido Schmutz, Trivadis) Kafka Sum...
Kafka as your Data Lake - is it Feasible? (Guido Schmutz, Trivadis) Kafka Sum...Kafka as your Data Lake - is it Feasible? (Guido Schmutz, Trivadis) Kafka Sum...
Kafka as your Data Lake - is it Feasible? (Guido Schmutz, Trivadis) Kafka Sum...
 
Stream Processing Live Traffic Data with Kafka Streams
Stream Processing Live Traffic Data with Kafka StreamsStream Processing Live Traffic Data with Kafka Streams
Stream Processing Live Traffic Data with Kafka Streams
 
Tale of two streaming frameworks (Karthik D - Walmart)
Tale of two streaming frameworks (Karthik D - Walmart)Tale of two streaming frameworks (Karthik D - Walmart)
Tale of two streaming frameworks (Karthik D - Walmart)
 
Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...
Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...
Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...
 
Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...
Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...
Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...
 
Secure Kafka at scale in true multi-tenant environment ( Vishnu Balusu & Asho...
Secure Kafka at scale in true multi-tenant environment ( Vishnu Balusu & Asho...Secure Kafka at scale in true multi-tenant environment ( Vishnu Balusu & Asho...
Secure Kafka at scale in true multi-tenant environment ( Vishnu Balusu & Asho...
 
Confluent Kafka and KSQL: Streaming Data Pipelines Made Easy
Confluent Kafka and KSQL: Streaming Data Pipelines Made EasyConfluent Kafka and KSQL: Streaming Data Pipelines Made Easy
Confluent Kafka and KSQL: Streaming Data Pipelines Made Easy
 
Real-World Pulsar Architectural Patterns
Real-World Pulsar Architectural PatternsReal-World Pulsar Architectural Patterns
Real-World Pulsar Architectural Patterns
 
From data stream management to distributed dataflows and beyond
From data stream management to distributed dataflows and beyondFrom data stream management to distributed dataflows and beyond
From data stream management to distributed dataflows and beyond
 
So You’ve Inherited Kafka? Now What? (Alon Gavra, AppsFlyer) Kafka Summit Lon...
So You’ve Inherited Kafka? Now What? (Alon Gavra, AppsFlyer) Kafka Summit Lon...So You’ve Inherited Kafka? Now What? (Alon Gavra, AppsFlyer) Kafka Summit Lon...
So You’ve Inherited Kafka? Now What? (Alon Gavra, AppsFlyer) Kafka Summit Lon...
 
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...
 
Integrating Apache Kafka Into Your Environment
Integrating Apache Kafka Into Your EnvironmentIntegrating Apache Kafka Into Your Environment
Integrating Apache Kafka Into Your Environment
 
Can Apache Kafka Replace a Database?
Can Apache Kafka Replace a Database?Can Apache Kafka Replace a Database?
Can Apache Kafka Replace a Database?
 
Event Driven Architectures with Apache Kafka on Heroku
Event Driven Architectures with Apache Kafka on HerokuEvent Driven Architectures with Apache Kafka on Heroku
Event Driven Architectures with Apache Kafka on Heroku
 
ksqlDB: A Stream-Relational Database System
ksqlDB: A Stream-Relational Database SystemksqlDB: A Stream-Relational Database System
ksqlDB: A Stream-Relational Database System
 
Designing Payloads for Event-Driven Systems | Lorna Mitchell, Aiven
Designing Payloads for Event-Driven Systems | Lorna Mitchell, AivenDesigning Payloads for Event-Driven Systems | Lorna Mitchell, Aiven
Designing Payloads for Event-Driven Systems | Lorna Mitchell, Aiven
 
MongoDB .local London 2019: Streaming Data on the Shoulders of Giants
MongoDB .local London 2019: Streaming Data on the Shoulders of GiantsMongoDB .local London 2019: Streaming Data on the Shoulders of Giants
MongoDB .local London 2019: Streaming Data on the Shoulders of Giants
 
What is Apache Kafka and What is an Event Streaming Platform?
What is Apache Kafka and What is an Event Streaming Platform?What is Apache Kafka and What is an Event Streaming Platform?
What is Apache Kafka and What is an Event Streaming Platform?
 

Similar to Can Apache Kafka Replace a Database? – The 2021 Update | Kai Waehner, Confluent

Mainframe Integration, Offloading and Replacement with Apache Kafka
Mainframe Integration, Offloading and Replacement with Apache KafkaMainframe Integration, Offloading and Replacement with Apache Kafka
Mainframe Integration, Offloading and Replacement with Apache Kafka
Kai Wähner
 

Similar to Can Apache Kafka Replace a Database? – The 2021 Update | Kai Waehner, Confluent (20)

Apache Kafka vs. Cloud-native iPaaS Integration Platform Middleware
Apache Kafka vs. Cloud-native iPaaS Integration Platform MiddlewareApache Kafka vs. Cloud-native iPaaS Integration Platform Middleware
Apache Kafka vs. Cloud-native iPaaS Integration Platform Middleware
 
Mainframe Integration, Offloading and Replacement with Apache Kafka | Kai Wae...
Mainframe Integration, Offloading and Replacement with Apache Kafka | Kai Wae...Mainframe Integration, Offloading and Replacement with Apache Kafka | Kai Wae...
Mainframe Integration, Offloading and Replacement with Apache Kafka | Kai Wae...
 
Serverless Kafka and Spark in a Multi-Cloud Lakehouse Architecture
Serverless Kafka and Spark in a Multi-Cloud Lakehouse ArchitectureServerless Kafka and Spark in a Multi-Cloud Lakehouse Architecture
Serverless Kafka and Spark in a Multi-Cloud Lakehouse Architecture
 
Data Warehouse vs. Data Lake vs. Data Streaming – Friends, Enemies, Frenemies?
Data Warehouse vs. Data Lake vs. Data Streaming – Friends, Enemies, Frenemies?Data Warehouse vs. Data Lake vs. Data Streaming – Friends, Enemies, Frenemies?
Data Warehouse vs. Data Lake vs. Data Streaming – Friends, Enemies, Frenemies?
 
Mainframe Integration, Offloading and Replacement with Apache Kafka
Mainframe Integration, Offloading and Replacement with Apache KafkaMainframe Integration, Offloading and Replacement with Apache Kafka
Mainframe Integration, Offloading and Replacement with Apache Kafka
 
Supply Chain Optimization with Apache Kafka
Supply Chain Optimization with Apache KafkaSupply Chain Optimization with Apache Kafka
Supply Chain Optimization with Apache Kafka
 
Service Mesh with Apache Kafka, Kubernetes, Envoy, Istio and Linkerd
Service Mesh with Apache Kafka, Kubernetes, Envoy, Istio and LinkerdService Mesh with Apache Kafka, Kubernetes, Envoy, Istio and Linkerd
Service Mesh with Apache Kafka, Kubernetes, Envoy, Istio and Linkerd
 
Applying ML on your Data in Motion with AWS and Confluent | Joseph Morais, Co...
Applying ML on your Data in Motion with AWS and Confluent | Joseph Morais, Co...Applying ML on your Data in Motion with AWS and Confluent | Joseph Morais, Co...
Applying ML on your Data in Motion with AWS and Confluent | Joseph Morais, Co...
 
Connected Vehicles and V2X with Apache Kafka
Connected Vehicles and V2X with Apache KafkaConnected Vehicles and V2X with Apache Kafka
Connected Vehicles and V2X with Apache Kafka
 
Architecture patterns for distributed, hybrid, edge and global Apache Kafka d...
Architecture patterns for distributed, hybrid, edge and global Apache Kafka d...Architecture patterns for distributed, hybrid, edge and global Apache Kafka d...
Architecture patterns for distributed, hybrid, edge and global Apache Kafka d...
 
BBL KAPPA Lesfurets.com
BBL KAPPA Lesfurets.comBBL KAPPA Lesfurets.com
BBL KAPPA Lesfurets.com
 
Apache Kafka and API Management / API Gateway – Friends, Enemies or Frenemies...
Apache Kafka and API Management / API Gateway – Friends, Enemies or Frenemies...Apache Kafka and API Management / API Gateway – Friends, Enemies or Frenemies...
Apache Kafka and API Management / API Gateway – Friends, Enemies or Frenemies...
 
Apache Kafka and API Management / API Gateway – Friends, Enemies or Frenemies?
Apache Kafka and API Management / API Gateway – Friends, Enemies or Frenemies?Apache Kafka and API Management / API Gateway – Friends, Enemies or Frenemies?
Apache Kafka and API Management / API Gateway – Friends, Enemies or Frenemies?
 
Apache Kafka in the Airline, Aviation and Travel Industry
Apache Kafka in the Airline, Aviation and Travel IndustryApache Kafka in the Airline, Aviation and Travel Industry
Apache Kafka in the Airline, Aviation and Travel Industry
 
When NOT to use Apache Kafka?
When NOT to use Apache Kafka?When NOT to use Apache Kafka?
When NOT to use Apache Kafka?
 
When NOT to Use Apache Kafka? With Kai Waehner | Current 2022
When NOT to Use Apache Kafka? With Kai Waehner | Current 2022When NOT to Use Apache Kafka? With Kai Waehner | Current 2022
When NOT to Use Apache Kafka? With Kai Waehner | Current 2022
 
Apache Kafka and Blockchain - Comparison and a Kafka-native Implementation
Apache Kafka and Blockchain - Comparison and a Kafka-native ImplementationApache Kafka and Blockchain - Comparison and a Kafka-native Implementation
Apache Kafka and Blockchain - Comparison and a Kafka-native Implementation
 
Building Event-Driven Systems with Apache Kafka
Building Event-Driven Systems with Apache KafkaBuilding Event-Driven Systems with Apache Kafka
Building Event-Driven Systems with Apache Kafka
 
kafka-tutorial-cloudruable-v2.pdf
kafka-tutorial-cloudruable-v2.pdfkafka-tutorial-cloudruable-v2.pdf
kafka-tutorial-cloudruable-v2.pdf
 
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
 

More from HostedbyConfluent

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
HostedbyConfluent
 
Evolution of NRT Data Ingestion Pipeline at Trendyol
Evolution of NRT Data Ingestion Pipeline at TrendyolEvolution of NRT Data Ingestion Pipeline at Trendyol
Evolution of NRT Data Ingestion Pipeline at Trendyol
HostedbyConfluent
 

More from HostedbyConfluent (20)

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Renaming a Kafka Topic | Kafka Summit London
Renaming a Kafka Topic | Kafka Summit LondonRenaming a Kafka Topic | Kafka Summit London
Renaming a Kafka Topic | Kafka Summit London
 
Evolution of NRT Data Ingestion Pipeline at Trendyol
Evolution of NRT Data Ingestion Pipeline at TrendyolEvolution of NRT Data Ingestion Pipeline at Trendyol
Evolution of NRT Data Ingestion Pipeline at Trendyol
 
Ensuring Kafka Service Resilience: A Dive into Health-Checking Techniques
Ensuring Kafka Service Resilience: A Dive into Health-Checking TechniquesEnsuring Kafka Service Resilience: A Dive into Health-Checking Techniques
Ensuring Kafka Service Resilience: A Dive into Health-Checking Techniques
 
Exactly-once Stream Processing with Arroyo and Kafka
Exactly-once Stream Processing with Arroyo and KafkaExactly-once Stream Processing with Arroyo and Kafka
Exactly-once Stream Processing with Arroyo and Kafka
 
Fish Plays Pokemon | Kafka Summit London
Fish Plays Pokemon | Kafka Summit LondonFish Plays Pokemon | Kafka Summit London
Fish Plays Pokemon | Kafka Summit London
 
Tiered Storage 101 | Kafla Summit London
Tiered Storage 101 | Kafla Summit LondonTiered Storage 101 | Kafla Summit London
Tiered Storage 101 | Kafla Summit London
 
Building a Self-Service Stream Processing Portal: How And Why
Building a Self-Service Stream Processing Portal: How And WhyBuilding a Self-Service Stream Processing Portal: How And Why
Building a Self-Service Stream Processing Portal: How And Why
 
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
 
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
 
Navigating Private Network Connectivity Options for Kafka Clusters
Navigating Private Network Connectivity Options for Kafka ClustersNavigating Private Network Connectivity Options for Kafka Clusters
Navigating Private Network Connectivity Options for Kafka Clusters
 
Apache Flink: Building a Company-wide Self-service Streaming Data Platform
Apache Flink: Building a Company-wide Self-service Streaming Data PlatformApache Flink: Building a Company-wide Self-service Streaming Data Platform
Apache Flink: Building a Company-wide Self-service Streaming Data Platform
 
Explaining How Real-Time GenAI Works in a Noisy Pub
Explaining How Real-Time GenAI Works in a Noisy PubExplaining How Real-Time GenAI Works in a Noisy Pub
Explaining How Real-Time GenAI Works in a Noisy Pub
 
TL;DR Kafka Metrics | Kafka Summit London
TL;DR Kafka Metrics | Kafka Summit LondonTL;DR Kafka Metrics | Kafka Summit London
TL;DR Kafka Metrics | Kafka Summit London
 
A Window Into Your Kafka Streams Tasks | KSL
A Window Into Your Kafka Streams Tasks | KSLA Window Into Your Kafka Streams Tasks | KSL
A Window Into Your Kafka Streams Tasks | KSL
 
Mastering Kafka Producer Configs: A Guide to Optimizing Performance
Mastering Kafka Producer Configs: A Guide to Optimizing PerformanceMastering Kafka Producer Configs: A Guide to Optimizing Performance
Mastering Kafka Producer Configs: A Guide to Optimizing Performance
 
Data Contracts Management: Schema Registry and Beyond
Data Contracts Management: Schema Registry and BeyondData Contracts Management: Schema Registry and Beyond
Data Contracts Management: Schema Registry and Beyond
 
Code-First Approach: Crafting Efficient Flink Apps
Code-First Approach: Crafting Efficient Flink AppsCode-First Approach: Crafting Efficient Flink Apps
Code-First Approach: Crafting Efficient Flink Apps
 
Debezium vs. the World: An Overview of the CDC Ecosystem
Debezium vs. the World: An Overview of the CDC EcosystemDebezium vs. the World: An Overview of the CDC Ecosystem
Debezium vs. the World: An Overview of the CDC Ecosystem
 
Beyond Tiered Storage: Serverless Kafka with No Local Disks
Beyond Tiered Storage: Serverless Kafka with No Local DisksBeyond Tiered Storage: Serverless Kafka with No Local Disks
Beyond Tiered Storage: Serverless Kafka with No Local Disks
 

Recently uploaded

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Recently uploaded (20)

Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAK
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreel
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptx
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 

Can Apache Kafka Replace a Database? – The 2021 Update | Kai Waehner, Confluent

  • 1. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Can Apache Kafka Replace a Database? Kafka’s Capabilities and Trade-Offs for Storage, Queries, Processing, Transactions, Connectivity Kai Waehner Field CTO contact@kai-waehner.de @KaiWaehner www.confluent.io www.kai-waehner.de linkedin.com/in/kaiwaehner
  • 2. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Is Kafka a Database? This was answered [with ‘yes’] a few years ago… 2 https://www.confluent.io/kafka-summit-SF18/is-kafka-a-database/ … and many things changed [= improved] since then!
  • 3. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Yes. Kafka is a database! Can replace another Database?
  • 4. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Agenda 4 1. What is a Database? 2. What is Apache Kafka? 3. Storage in Kafka 4. Queries and Processing in Kafka 5. Transactions in Kafka 6. Connectivity
  • 5. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Agenda 5 1. What is a Database? 2. What is Apache Kafka? 3. Storage in Kafka 4. Queries and Processing in Kafka 5. Transactions in Kafka 6. Connectivity
  • 6. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? What is a Database? 6 Database Concepts 1960s: Navigational DBMS 1970s, Relational DBMS Late 1970s: SQL DBMS 1980s: On the desktop 1990s: Object-oriented 2000s: NoSQL / NewSQL 2010s: DBaaS Database Features Storage Queries (CRUD) Processing Transactions Backup Replication …
  • 7. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Database Theorems 7 Atomicity Consistency Isolation Durability Consistency Availability Partitioning
  • 8. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Database Examples 8
  • 9. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Database Examples 9 I thought Kafka is for data in motion?
  • 10. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Agenda 10 1. What is a Database? 2. What is Apache Kafka? 3. Storage in Kafka 4. Queries and Processing in Kafka 5. Transactions in Kafka 6. Connectivity
  • 11. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Apache Kafka is an Event Streaming Platform MES ERP Sensors Mobile Customer 360 Real-time Alerting System Data warehouse Producers Consumers Streams and storage of real time events Stream processing apps Connectors Connectors Stream processing apps Supplier Alert Forecast Inventory Customer Order 11
  • 12. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? ETL/Data Integration Messaging Highly Scalable Durable Persistent Ordered Real-time Difficult to Scale No Persistence After Consumption No Replay Batch Expensive Time Consuming
  • 13. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Highly Scalable Persistent ETL/Data Integration Messaging ETL/Data Integration Messaging Messaging Batch Expensive Time Consuming Difficult to Scale No Persistence After Consumption No Replay Real-time Highly Scalable Durable Persistent Ordered Real-time Event Streaming
  • 14. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Improve Customer Experience (CX) Increase Revenue (make money) Business Value Decrease Costs (save money) Core Business Platform Increase Operational Efficiency Migrate to Cloud Mitigate Risk (protect money) Key Drivers Strategic Objectives (sample) Fraud Detection IoT sensor ingestion Digital replatforming/ Mainframe Offload Connected Car: Navigation & improved in- car experience: Audi Customer 360 Simplifying Omni-channel Retail at Scale: Target Faster transactional processing / analysis incl. Machine Learning / AI Mainframe Offload: RBC Microservices Architecture Online Fraud Detection Online Security (syslog, log aggregation, Splunk replacement) Middleware replacement Regulatory Digital Transformation Application Modernization: Multiple Examples Website / Core Operations (Central Nervous System) The [Silicon Valley] Digital Natives; LinkedIn, Netflix, Uber, Yelp... Predictive Maintenance: Audi Streaming Platform in a regulated environment (e.g. Electronic Medical Records): Celmatix Real-time app updates Real Time Streaming Platform for Communications and Beyond: Capital One Developer Velocity - Building Stateful Financial Applications with Kafka Streams: Funding Circle Detect Fraud & Prevent Fraud in Real Time: PayPal Kafka as a Service - A Tale of Security and Multi-Tenancy: Apple Example Use Cases $↑ $↓ $↔ Example Case Studies (of many)
  • 15. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Agenda 15 1. What is a Database? 2. What is Apache Kafka? 3. Storage in Kafka 4. Queries and Processing in Kafka 5. Transactions in Kafka 6. Connectivity
  • 16. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Kafka’s Distributed Commit Log is the Storage (and enables real decoupling and domain-driven design) 16 https://www.confluent.io/blog/microservices-apache-kafka-domain-driven-design/
  • 17. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Kafka Stores Your Data Durably. https://www.confluent.io/blog/publishing-apache-kafka-new-york-times/ Kafka is the source of truth. Powers NYTimes.com, and stores all articles ever published since 1851. September 30, 1851, Page 1 Kafka is the leading system. Account Activity Replay API to recover events that weren’t delivered for various reasons https://blog.twitter.com/engineering/en_us/topics/infrastructure/2020/kafka-as-a-storage-system.html
  • 18. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Confluent Tiered Storage for Kafka 18 (Only available in Confluent Platform) Store data forever Hot and cold storage Cheap object store Easy scale up/down No changes in clients
  • 19. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Tiered Storage for Apache Kafka KIP-405 – Add Tiered Storage Support to Kafka Confluent is actively working on this with the open source community - Uber is leading this initiative Confluent Tiered Storage is available today in Confluent Platform and used under the hood in Confluent Cloud https://cwiki.apache.org/confluence/display/KAFKA/KIP-405%3A+Kafka+Tiered+Storage
  • 20. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Log Compaction with Compacted Topics 20 Retain last known value for each message key No retention time
  • 21. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Stateful Kafka Applications Kafka Streams and ksqlDB embed RocksDB 21 Do I really need another database for my microservice? streams
  • 22. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Kafka as Single Source of Truth 22 The Leading System is Real-Time and Scalable Real Decoupling Handling Slow Consumers
  • 23. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Agenda 23 1. What is a Database? 2. What is Apache Kafka? 3. Storage in Kafka 4. Queries and Processing in Kafka 5. Transactions in Kafka 6. Connectivity
  • 24. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Kafka C++ Client Kafka Cluster Monolith Kafka Decouples Storage and Compute Cloud DWH Snowflake Connector Schema Registry Storage Compute Compute (+ non-Kafka Storage) KSQL App KSQL App KSQL App Compute Compute Compute
  • 25. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Confluent & The Future of SQL ksqlDB’s model is leading the way to the new official standard. What is it? Confluent collaborates with other DB vendors in the US Standards Body (INCITS DM32) on adding Streaming SQL to the SQL standard. Here, we discuss how to represent: • Streams vs. Tables • Traditional vs. Continuous queries • Mutable vs. Immutable data • Event-time vs. Processing-time • Historical queries vs. Present-time queries and more
  • 26. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Query and Event Processing in Kafka 26 PUSH à Continuously process and forward events PULL à Client requests events (like you know it from your favourite database)
  • 27. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? ksqlDB - The Event Streaming Database 27 -- Continuously look up data in a table; query keeps running SELECT * FROM myTable WHERE ... EMIT CHANGES -- Continuously look up data in a stream; query keeps running SELECT * FROM myStream WHERE ... EMIT CHANGES -- Look up data in a table once; query then terminates SELECT * FROM myTable WHERE ... app app
  • 28. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? ksqlDB - The Event Streaming Database • Project created by Confluent, source-available license: https://ksqldb.io/ • A ksqlDB cluster runs in a distributed manner across many server nodes • Tightly integrates with Apache Kafka® as its persistent storage layer • Has projections, transformations, aggregations, windowing, joins, etc. • Distinguishes between event-time and processing-time • Handles out-of-order and late data • Streaming import-export for external data systems • DDL and DML via SQL-like statements • Security features like role-based access control • Run it yourself or use SaaS offering in Confluent Cloud 28
  • 29. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Continuous Queries and Processing 29
  • 30. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Queries through the Kafka Consumer 30 • Continuous consumption of the latest events (in real time or batch) • Just specific time frames or partitions • All data from the beginning connect Cluster Linking REST Proxy
  • 31. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Queries for Consuming Historical Events Give me all events from time A to time B Real-time Producer Time • New consumer application • Error-handling • Compliance / regulatory processing • Query and analyze existing events • Schema changes in analytics platform • Model training Real-time Consumer Consumer of Historical Data
  • 32. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Interactive Queries Query values from the client applications’ state store Optional Proxy (e.g. HTTP or WebSockets) Limitation: Only Key/Value or table scans, but no complex queries or ANSI SQL 32 streams
  • 33. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Interactive Queries Table Scan Example 33 streams
  • 34. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? ANSI SQL Queries against the Kafka Log 3rd Party Add-Ons help Integration with any Business Intelligence Tool 34 https://www.confluent.io/blog/analytics-with-apache-kafka-and-rockset/
  • 35. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Agenda 35 1. What is a Database? 2. What is Apache Kafka? 3. Storage in Kafka 4. Queries and Processing in Kafka 5. Transactions in Kafka 6. Connectivity
  • 36. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Exactly-Once Semantics (EOS) in Kafka No Two-Phase-Commit (because that does not scale) Idempotent Producer and Transactions API Supported by the whole Kafka Ecosystem (not just Messaging) 36
  • 37. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Transaction API in Apache Kafka https://cwiki.apache.org/confluence/display/KAFKA/KIP-98+-+Exactly+Once+Delivery+and+Transactional+Messaging https://www.confluent.io/kafka-summit-london18/dont-repeat-yourself-introducing-exactly-once-semantics-in-apache-kafka/
  • 38. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? From the Mainframe to ksqlDB in the Cloud Bi-Directional End-to-End Referential Integrity ksqlDB App CICS Mainframe Transactions Bi-Directional Integration Secured Referential Integrity End-to-End “Transactions” Low Latency Database change Microservices events SaaS data Customer experiences Streams of real time events Kafka Exactly-Once Semantics using librdkafka IMS DB Cobol App Kafka Exactly-Once Semantics using ksqlDB
  • 39. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Agenda 39 1. What is a Database? 2. What is Apache Kafka? 3. Storage in Kafka 4. Queries and Processing in Kafka 5. Transactions in Kafka 6. Connectivity
  • 40. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Kafka Connect Integration between Databases, Applications, APIs, SaaS Kafka-native (no other middleware required) Sources and Sinks Legacy and Modern Real-Time and Batch 40
  • 41. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Turn the Database Inside Out! Materialized Views The heart is real-time, scalable and durable Integration with any Database for specific use cases and queries 41 https://www.confluent.io/blog/turning-the-database-inside-out-with-apache-samza/
  • 42. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Global Event Streaming Streaming Replication between Kafka Clusters Bridge to Databases, Data Lakes, Apps, APIs, SaaS Aggregate Small Footprint Edge Deployments with Replication (Aggregation) Simplify Disaster Recovery Operations with Multi-Region Clusters with RPO=0 and RTO=0 Stream Data Globally with Replication and Cluster Linking 42
  • 43. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Yes. But it does not replace all other databases! Can replace a Database?
  • 44. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? TL;DR • Kafka can store data forever in a durable and high available manner providing ACID guarantees • Different options to query historical data are available in Kafka • Kafka-native add-ons like ksqlDB or Tiered Storage make Kafka more powerful than ever before for processing data in motion and event-based long-term storage • Stateful applications can be built leveraging Kafka clients (microservices, business applications) without the need for another external database • Not a replacement for existing databases like MySQL, MongoDB, Elasticsearch or Hadoop • Other databases and Kafka complement each other; the right solution has to be selected for a problem; often purpose-built materialized views are created and updated in real time from the central event-based infrastructure • Different options are available for bi-directional pull and push based integration between Kafka and databases to complement each other
  • 45. @KaiWaehner - www.kai-waehner.de – Can Apache Kafka Replace a Database? Kai Waehner Field CTO contact@kai-waehner.de @KaiWaehner www.kai-waehner.de www.confluent.io linkedin.com/in/kaiwaehner Questions? Feedback? Let’s connect!