SlideShare a Scribd company logo
Anna McDonald: Twitter: @jbfletch_ <- fully committed to the underscore
GitHub: jbfletch
@jbfletch_
ARE YOU IN THE RIGHT TALK?
Does your environment look like...
Super Fancy Half Fancy help.
2
@jbfletch_
@jbfletch_
Why Should I Event Stream at All?
@jbfletch_
Why Should I Event Stream at All?
● Knowing quickly is actionable
@jbfletch_
Why Should I Event Stream at All?
● Knowing quickly is actionable
● Integration requirements
@jbfletch_
Why Should I Event Stream at All?
● Knowing quickly is actionable
● Integration requirements
● User expectations
@jbfletch_
Potential Problems to Tackle
@jbfletch_
Problem 1. How do I get my data?
@jbfletch_
Problem 1. How do I get my data?
● Kafka Producer
@jbfletch_
Kafka Producer
● Throwing events directly
● Custom stateful events
from flat files (EBCDIC)
● Available in Java, .Net,
Python, Scala, Kotlin, JS and
many more! No native
COBOL..YET!
@jbfletch_
Problem 1. How do I get my data?
● Kafka Producer
● Connect
@jbfletch_
Connect
@C0urante
@gharris1727
@jbfletch_
Connect
● Stateless connection for
external systems to Kafka
● Low code with SMT
functionality
● Rich ecosystem of
connectors
@jbfletch_
Problem 1. How do I get my data?
● Kafka Producer
● Connect
● Change Data Capture
MySQL
inserts: op_type: I,
after struct
Debezium
15
@jbfletch_
Change Data Capture (CDC)
MySQL
inserts: op_type: I,
after struct
updates: op_type: U,
before,after struct
Debezium
16
@jbfletch_
Change Data Capture (CDC)
MySQL
inserts: op_type: I,
after struct
updates: op_type: U,
before,after struct
deletes: op_type: D,
before struct
Plus optional tombstone
message
Debezium
17
@jbfletch_
Change Data Capture (CDC)
@jbfletch_
Problem 2. Moving to Async from
Existing Synchronous Workflows
@jbfletch_
● How do I delay my data by an
hour?
● Is it bad to have 14 retry
topics?
RED FLAGS!
Problem 2. Moving to Async from
Existing Synchronous Workflows
@jbfletch_
Embrace Completion Criteria
@jbfletch_
Embrace Completion Criteria
1. Define the
information you need
for completeness.
@jbfletch_
Embrace Completion Criteria
● Order Placed event
needs header and
items
@jbfletch_
Embrace Completion Criteria
● Order Placed event
needs header and
items
● Order Filled event
needs header, items,
and stock details
@jbfletch_
Embrace Completion Criteria
● Order Placed event
needs header and
items
● Order Filled event
needs header, items,
and stock details
● Order Shipped event
needs header, items,
stock, address and
shipping details
@jbfletch_
Embrace Completion Criteria
1. Define the
information you need
for completeness.
2. Enumerate and map
those sources.
@jbfletch_
Embrace Completion Criteria
● Order Placed event
needs header and items
@jbfletch_
Embrace Completion Criteria
● Order Placed event
needs header and items
● Order Filled event needs
header, items, and stock
details
Mainframe
+
@jbfletch_
Embrace Completion Criteria
● Order Placed event
needs header and items
● Order Filled event needs
header, items, and stock
details
● Order Shipped event
needs header, items,
stock, address and
shipping details
Mainframe
+
+
@jbfletch_
Embrace Completion Criteria
1. Define the
information you need
for completeness.
2. Enumerate and map
those sources.
3. Employ a known best
practice to stop
using time and start
using completion.
@jbfletch_
Example 1.
● Order Placed event
needs header and items
@jbfletch_
Change Data Capture (CDC)...Multiple Tables Uh Oh..
What do I do when my
commit is across multiple
tables..how do I handle
transactions?
@jbfletch_
Change Data Capture (CDC)...Multiple Tables Uh Oh..
Outbox Pattern
@jbfletch_
Change Data Capture (CDC)...Multiple Tables Uh Oh..
Derivative Events
Becoming an event profiler
Trigger the event
in the source
system
Review the CDC
Messages
generated during
the event
Find the event
fingerprint that
signifies
completeness
WANTED
34
@jbfletch_
Becoming an event profiler
Trigger the event
in the source
system
Review the CDC
Messages
generated during
the event
Find the event
fingerprint that
signifies
completeness
WANTED
35
@jbfletch_
Becoming an event profiler
Trigger the event
in the source
system
Review the CDC
Messages
generated during
the event
Find the event
fingerprint that
signifies
completeness
WANTED
36
@jbfletch_
Complex Events
Multiple Tables Multiple Sources
MySQL Oracle
What constitutes event completeness?
37
@jbfletch_
Order and Items example
Order # 42
Total # Items 3
38
@jbfletch_
39
Flow Diagram @jbfletch_
Plan of attack
40
We need both of these things to be true before we
fire the event:
Order # 42
Total # Items 3
Order Event Aggregate
@jbfletch_
How do we wait for all items to arrive?
41
@jbfletch_
What is the minimum information we need to know to
be able to determine event completeness for items?
42
@jbfletch_
Total Number
of items per
order
43
Flow Diagram @jbfletch_
Basic Central Event Service Setup
Filter using the event profile: op_type = “I” to create:
KTable<OrderId, Order> orderTableKeyOrderId <- Orders that
match our order created event profile
KStream<ItemId,Items> itemsKeyedByItemIdStream <- Items
that match our order created event profile
KTable<OrderId,NumberOfItems> totalNumberofItemsTable <-
Number of items in each order
44
1
2
3
groupBy + aggregate + join + filter
KTable<OrderId, ArrayList<Items>> preItemsTable =
itemsKeyedByItemIdStream(ItemId,Items)
.groupBy(ORDER_ID) ← OrderId: 42
.aggregate(ArrayList::new, add(Items), return null for TS)
.join(totalNumberofItemsTable) <- itemCount: 3
Optional join allows for the propagation of total order
items to each item
45
1
2
3
@jbfletch_
groupBy + aggregate + join + filter
KTable<OrderId, ArrayList<Items>> preItemsTable =
itemsKeyedByItemIdStream<ItemId,Items>
.groupBy(ORDER_ID) ← OrderId: 42
.aggregate(ArrayList::new, add(Items), return null for TS)
.join(totalNumberofItemsTable) <- itemCount: 3
Optional join allows for the propagation of total order
items to each item
46
1
2
3
@jbfletch_
groupBy + aggregate + join + filter
KTable<OrderId, ArrayList<Items>> preItemsTable =
itemsKeyedByItemIdStream(ItemId,Items)
.groupBy(ORDER_ID) ← OrderId: 42
.aggregate(ArrayList::new, add(Items), return null for TS)
.join(totalNumberofItemsTable) <- itemCount: 3
Optional join allows for the propagation of total order
items to each item
47
1
2
3
@jbfletch_
groupBy + aggregate + join + filter
KTable<OrderId, ArrayList<Items>> fullItemsTable =
preItemsTable
.filter((k,v)-> v.size() ==
v.get(0).get(“itemCount”).asInt()) <- This
filter will block until all 3 item lines are
in the array
48
4
@jbfletch_
Part Deux
49
How can we be sure the order message has arrived?
Order # 42
Total # Items 3
Order Event Aggregate
@jbfletch_
Thou shall not pass!!! Using inner joins
50
KTable fullOrderTable =
orderTableKeyOrderId
.join(fullItemsTable, <- only
contains orders with all items
arrived (orderNode, itemNodes) -> {
construct and return order
placed event aggregate
})
@jbfletch_
@jbfletch_
Problem 3. What if my completion
criteria is never met?
@jbfletch_
Problem 3. What if my completion
criteria is never met?
Absence of
an Event!
@jbfletch_
Absence of an Event Detection with Kafka Streams
Time Exceeded?
Order Header Delay
Event
Order Items Delay
Event
The Processor API (PAPI)
can be used to evaluate
the time an entry has
existed in a state store, if
it’s over the tolerance you
set, an event can be
emitted.
@jbfletch_
Problem 4. Keeping track of complex
workflows
@jbfletch_
Routing Slip!
routingHeader:
● name
● currentStep
● slipId
routingSteps
● stepNumber
● Specific Parameters
● Error routing
56
@jbfletch_
Result

