How to Build Streaming Apps with Confluent II

confluent
confluentconfluent
How to Build Streaming Apps
with Confluent
Mauro Vocale, Senior Solutions Engineer
Stefano Linguerri, Solutions Engineer
24/May/2023
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
Today’s Agenda
2
10:00 AM - 10:30 AM
Streams Processing / ksqlDB Overview
Mauro Vocale, Senior Solutions Engineer
10:30 AM - 11:15 AM
Interactive Streams Lab*
Stefano Linguerri Solutions Engineer
11:15 AM - 11:30 AM
Q&A and Next Steps
Workshop Tips & Help:
1. Check the ‘Chat’ window during
the session for instructions
[icon located at the bottom of the
Zoom toolbar]
2. For any technical issues, click
the ‘Raise Hand’ button or post in
the ‘Chat’ window
[a Confluent team member will
assist you]
*Please note the lab will be conducted on a Confluent Cloud. However, the ksqlDB concepts will still be relevant to
all Confluent Platform customers.
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
Objectives for today
3
➔ Show you how Apache Kafka and Confluent enable you to build
streaming apps
➔ Refresh on Kafka and Kafka Streams
➔ Learn the basics of:
◆ Event driven / microservices architecture
◆ Building streaming applications
➔ Overview of typical use cases for stream processing.
➔ Hands-on build a streaming application yourself
Part 1
Streams Processing / ksqlDB Overview
DB centric data architecture
What could possibly go wrong?
At the heart of every software application is data.
Databases
Databases are fundamentally incomplete.
Databases are not designed for real-time applications.
Databases
Consumer
Batch processing
(by time or event)
Producer
Upserts/Deletes
The foundational assumption of every database: Data-at-rest
Databases bring point-in-time queries to stored data.
This leads to a Giant Mess in Data Architecture.
LINE OF BUSINESS 01 LINE OF BUSINESS 02 PUBLIC CLOUD
Data in motion:
Ubiquitous real-time data and
continuous real-time processing
A New Paradigm is Required for Data in Motion:
Continuously processing evolving streams of data in real-time
Rich front-end
customer
experiences
Real-time
Events
Real-time
Event Streams
A Sale A shipment
A Trade
A Customer
Experience
Real-time
backend
operations
Apache Kafka
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
What is Apache Kafka?
12
Kafka is a distributed Event Streaming Platform (append-only / immutable commit log):
7 6 5 4 3 2 1
8
Producer
Write (append-only)
Consumer(s)
Read (seek and scan)
Kafka topic (partition)
Headers
Timestamp
Key Value
Anatomy of an event
● Publish/subscribe to a stream of events
● Persisted data after read
● Supports transactions
● Highly scalable, high throughput.
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
Producers and Consumers
13
App
#2
App
#3
App
#4
App
#1
Producers
Kafka
Cluster
Topic A Topic B Topic C Topic D
App
#1
App
#2
Consumers
App
#3
14
Message
Raw data produced by a service to be
consumed or stored elsewhere. The
publisher of the message has an
expectation about how the consumer
handles the message.
Event
Lightweight notification of a condition or
a state change. The publisher of the
event has no expectation about how
the event is handled. The consumer of
the event decides what to do with it.
Events can be discrete units or part of a
series.
Message
vs
Event
Public Service Announcement
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
Kafka Stream App
Transactions!
What are Kafka Connect and Kafka Streams?
15
Kafka Cluster
Connector
Transactions!
Customer
data
Order
Customer
data
Order
Shipment
Shipment
Enriched/
transformed
data (statefully)
Producer Consumer
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
Kafka Connect and Kafka Streams APIs
16
Kafka Connect API
● Reliable and scalable integration of Kafka with
your other data systems
● Confluent offers 120+ pre-built connectors for
popular sources and sinks
Kafka Streams API
● Write standard Java applications & micro-
services to process your data in real-time
● Built on top of Producer / Consumer APIs
Orders
Customers
STREAM
PROCESSING
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
Stream processing by analogy
17
Producer /
Connect API (Source)
Stream Processing
Consumer /
Connect API (Sink)
$ cat < in.txt | grep “ksql” | tr a-z A-Z > out.txt
Who is Confluent?
19
Apache Kafka is an open
source project developed
and maintained by the
Apache Foundation.
Confluent was founded
by the original creators
of Apache Kafka.
Who developed
Apache Kafka?
Public Service Announcement
Open
Source
Apache
Kafka
Value added by Confluent
What only Confluent can offer:
● Apache Kafka re-architected for the cloud
● Cloud-native, Complete and Everywhere
● Rich product capabilities and unparalleled
expertise
● Multiple networking/interconnectivity options
● Elastic scale (up and down)
● Tiered storage
● Enterprise-grade security/regulatory features
● Fully integrated Stream Governance
● High availability
● Expertise and vision to support mission critical
use cases
● Full DevOps automation (REST, CLI, Terraform
and AsyncAPI)
● Multi-language libraries: Java, Python, C++,
.NET, Go, JavaScript, etc.
Which leads to:
● Lowest TCO (40% savings in average)
● Fastest Time-to-Market (70% in average)
Data
Governance
Hybrid and
multi cloud
Enterprise
grade security
Schema
linking
Cluster
linking
Support/SLA
Kafka expertise
A
c
c
e
s
s
C
o
n
t
r
o
l
&
A
u
d
i
t
L
o
g
s
Terraform
Provider
Scaling &
auto data
balancing
Latest
Version
&
patches+
1
2
0
C
o
n
n
e
c
t
o
r
s
Fully managed
Confluent Cloud vs Open Source Apache Kafka
Stream processing with ksqlDB
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
ksqlDB
The easiest way to process event streams in real-time
22
Runs
everywhere
Clustering
done for you
Exactly-once
processing
Event-time
processing
Windowing &
aggregations
Flexible
sizing
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
ksqlDB in a nutshell
Streams and tables are the
two primary abstractions,
they are referred to as
collections
ksqlDB is built on
top of Kafka
Streams
Open source
event streaming
database under
the Confluent
Community
License
There are two ways of
creating collections in
ksqlDB:
● directly from Kafka
topics (source
collections)
● derived from other
streams and tables
(derived collections)
The direct
input/outputs will
always be Kafka
topics
ksqlDB does not query Kafka topics, only
collections.
To create a source collection:
CREATE STREAM users
(USER_ID INT KEY, USERNAME VARCHAR)
WITH
(KAFKA_TOPIC='users',VALUE_FORMAT='AVRO');
Merge/Joins:
● Table-Table
● Table-Stream
● Stream-Table
● Stream-Stream
23
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
Tables
● Tables are mutable collections of events
● Represent the latest version of each value per
key
● Serve queries to applications.
Streams
● Streams are immutable, append- only
sequences of events
● Useful for representing a historical series of
events
● “Data in motion”.
ksqlDB’s collections
24
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
Tradeoffs between stream processing tools
25
Kafka
Producer &
Consumer
Kafka
Streams
API
Flexibility Simplicity
ksqlDB
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
Tradeoffs between stream processing tools
26
Kafka Producer &
Consumer
Kafka
Streams API
ksqlDB
ConsumerRecords<String, String> records = consumer.poll(100);
Map<String,Integer> counts = new DefaultMap<String, Integer>();
for (ConsumerRecord<String, Integer> record : records) {
String key = record.key();
int c = counts.get(key);
c += record.value();
counts.put(key, c);
}
for (Map.Entry<String, Integer> entry : counts.entrySet()) {
int stateCount;
int attempts;
while (attempts++ < MAX_RETRIES) {
try {
stateCount = stateStore.getValue(entry.getKey());
stateStore.setValue(entry.getKey(), entry.getValue() +
stateCount);
break;
} catch (StateStoreException e) {
RetryUtils.backoff(attempts);
}
}
}
builder
.stream("users",
Consumed.with(
Serdes.String(),
Serdes.String()
)
)
.groupBy((key, value) -> value)
.count()
.toStream()
.to("counts", Produced.with(Serdes.String(),
Serdes.Long()));
CREATE STREAM counts
WITH (username VARCHAR KEY,
counter BIGINT) AS
SELECT username, count(*) as counter FROM users
GROUP BY username
EMIT CHANGES;
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
Runtime Environments
27
Kafka Cluster
ksqlDB Cluster
Kafka Connect
Cluster
Compute*
Storage*
(*) Each cluster can scale independently
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
Sample use case:
Streaming ETL
Manipulate events
in-flight and connect
data sources and sinks in
real-time rather than
through batch solutions
28
CREATE STREAM clicks_with_city AS
SELECT c.*, u.city
FROM clickstream c
LEFT JOIN users u ON c.user_id = u.id;
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. 29
Sample use case:
Anomaly Detection
Identify anomalies in
streaming data, such as
potentially fraudulent
transactions, in only a
few milliseconds
CREATE TABLE possible_fraud AS
SELECT card_number, count(*)
FROM authorization_attempts
WINDOW TUMBLING (SIZE 5 SECONDS)
GROUP BY card_number
HAVING count(*) > 3;
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. 30
Sample use case:
Real-time Monitoring
Monitor logs, sensor and
IoT data, and more and
take actions on events
instantly
CREATE TABLE error_counts AS
SELECT error_code, count(*)
FROM monitoring_stream
WINDOW TUMBLING (SIZE 1 MINUTE)
WHERE type = 'ERROR'
GROUP BY error_code;
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
What else is ksqlDB
a good fit for?
31
● Materialized caches
● Event-driven microservices
● Redaction
● Event Deduplication
● Event Re-ordering
● Sessionization
● Validation
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
● Kafka may only have events
over a limited span of time
depending on retention
settings
● No secondary indexes for
random lookups
● Aggregate events that
never happened.
What is ksqlDB
NOT a great fit for?
32
Part 2
Interactive Streams Lab
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. 34
Workshop Tips & Help:
1. Check the ‘Chat’ window during the session for
instructions
[icon located at the bottom of the Zoom toolbar]
2. For any technical issues, click
the ‘Raise Hand’ button or post in the ‘Chat’ window
[a Confluent team member will assist you]
How to Build Streaming Apps with Confluent II
Find lab instructions with step by
step guide to reproduce this
workshop
https://drive.google.com/file/d/14HlF
63xPeb0LP6NUDuzTeDhAT_hI1Gw3
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
Register for Confluent Cloud
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
What will we do in this workshop: Use Case
Identify unhappy customers
● From streaming data generated in mobile app or on website
● Data enrichment with customer master data (in MySQLdb)
➢ to be able to do something about their unhappiness and not lose
them!
38
Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc.
Demo diagram
Find more tutorials,
certifications and technical
information here:
developer.confluent.io
1 de 40

