Events are the fundamental component of every streaming architecture, and how you implement them will hugely impact your event-driven architectures. Despite the wide range of materials on event-driven architectures and the importance of event modeling, this critical domain is often left as an exercise for you to implement on your own. Improperly modeling your events can have difficult and costly impacts on not only your event consumers but on the teams and systems that produce them as well.
In this talk, Adam covers the main considerations of modeling and implementing events. Data is often modeled as a Fact or a Delta, though the distinction isn't always clear.
For one, facts are commonly used in the event-carried state transfer pattern, while deltas are commonly used in event sourcing. But when communicating across domain boundaries, which ones should you choose? What are the tradeoffs, the benefits, and the best use-cases for each? Adam digs into these main event types, providing some examples and guidelines for when to use each.
Adam closes out the presentation with an opinionated list of best practices. Do you think naming is tricky? What about versioning? Evolving your data model got you down? Torn between multiple event types per stream and multiple streams per event? Adam's has a host of best practices, well-reasoned examples, and practical tips to help you model and implement your events and streams.
But what is the real-time data analytics stack? Kafka is the de facto standard for getting data-in-motion but what do we add in order to extract insights in real-time?
The modern developer has many options to choose from: there’s stream processing frameworks/engines such as Kafka Streams or Apache Flink, real-time OLAP databases such as Apache Druid or Apache Pinot, streaming databases such as Materialize and ksqlDB, time series databases such as TimescaleDB or InfluxDB and even your regular OLTP database such as PostgreSQL or MySQL.
What should you choose and why?
This talk will explore the real-time analytics technology space from the perspective of the software developer that wants real-time insights in their software. We’ll cover the main categories, how these technologies work and their strengths and weaknesses.
I want developers to come away from this talk empowered to add real-time insights to their software, using the right tool for their needs.
Boost Fertility New Invention Ups Success Rates.pdf
You Put *What* in Your Stream?! Patterns and Practices for Event Design with Adam Bellemare
1. You Put WHAT in Your Stream?!
Patterns and Practices for Event Design
2. @AdamBellemare | developer.confluent.io
Who am I?
● Staff Technologist at Confluent
● Previously a Data Platform Engineer
● Written a few Books
● Check out the Practical Data Mesh!
Released 2020
AVAILABLE NOW!
29. @AdamBellemare | developer.confluent.io
A lot of it depends on the boundaries
Internal World
External
World
Service
Boundary
(aka: Bounded
Context)
External
World
External
World
31. @AdamBellemare | developer.confluent.io
Data on the Inside
Tables
Stream Stream
Event Sourcing
Database-Backed System Event-Sourced System
Private and Purpose-Built for Internal Usage!
36. @AdamBellemare | developer.confluent.io
Deltas Are Used in Event Sourcing
(Data on the Inside)
Customer Product Quantity
Robert
Pants 1
T-Shirts 1
Hats 15
11:37 2 Pants added to cart
11:39 1 T-Shirt added to cart
11:41 1 Pants removed from cart
11:42 15 Hats added to cart
11:42 Apply Discount Code
Event
Time Events
Read
Apply in order to build state
Current Consumer State
Stream Table
37. @AdamBellemare | developer.confluent.io
Deltas Not Suitable for Building External State
(Data on the Outside)
11:37 2 Pants added to cart
11:39 1 T-Shirt added to cart
11:41 1 Pants removed from cart
11:42 15 Hats added to cart
11:42 Apply Discount Code
Event
Time Events
Read Duplicate
Cart Building
Logic
Independent Consumer
Services
Apply in order to build state
Apply in order
to build state
Stream
64. @AdamBellemare | developer.confluent.io
Use Case 1: Transferring State with Facts
Cart Fact Event
{
"cart_id": 3125123,
"item_map": [ (521,1), (923,3) ],
"shipping": "express"
}
Single Type per Stream
Cart Facts
Consumers
68. @AdamBellemare | developer.confluent.io
Use Case 2: General Alerting of Changes
item_added_to_cart
item_removed_from_cart
discount_code_applied
Single Type per Stream
Consumers
70. @AdamBellemare | developer.confluent.io
Multiple Types per Stream
Cart Events Stream
Consumer
item_added_to_cart
item_removed_from_cart
discount_code_applied
Use Case 3: Strict Order Processing
71. @AdamBellemare | developer.confluent.io
Can always split up the stream later
Cart Events Stream
ksqlDB
Application
item_added_to_cart
item_removed_from_cart
discount_code_applied
82. @AdamBellemare | developer.confluent.io
2) <domain>.<service>.<event-type>.<version>
Event Stream Naming Including Service Name
Orders.Order_Placer_Service.Order.v1
Customers.Ad_Manager.Advertisement.v2
Customers.Ad_Budget_Manager.Ad_Promo_Budget.v2