More Related Content

PPTX
Unifying Stream, SWL and CEP for Declarative Stream Processing with Apache Flink
PPTX
Fabian Hueske_Till Rohrmann - Declarative stream processing with StreamSQL an...
PDF
Streaming Analytics & CEP - Two sides of the same coin?
PPT
Event Logs: What kind of data does process mining require?
PDF
[WSO2Con EU 2017] Streaming Analytics Patterns for Your Digital Enterprise
PDF
Building Streaming Applications with Streaming SQL
PDF
WSO2Con ASIA 2016: WSO2 Analytics Platform: The One Stop Shop for All Your Da...
PPTX
Kostas Kloudas - Complex Event Processing with Flink: the state of FlinkCEP
Unifying Stream, SWL and CEP for Declarative Stream Processing with Apache Flink
Fabian Hueske_Till Rohrmann - Declarative stream processing with StreamSQL an...
Streaming Analytics & CEP - Two sides of the same coin?
Event Logs: What kind of data does process mining require?
[WSO2Con EU 2017] Streaming Analytics Patterns for Your Digital Enterprise
Building Streaming Applications with Streaming SQL
WSO2Con ASIA 2016: WSO2 Analytics Platform: The One Stop Shop for All Your Da...
Kostas Kloudas - Complex Event Processing with Flink: the state of FlinkCEP