Recomendados

IoT Architectures for Apache Kafka and Event Streaming - Industry 4.0, Digita... por
IoT Architectures for Apache Kafka and Event Streaming - Industry 4.0, Digita...IoT Architectures for Apache Kafka and Event Streaming - Industry 4.0, Digita...
IoT Architectures for Apache Kafka and Event Streaming - Industry 4.0, Digita...Kai Wähner
1.1K vistas37 diapositivas
IoT and Event Streaming at Scale with Apache Kafka por
IoT and Event Streaming at Scale with Apache KafkaIoT and Event Streaming at Scale with Apache Kafka
IoT and Event Streaming at Scale with Apache Kafkaconfluent
243 vistas37 diapositivas
Technical Deep Dive: Using Apache Kafka to Optimize Real-Time Analytics in Fi... por
Technical Deep Dive: Using Apache Kafka to Optimize Real-Time Analytics in Fi...Technical Deep Dive: Using Apache Kafka to Optimize Real-Time Analytics in Fi...
Technical Deep Dive: Using Apache Kafka to Optimize Real-Time Analytics in Fi...confluent
2.2K vistas19 diapositivas
Spring and Pivotal Application Service - SpringOne Tour - Boston por
Spring and Pivotal Application Service - SpringOne Tour - BostonSpring and Pivotal Application Service - SpringOne Tour - Boston
Spring and Pivotal Application Service - SpringOne Tour - BostonVMware Tanzu
678 vistas33 diapositivas
Introduction to Apache Kafka and why it matters - Madrid por
Introduction to Apache Kafka and why it matters - MadridIntroduction to Apache Kafka and why it matters - Madrid
Introduction to Apache Kafka and why it matters - MadridPaolo Castagna
2K vistas32 diapositivas
Spring Boot & Spring Cloud Apps on Pivotal Application Service - Daniel Lavoie por
Spring Boot & Spring Cloud Apps on Pivotal Application Service - Daniel LavoieSpring Boot & Spring Cloud Apps on Pivotal Application Service - Daniel Lavoie
Spring Boot & Spring Cloud Apps on Pivotal Application Service - Daniel LavoieVMware Tanzu
867 vistas33 diapositivas