Similar to Pragmatic Patterns (and Pitfalls) for Event Streaming in Brownfield Environments with Anna McDonald (20)

PPTX
A Deep Dive into Event Sourcing: Immutable and Scalable Systems
PDF
Event Driven Architecture with a RESTful Microservices Architecture (Kyle Ben...
PPTX
When ordering Matters - Flink Forward EU - Berlin - 2019
PDF
Real Time Event Processing and In-­memory analysis of Big Data - StampedeCon ...
PDF
WSO2 Product Release Webinar - WSO2 Complex Event Processor
PPTX
Why And When Should We Consider Stream Processing In Our Solutions Teqnation ...
PDF
A head start on cloud native event driven applications - bigdatadays
DOCX
Apache Big D-4.docx
PDF
You Put *What* in Your Stream?! Patterns and Practices for Event Design with ...
PPTX
Flink Forward Berlin 2017: Kostas Kloudas - Complex Event Processing with Fli...
PDF
Speeding up big data with event processing
PDF
Complex Event Processor 3.0.0 - An overview of upcoming features
PDF
Design and Implementation of A Data Stream Management System
PDF
ACM DEBS 2015: Realtime Streaming Analytics Patterns
PDF
DEBS 2015 Tutorial : Patterns for Realtime Streaming Analytics
PDF
Implementing a Data Mesh with Apache Kafka with Adam Bellemare | Kafka Summit...
PPTX
WSO2Con USA 2015: WSO2 Analytics Platform - The One Stop Shop for All Your Da...
PDF
WSO2 Complex Event Processor
PDF
A Brief History of Stream Processing
A Deep Dive into Event Sourcing: Immutable and Scalable Systems
Event Driven Architecture with a RESTful Microservices Architecture (Kyle Ben...
When ordering Matters - Flink Forward EU - Berlin - 2019
Real Time Event Processing and In-­memory analysis of Big Data - StampedeCon ...
WSO2 Product Release Webinar - WSO2 Complex Event Processor
Why And When Should We Consider Stream Processing In Our Solutions Teqnation ...
A head start on cloud native event driven applications - bigdatadays
Apache Big D-4.docx
You Put *What* in Your Stream?! Patterns and Practices for Event Design with ...
Flink Forward Berlin 2017: Kostas Kloudas - Complex Event Processing with Fli...
Speeding up big data with event processing
Complex Event Processor 3.0.0 - An overview of upcoming features
Design and Implementation of A Data Stream Management System
ACM DEBS 2015: Realtime Streaming Analytics Patterns
DEBS 2015 Tutorial : Patterns for Realtime Streaming Analytics
Implementing a Data Mesh with Apache Kafka with Adam Bellemare | Kafka Summit...
WSO2Con USA 2015: WSO2 Analytics Platform - The One Stop Shop for All Your Da...
WSO2 Complex Event Processor
A Brief History of Stream Processing
Ad

More from HostedbyConfluent (20)

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

Recently uploaded (20)

PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
August Patch Tuesday
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PPTX
The various Industrial Revolutions .pptx
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
Tartificialntelligence_presentation.pptx
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Hybrid model detection and classification of lung cancer
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PPTX
Chapter 5: Probability Theory and Statistics
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPT
Module 1.ppt Iot fundamentals and Architecture
PPTX
1. Introduction to Computer Programming.pptx
PPTX
TLE Review Electricity (Electricity).pptx
1 - Historical Antecedents, Social Consideration.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
August Patch Tuesday
Programs and apps: productivity, graphics, security and other tools
O2C Customer Invoices to Receipt V15A.pptx
The various Industrial Revolutions .pptx
Zenith AI: Advanced Artificial Intelligence
Tartificialntelligence_presentation.pptx
cloud_computing_Infrastucture_as_cloud_p
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Hybrid model detection and classification of lung cancer
Hindi spoken digit analysis for native and non-native speakers
NewMind AI Weekly Chronicles – August ’25 Week III
Chapter 5: Probability Theory and Statistics
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Developing a website for English-speaking practice to English as a foreign la...
A comparative study of natural language inference in Swahili using monolingua...
Module 1.ppt Iot fundamentals and Architecture
1. Introduction to Computer Programming.pptx
TLE Review Electricity (Electricity).pptx

Pragmatic Patterns (and Pitfalls) for Event Streaming in Brownfield Environments with Anna McDonald