Más contenido relacionado

Similar a How to Build Streaming Apps with Confluent II

SpringOne Tour Denver - Spring Boot & Spring Cloud on Pivotal Application Ser... por
SpringOne Tour Denver - Spring Boot & Spring Cloud on Pivotal Application Ser...SpringOne Tour Denver - Spring Boot & Spring Cloud on Pivotal Application Ser...
SpringOne Tour Denver - Spring Boot & Spring Cloud on Pivotal Application Ser...VMware Tanzu
424 vistas34 diapositivas
Au delà des brokers, un tour de l’environnement Kafka | Florent Ramière por
Au delà des brokers, un tour de l’environnement Kafka | Florent RamièreAu delà des brokers, un tour de l’environnement Kafka | Florent Ramière
Au delà des brokers, un tour de l’environnement Kafka | Florent Ramièreconfluent
317 vistas58 diapositivas
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB) por
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB)Apache Kafka vs. Integration Middleware (MQ, ETL, ESB)
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB)Kai Wähner
28.7K vistas55 diapositivas
Confluent Platform 5.5 + Apache Kafka 2.5 => New Features (JSON Schema, Proto... por
Confluent Platform 5.5 + Apache Kafka 2.5 => New Features (JSON Schema, Proto...Confluent Platform 5.5 + Apache Kafka 2.5 => New Features (JSON Schema, Proto...
Confluent Platform 5.5 + Apache Kafka 2.5 => New Features (JSON Schema, Proto...Kai Wähner
332 vistas34 diapositivas
Fast Data – Fast Cars: Wie Apache Kafka die Datenwelt revolutioniert por
Fast Data – Fast Cars: Wie Apache Kafka die Datenwelt revolutioniertFast Data – Fast Cars: Wie Apache Kafka die Datenwelt revolutioniert
Fast Data – Fast Cars: Wie Apache Kafka die Datenwelt revolutioniertconfluent
1.8K vistas52 diapositivas
Kafka Vienna Meetup 020719 por
Kafka Vienna Meetup 020719Kafka Vienna Meetup 020719
Kafka Vienna Meetup 020719Patrik Kleindl
192 vistas24 diapositivas

Similar a How to Build Streaming Apps with Confluent II(20)

SpringOne Tour Denver - Spring Boot & Spring Cloud on Pivotal Application Ser... por VMware Tanzu
SpringOne Tour Denver - Spring Boot & Spring Cloud on Pivotal Application Ser...SpringOne Tour Denver - Spring Boot & Spring Cloud on Pivotal Application Ser...
SpringOne Tour Denver - Spring Boot & Spring Cloud on Pivotal Application Ser...
VMware Tanzu424 vistas
Au delà des brokers, un tour de l’environnement Kafka | Florent Ramière por confluent
Au delà des brokers, un tour de l’environnement Kafka | Florent RamièreAu delà des brokers, un tour de l’environnement Kafka | Florent Ramière
Au delà des brokers, un tour de l’environnement Kafka | Florent Ramière
confluent317 vistas
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB) por Kai Wähner
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB)Apache Kafka vs. Integration Middleware (MQ, ETL, ESB)
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB)
Kai Wähner28.7K vistas
Confluent Platform 5.5 + Apache Kafka 2.5 => New Features (JSON Schema, Proto... por Kai Wähner
Confluent Platform 5.5 + Apache Kafka 2.5 => New Features (JSON Schema, Proto...Confluent Platform 5.5 + Apache Kafka 2.5 => New Features (JSON Schema, Proto...
Confluent Platform 5.5 + Apache Kafka 2.5 => New Features (JSON Schema, Proto...
Kai Wähner332 vistas
Fast Data – Fast Cars: Wie Apache Kafka die Datenwelt revolutioniert por confluent
Fast Data – Fast Cars: Wie Apache Kafka die Datenwelt revolutioniertFast Data – Fast Cars: Wie Apache Kafka die Datenwelt revolutioniert
Fast Data – Fast Cars: Wie Apache Kafka die Datenwelt revolutioniert
confluent1.8K vistas
Apache Kafka vs. Traditional Middleware (Kai Waehner, Confluent) Frankfurt 20... por confluent
Apache Kafka vs. Traditional Middleware (Kai Waehner, Confluent) Frankfurt 20...Apache Kafka vs. Traditional Middleware (Kai Waehner, Confluent) Frankfurt 20...
Apache Kafka vs. Traditional Middleware (Kai Waehner, Confluent) Frankfurt 20...
confluent606 vistas
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB) - Friends, Enemies or ... por confluent
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB) - Friends, Enemies or ...Apache Kafka vs. Integration Middleware (MQ, ETL, ESB) - Friends, Enemies or ...
Apache Kafka vs. Integration Middleware (MQ, ETL, ESB) - Friends, Enemies or ...
confluent6K vistas
Unlock value with Confluent and AWS.pptx por Ahmed791434
Unlock value with Confluent and AWS.pptxUnlock value with Confluent and AWS.pptx
Unlock value with Confluent and AWS.pptx
Ahmed79143413 vistas
App modernization on AWS with Apache Kafka and Confluent Cloud por Kai Wähner
App modernization on AWS with Apache Kafka and Confluent CloudApp modernization on AWS with Apache Kafka and Confluent Cloud
App modernization on AWS with Apache Kafka and Confluent Cloud
Kai Wähner781 vistas
Real-time processing of large amounts of data por confluent
Real-time processing of large amounts of dataReal-time processing of large amounts of data
Real-time processing of large amounts of data
confluent1.5K vistas
Beyond the Brokers: A Tour of the Kafka Ecosystem por confluent
Beyond the Brokers: A Tour of the Kafka EcosystemBeyond the Brokers: A Tour of the Kafka Ecosystem
Beyond the Brokers: A Tour of the Kafka Ecosystem
confluent780 vistas
Beyond the brokers - A tour of the Kafka ecosystem por Damien Gasparina
Beyond the brokers - A tour of the Kafka ecosystemBeyond the brokers - A tour of the Kafka ecosystem
Beyond the brokers - A tour of the Kafka ecosystem
Damien Gasparina613 vistas
Hybrid Kafka, Taking Real-time Analytics to the Business (Cody Irwin, Google ... por HostedbyConfluent
Hybrid Kafka, Taking Real-time Analytics to the Business (Cody Irwin, Google ...Hybrid Kafka, Taking Real-time Analytics to the Business (Cody Irwin, Google ...
Hybrid Kafka, Taking Real-time Analytics to the Business (Cody Irwin, Google ...
HostedbyConfluent1.3K vistas
Beyond the brokers - Un tour de l'écosystème Kafka por Florent Ramiere
Beyond the brokers - Un tour de l'écosystème KafkaBeyond the brokers - Un tour de l'écosystème Kafka
Beyond the brokers - Un tour de l'écosystème Kafka
Florent Ramiere783 vistas
Apache Kafka as Event Streaming Platform for Microservice Architectures por Kai Wähner
Apache Kafka as Event Streaming Platform for Microservice ArchitecturesApache Kafka as Event Streaming Platform for Microservice Architectures
Apache Kafka as Event Streaming Platform for Microservice Architectures
Kai Wähner3.5K vistas
Streaming Data and Stream Processing with Apache Kafka por confluent
Streaming Data and Stream Processing with Apache KafkaStreaming Data and Stream Processing with Apache Kafka
Streaming Data and Stream Processing with Apache Kafka
confluent3K vistas
Confluent Partner Tech Talk with SVA por confluent
Confluent Partner Tech Talk with SVAConfluent Partner Tech Talk with SVA
Confluent Partner Tech Talk with SVA
confluent95 vistas
Building Streaming Data Pipelines with Google Cloud Dataflow and Confluent Cl... por HostedbyConfluent
Building Streaming Data Pipelines with Google Cloud Dataflow and Confluent Cl...Building Streaming Data Pipelines with Google Cloud Dataflow and Confluent Cl...
Building Streaming Data Pipelines with Google Cloud Dataflow and Confluent Cl...
HostedbyConfluent1.1K vistas
Kafka Streams vs. KSQL for Stream Processing on top of Apache Kafka por Kai Wähner
Kafka Streams vs. KSQL for Stream Processing on top of Apache KafkaKafka Streams vs. KSQL for Stream Processing on top of Apache Kafka
Kafka Streams vs. KSQL for Stream Processing on top of Apache Kafka
Kai Wähner14.2K vistas

Más de confluent

Citi TechTalk Session 2: Kafka Deep Dive por
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Diveconfluent
19 vistas60 diapositivas
Build real-time streaming data pipelines to AWS with Confluent por
Build real-time streaming data pipelines to AWS with ConfluentBuild real-time streaming data pipelines to AWS with Confluent
Build real-time streaming data pipelines to AWS with Confluentconfluent
74 vistas53 diapositivas
Q&A with Confluent Professional Services: Confluent Service Mesh por
Q&A with Confluent Professional Services: Confluent Service MeshQ&A with Confluent Professional Services: Confluent Service Mesh
Q&A with Confluent Professional Services: Confluent Service Meshconfluent
67 vistas69 diapositivas
Citi Tech Talk: Event Driven Kafka Microservices por
Citi Tech Talk: Event Driven Kafka MicroservicesCiti Tech Talk: Event Driven Kafka Microservices
Citi Tech Talk: Event Driven Kafka Microservicesconfluent
25 vistas29 diapositivas
Confluent & GSI Webinars series - Session 3 por
Confluent & GSI Webinars series - Session 3Confluent & GSI Webinars series - Session 3
Confluent & GSI Webinars series - Session 3confluent
17 vistas59 diapositivas
Citi Tech Talk: Data Governance for streaming and real time data por
Citi Tech Talk: Data Governance for streaming and real time dataCiti Tech Talk: Data Governance for streaming and real time data
Citi Tech Talk: Data Governance for streaming and real time dataconfluent
21 vistas24 diapositivas

Más de confluent(20)

Citi TechTalk Session 2: Kafka Deep Dive por confluent
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Dive
confluent19 vistas
Build real-time streaming data pipelines to AWS with Confluent por confluent
Build real-time streaming data pipelines to AWS with ConfluentBuild real-time streaming data pipelines to AWS with Confluent
Build real-time streaming data pipelines to AWS with Confluent
confluent74 vistas
Q&A with Confluent Professional Services: Confluent Service Mesh por confluent
Q&A with Confluent Professional Services: Confluent Service MeshQ&A with Confluent Professional Services: Confluent Service Mesh
Q&A with Confluent Professional Services: Confluent Service Mesh
confluent67 vistas
Citi Tech Talk: Event Driven Kafka Microservices por confluent
Citi Tech Talk: Event Driven Kafka MicroservicesCiti Tech Talk: Event Driven Kafka Microservices
Citi Tech Talk: Event Driven Kafka Microservices
confluent25 vistas
Confluent & GSI Webinars series - Session 3 por confluent
Confluent & GSI Webinars series - Session 3Confluent & GSI Webinars series - Session 3
Confluent & GSI Webinars series - Session 3
confluent17 vistas
Citi Tech Talk: Data Governance for streaming and real time data por confluent
Citi Tech Talk: Data Governance for streaming and real time dataCiti Tech Talk: Data Governance for streaming and real time data
Citi Tech Talk: Data Governance for streaming and real time data
confluent21 vistas
Confluent & GSI Webinars series: Session 2 por confluent
Confluent & GSI Webinars series: Session 2Confluent & GSI Webinars series: Session 2
Confluent & GSI Webinars series: Session 2
confluent16 vistas
Data In Motion Paris 2023 por confluent
Data In Motion Paris 2023Data In Motion Paris 2023
Data In Motion Paris 2023
confluent236 vistas
The Future of Application Development - API Days - Melbourne 2023 por confluent
The Future of Application Development - API Days - Melbourne 2023The Future of Application Development - API Days - Melbourne 2023
The Future of Application Development - API Days - Melbourne 2023
confluent69 vistas
The Playful Bond Between REST And Data Streams por confluent
The Playful Bond Between REST And Data StreamsThe Playful Bond Between REST And Data Streams
The Playful Bond Between REST And Data Streams
confluent49 vistas
The Journey to Data Mesh with Confluent por confluent
The Journey to Data Mesh with ConfluentThe Journey to Data Mesh with Confluent
The Journey to Data Mesh with Confluent
confluent73 vistas
Citi Tech Talk: Monitoring and Performance por confluent
Citi Tech Talk: Monitoring and PerformanceCiti Tech Talk: Monitoring and Performance
Citi Tech Talk: Monitoring and Performance
confluent47 vistas
Citi Tech Talk Disaster Recovery Solutions Deep Dive por confluent
Citi Tech Talk  Disaster Recovery Solutions Deep DiveCiti Tech Talk  Disaster Recovery Solutions Deep Dive
Citi Tech Talk Disaster Recovery Solutions Deep Dive
confluent70 vistas
Citi Tech Talk: Hybrid Cloud por confluent
Citi Tech Talk: Hybrid CloudCiti Tech Talk: Hybrid Cloud
Citi Tech Talk: Hybrid Cloud
confluent43 vistas
Confluent Partner Tech Talk with QLIK por confluent
Confluent Partner Tech Talk with QLIKConfluent Partner Tech Talk with QLIK
Confluent Partner Tech Talk with QLIK
confluent90 vistas
Real-time Streaming for Government and the Public Sector por confluent
Real-time Streaming for Government and the Public SectorReal-time Streaming for Government and the Public Sector
Real-time Streaming for Government and the Public Sector
confluent41 vistas
How to Build Real-Time Analytics Applications like Netflix, Confluent, and Re... por confluent
How to Build Real-Time Analytics Applications like Netflix, Confluent, and Re...How to Build Real-Time Analytics Applications like Netflix, Confluent, and Re...
How to Build Real-Time Analytics Applications like Netflix, Confluent, and Re...
confluent28 vistas
Single View of Data por confluent
Single View of DataSingle View of Data
Single View of Data
confluent71 vistas
Leveraging streaming data in real-time to build a Single View of Customer (SVOC) por confluent
Leveraging streaming data in real-time to build a Single View of Customer (SVOC)Leveraging streaming data in real-time to build a Single View of Customer (SVOC)
Leveraging streaming data in real-time to build a Single View of Customer (SVOC)
confluent21 vistas
Real-time Network Streaming Innovation & Insights por confluent
Real-time Network Streaming Innovation & InsightsReal-time Network Streaming Innovation & Insights
Real-time Network Streaming Innovation & Insights
confluent18 vistas

Último

Dapr Unleashed: Accelerating Microservice Development por
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice DevelopmentMiroslav Janeski
16 vistas29 diapositivas
JioEngage_Presentation.pptx por
JioEngage_Presentation.pptxJioEngage_Presentation.pptx
JioEngage_Presentation.pptxadmin125455
9 vistas4 diapositivas
Playwright Retries por
Playwright RetriesPlaywright Retries
Playwright Retriesartembondar5
7 vistas1 diapositiva
nintendo_64.pptx por
nintendo_64.pptxnintendo_64.pptx
nintendo_64.pptxpaiga02016
7 vistas7 diapositivas
Techstack Ltd at Slush 2023, Ukrainian delegation por
Techstack Ltd at Slush 2023, Ukrainian delegationTechstack Ltd at Slush 2023, Ukrainian delegation
Techstack Ltd at Slush 2023, Ukrainian delegationViktoriiaOpanasenko
7 vistas4 diapositivas
The Path to DevOps por
The Path to DevOpsThe Path to DevOps
The Path to DevOpsJohn Valentino
6 vistas6 diapositivas

Último(20)

Dapr Unleashed: Accelerating Microservice Development por Miroslav Janeski
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice Development
Miroslav Janeski16 vistas
JioEngage_Presentation.pptx por admin125455
JioEngage_Presentation.pptxJioEngage_Presentation.pptx
JioEngage_Presentation.pptx
admin1254559 vistas
Mobile App Development Company por Richestsoft
Mobile App Development CompanyMobile App Development Company
Mobile App Development Company
Richestsoft 5 vistas
Top-5-production-devconMunich-2023.pptx por Tier1 app
Top-5-production-devconMunich-2023.pptxTop-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptx
Tier1 app10 vistas
How to build dyanmic dashboards and ensure they always work por Wiiisdom
How to build dyanmic dashboards and ensure they always workHow to build dyanmic dashboards and ensure they always work
How to build dyanmic dashboards and ensure they always work
Wiiisdom16 vistas
FOSSLight Community Day 2023-11-30 por Shane Coughlan
FOSSLight Community Day 2023-11-30FOSSLight Community Day 2023-11-30
FOSSLight Community Day 2023-11-30
Shane Coughlan8 vistas
Streamlining Your Business Operations with Enterprise Application Integration... por Flexsin
Streamlining Your Business Operations with Enterprise Application Integration...Streamlining Your Business Operations with Enterprise Application Integration...
Streamlining Your Business Operations with Enterprise Application Integration...
Flexsin 5 vistas
Transport Management System - Shipment & Container Tracking por Freightoscope
Transport Management System - Shipment & Container TrackingTransport Management System - Shipment & Container Tracking
Transport Management System - Shipment & Container Tracking
Freightoscope 6 vistas
predicting-m3-devopsconMunich-2023-v2.pptx por Tier1 app
predicting-m3-devopsconMunich-2023-v2.pptxpredicting-m3-devopsconMunich-2023-v2.pptx
predicting-m3-devopsconMunich-2023-v2.pptx
Tier1 app14 vistas
Top-5-production-devconMunich-2023-v2.pptx por Tier1 app
Top-5-production-devconMunich-2023-v2.pptxTop-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptx
Tier1 app9 vistas
predicting-m3-devopsconMunich-2023.pptx por Tier1 app
predicting-m3-devopsconMunich-2023.pptxpredicting-m3-devopsconMunich-2023.pptx
predicting-m3-devopsconMunich-2023.pptx
Tier1 app10 vistas
How Workforce Management Software Empowers SMEs | TraQSuite por TraQSuite
How Workforce Management Software Empowers SMEs | TraQSuiteHow Workforce Management Software Empowers SMEs | TraQSuite
How Workforce Management Software Empowers SMEs | TraQSuite
TraQSuite7 vistas

How to Build Streaming Apps with Confluent II

  • 1. How to Build Streaming Apps with Confluent Mauro Vocale, Senior Solutions Engineer Stefano Linguerri, Solutions Engineer 24/May/2023
  • 2. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. Today’s Agenda 2 10:00 AM - 10:30 AM Streams Processing / ksqlDB Overview Mauro Vocale, Senior Solutions Engineer 10:30 AM - 11:15 AM Interactive Streams Lab* Stefano Linguerri Solutions Engineer 11:15 AM - 11:30 AM Q&A and Next Steps Workshop Tips & Help: 1. Check the ‘Chat’ window during the session for instructions [icon located at the bottom of the Zoom toolbar] 2. For any technical issues, click the ‘Raise Hand’ button or post in the ‘Chat’ window [a Confluent team member will assist you] *Please note the lab will be conducted on a Confluent Cloud. However, the ksqlDB concepts will still be relevant to all Confluent Platform customers.
  • 3. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. Objectives for today 3 ➔ Show you how Apache Kafka and Confluent enable you to build streaming apps ➔ Refresh on Kafka and Kafka Streams ➔ Learn the basics of: ◆ Event driven / microservices architecture ◆ Building streaming applications ➔ Overview of typical use cases for stream processing. ➔ Hands-on build a streaming application yourself
  • 4. Part 1 Streams Processing / ksqlDB Overview
  • 5. DB centric data architecture What could possibly go wrong?
  • 6. At the heart of every software application is data. Databases
  • 7. Databases are fundamentally incomplete. Databases are not designed for real-time applications. Databases Consumer Batch processing (by time or event) Producer Upserts/Deletes The foundational assumption of every database: Data-at-rest
  • 8. Databases bring point-in-time queries to stored data. This leads to a Giant Mess in Data Architecture. LINE OF BUSINESS 01 LINE OF BUSINESS 02 PUBLIC CLOUD
  • 9. Data in motion: Ubiquitous real-time data and continuous real-time processing
  • 10. A New Paradigm is Required for Data in Motion: Continuously processing evolving streams of data in real-time Rich front-end customer experiences Real-time Events Real-time Event Streams A Sale A shipment A Trade A Customer Experience Real-time backend operations
  • 12. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. What is Apache Kafka? 12 Kafka is a distributed Event Streaming Platform (append-only / immutable commit log): 7 6 5 4 3 2 1 8 Producer Write (append-only) Consumer(s) Read (seek and scan) Kafka topic (partition) Headers Timestamp Key Value Anatomy of an event ● Publish/subscribe to a stream of events ● Persisted data after read ● Supports transactions ● Highly scalable, high throughput.
  • 13. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. Producers and Consumers 13 App #2 App #3 App #4 App #1 Producers Kafka Cluster Topic A Topic B Topic C Topic D App #1 App #2 Consumers App #3
  • 14. 14 Message Raw data produced by a service to be consumed or stored elsewhere. The publisher of the message has an expectation about how the consumer handles the message. Event Lightweight notification of a condition or a state change. The publisher of the event has no expectation about how the event is handled. The consumer of the event decides what to do with it. Events can be discrete units or part of a series. Message vs Event Public Service Announcement
  • 15. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. Kafka Stream App Transactions! What are Kafka Connect and Kafka Streams? 15 Kafka Cluster Connector Transactions! Customer data Order Customer data Order Shipment Shipment Enriched/ transformed data (statefully) Producer Consumer
  • 16. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. Kafka Connect and Kafka Streams APIs 16 Kafka Connect API ● Reliable and scalable integration of Kafka with your other data systems ● Confluent offers 120+ pre-built connectors for popular sources and sinks Kafka Streams API ● Write standard Java applications & micro- services to process your data in real-time ● Built on top of Producer / Consumer APIs Orders Customers STREAM PROCESSING
  • 17. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. Stream processing by analogy 17 Producer / Connect API (Source) Stream Processing Consumer / Connect API (Sink) $ cat < in.txt | grep “ksql” | tr a-z A-Z > out.txt
  • 19. 19 Apache Kafka is an open source project developed and maintained by the Apache Foundation. Confluent was founded by the original creators of Apache Kafka. Who developed Apache Kafka? Public Service Announcement
  • 20. Open Source Apache Kafka Value added by Confluent What only Confluent can offer: ● Apache Kafka re-architected for the cloud ● Cloud-native, Complete and Everywhere ● Rich product capabilities and unparalleled expertise ● Multiple networking/interconnectivity options ● Elastic scale (up and down) ● Tiered storage ● Enterprise-grade security/regulatory features ● Fully integrated Stream Governance ● High availability ● Expertise and vision to support mission critical use cases ● Full DevOps automation (REST, CLI, Terraform and AsyncAPI) ● Multi-language libraries: Java, Python, C++, .NET, Go, JavaScript, etc. Which leads to: ● Lowest TCO (40% savings in average) ● Fastest Time-to-Market (70% in average) Data Governance Hybrid and multi cloud Enterprise grade security Schema linking Cluster linking Support/SLA Kafka expertise A c c e s s C o n t r o l & A u d i t L o g s Terraform Provider Scaling & auto data balancing Latest Version & patches+ 1 2 0 C o n n e c t o r s Fully managed Confluent Cloud vs Open Source Apache Kafka
  • 22. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. ksqlDB The easiest way to process event streams in real-time 22 Runs everywhere Clustering done for you Exactly-once processing Event-time processing Windowing & aggregations Flexible sizing
  • 23. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. ksqlDB in a nutshell Streams and tables are the two primary abstractions, they are referred to as collections ksqlDB is built on top of Kafka Streams Open source event streaming database under the Confluent Community License There are two ways of creating collections in ksqlDB: ● directly from Kafka topics (source collections) ● derived from other streams and tables (derived collections) The direct input/outputs will always be Kafka topics ksqlDB does not query Kafka topics, only collections. To create a source collection: CREATE STREAM users (USER_ID INT KEY, USERNAME VARCHAR) WITH (KAFKA_TOPIC='users',VALUE_FORMAT='AVRO'); Merge/Joins: ● Table-Table ● Table-Stream ● Stream-Table ● Stream-Stream 23
  • 24. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. Tables ● Tables are mutable collections of events ● Represent the latest version of each value per key ● Serve queries to applications. Streams ● Streams are immutable, append- only sequences of events ● Useful for representing a historical series of events ● “Data in motion”. ksqlDB’s collections 24
  • 25. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. Tradeoffs between stream processing tools 25 Kafka Producer & Consumer Kafka Streams API Flexibility Simplicity ksqlDB
  • 26. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. Tradeoffs between stream processing tools 26 Kafka Producer & Consumer Kafka Streams API ksqlDB ConsumerRecords<String, String> records = consumer.poll(100); Map<String,Integer> counts = new DefaultMap<String, Integer>(); for (ConsumerRecord<String, Integer> record : records) { String key = record.key(); int c = counts.get(key); c += record.value(); counts.put(key, c); } for (Map.Entry<String, Integer> entry : counts.entrySet()) { int stateCount; int attempts; while (attempts++ < MAX_RETRIES) { try { stateCount = stateStore.getValue(entry.getKey()); stateStore.setValue(entry.getKey(), entry.getValue() + stateCount); break; } catch (StateStoreException e) { RetryUtils.backoff(attempts); } } } builder .stream("users", Consumed.with( Serdes.String(), Serdes.String() ) ) .groupBy((key, value) -> value) .count() .toStream() .to("counts", Produced.with(Serdes.String(), Serdes.Long())); CREATE STREAM counts WITH (username VARCHAR KEY, counter BIGINT) AS SELECT username, count(*) as counter FROM users GROUP BY username EMIT CHANGES;
  • 27. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. Runtime Environments 27 Kafka Cluster ksqlDB Cluster Kafka Connect Cluster Compute* Storage* (*) Each cluster can scale independently
  • 28. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. Sample use case: Streaming ETL Manipulate events in-flight and connect data sources and sinks in real-time rather than through batch solutions 28 CREATE STREAM clicks_with_city AS SELECT c.*, u.city FROM clickstream c LEFT JOIN users u ON c.user_id = u.id;
  • 29. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. 29 Sample use case: Anomaly Detection Identify anomalies in streaming data, such as potentially fraudulent transactions, in only a few milliseconds CREATE TABLE possible_fraud AS SELECT card_number, count(*) FROM authorization_attempts WINDOW TUMBLING (SIZE 5 SECONDS) GROUP BY card_number HAVING count(*) > 3;
  • 30. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. 30 Sample use case: Real-time Monitoring Monitor logs, sensor and IoT data, and more and take actions on events instantly CREATE TABLE error_counts AS SELECT error_code, count(*) FROM monitoring_stream WINDOW TUMBLING (SIZE 1 MINUTE) WHERE type = 'ERROR' GROUP BY error_code;
  • 31. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. What else is ksqlDB a good fit for? 31 ● Materialized caches ● Event-driven microservices ● Redaction ● Event Deduplication ● Event Re-ordering ● Sessionization ● Validation
  • 32. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. ● Kafka may only have events over a limited span of time depending on retention settings ● No secondary indexes for random lookups ● Aggregate events that never happened. What is ksqlDB NOT a great fit for? 32
  • 34. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. 34 Workshop Tips & Help: 1. Check the ‘Chat’ window during the session for instructions [icon located at the bottom of the Zoom toolbar] 2. For any technical issues, click the ‘Raise Hand’ button or post in the ‘Chat’ window [a Confluent team member will assist you]
  • 36. Find lab instructions with step by step guide to reproduce this workshop https://drive.google.com/file/d/14HlF 63xPeb0LP6NUDuzTeDhAT_hI1Gw3
  • 37. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. Register for Confluent Cloud
  • 38. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. What will we do in this workshop: Use Case Identify unhappy customers ● From streaming data generated in mobile app or on website ● Data enrichment with customer master data (in MySQLdb) ➢ to be able to do something about their unhappiness and not lose them! 38
  • 39. Copyright 2020, Confluent, Inc. All rights reserved. This document may not be reproduced in any manner without the express written permission of Confluent, Inc. Demo diagram
  • 40. Find more tutorials, certifications and technical information here: developer.confluent.io