SlideShare uma empresa Scribd logo
1 de 41
Building Event Driven
Architectures with
Kafka and Cloud Events
@DanRosanova
Group Principal Program Manager
Azure Messaging
Microsoft
Who am I and why am I here?
• Product owner for Azure’s
messaging services
• Career long Messenger
• Background in trading and
financial systems
Examining the parts of this talk
EVENT DRIVEN
ARCHITECTURE
APACHE KAFKA CNCF CLOUD EVENTS
What is Event Driven Architecture (EDA)
LOOSELY COUPLED ASYNCHRONOUS (NORMALLY) DOES NOT PROVIDE A
MEANINGFUL DIRECT RESPONSE
An architectural style (paradigm) built around reactive extensibility
with the following core principles
What do you mean by “Event-Driven”?
• Event Notification (what we will talk about)
• Event-carried state transfer (partially what we’ll talk about)
• Event Sourcing (not covered today)
https://martinfowler.com/articles/201701-event-driven.html
photo: Christopher Ferguson
Martin Fowler
Why use EDA?
Designed for distributed
systems
Simplifies horizontal
scale
Builds in resiliency
What is an event
A SIGNIFICANT CHANGE IN STATE E.G. A LIGHT TURNING FROM OFF
TO ON OR A TRADE FROM OPEN
TO FILLED
FROM HERE FORWARD WHAT WE
REALLY MEAN IS AN EVENT
NOTIFICATION
Attributes of
events
SELF CONTAINED AND
INDEPENDENT
CONTAINS
PROVENANCE
NOT TIED TO THE
LOGIC THAT IT WILL
ULTIMATELY TRIGGER
NORMALLY CONSISTS
OF A HEADER AND A
BODY
MAY OR MAY NOT
CONTAIN THE ACTUAL
STATE CHANGE
EVENTS ARE NOT
COMMANDS
Provenance
Who the
source is
“When” it
happened
What was the
cause of the
event
Deep thoughts
If an event happens and there’s
no one to receive it
Components of Event Driven Architecture
Emitter ConsumerChannel
• Generates and sends events
• Unaware of the existence of
consumers
• Does not expect responses
directly
• Reacts to events
• Directly processes
• Forwards
• May raise events of its own
• Communication conduit
• Exclusively responsible for the
distribution of events
• Does not imply transport or
protocol
Event Processing Styles
Simple event
processing (SEP)
•Individual single events
•Consumer directly
processes
•No further action
Events stream
processing (ESP)
•Unit of Work is stream
•Unending sequence
(codata)
•Consumer will have
some memory / state
Complex event
processing (CEP)
•Matching patterns
across events and
sources
•Not bound by time
Example stream processor
simpleMA(float[] prices, int period)
float result;
for(int i=0;i<period;i++)
result +=
prices[prices.length – i];
return result/period
Another example stream processor
Delay ReverbFlange
Extended from SEP to CEP
• Creating derivative
events
• Joining streams
• Over differing time
windows
Beyond the simple diagram – how EDAs really
look
Price Emitter
Moving
Average
Processor
RSI Processor
MACD
Processor
Trade Signal
CEP
Trading
Component
Consumer
Benefits of EDA: Scale out design
• Flowing changes
through the EDA
makes scaling out
trivial
• As scale grows just
add more nodes
• Easy!
Emitter
Consumer
Consumer
Benefits of EDA: Regionally distributed systems
• Add content-based
routing to deliver data for
where it’s needed
• Zero change for emitter
• Each region emits
• Each region receives
Benefits of EDA: Side by side deployment
• Start at the end and
work backwards
• Add a new version of
the consumer FIRST
• Consumers and
Emitters exist side by
side for some amount
of time
Emitter v1
Application v2
Application v1Application v3
Emitter v2
Emitter v3
Benefits of EDA: Side by side deployment
• Real systems are
not so simple
• There may be
hundreds of
components
• Downtime is not
as widely
accepted as it
used to be
Web Frontend Inventory Management Fraud Detection
Obvious drawbacks of EDA
Eventual
consistency
The channel is
now REALLY
important
End to end
visibility
Missed events
Replay Event storms CQRS
Hidden drawback of EDA: Semantic coupling
SUBSCRIPTIONS TYPES (SCHEMA) PATTERNS USED FOR
MATCHING EVENTS
Behavioral dependencies between components or services
<or> How to build a distributed monolith
What is
Apache
Kafka®
If you’re asking me, on
the last session of the
last day about what
Kafka is?
Where have
you been all
week?
Key
characteristics
of Apache
Kafka
A DISTRIBUTED
STREAMING PLATFORM
MANIFESTED AS
PARTITIONED APPEND
ONLY LOG
WITH CLIENT-SIDE CURSOR AND FAULT TOLERANCE
What Apache
Kafka is not
Cloud Events
• A specification for describing event data in common formats to
provide interoperability across services, platforms and systems
• An open standard built in an open forum via the CNCF’s Serverless
Working Group
• With many contributors across our industry (from Alibaba to
VMWare: can we a W,X,Y, or Z contributor?)
Why I believe strongly in open standards
REDUCES BARRIERS TO
ENTRY
SPURS INNOVATION PROTECTS EVERYONE
INVOLVED
https://ourworldindata.org/economic-growth
An example event
{
"id" : "A234-1234-1234",
"source" : "https://github.com/cloudevents/spec/pull",
"specversion" : "1.0-rc1",
"type" : "com.github.pull.create",
"subject" : "123",
"time" : "2018-04-05T17:31:00Z",
"datacontenttype" : "text/xml",
"data" : "<much wow="xml"/>"
}
RequiredOptional
Bringing it all
together
Kafka as a channel: Topics
Emitter
Consumer
• Obvious choice
• Solves replay
• Each consumer gets its
own offsets
• Decouples time
• Cloud Events already has a
Kafka Transport Binding Consumer
Does this
mean Kafka
for every
channel?
No!
Kafka as a consumer: KStreams
• Kstreams can materialize a
view for the scale out
model we saw earlier
• Can filter and forward
• Joins and aggregations
make CEP possible
KStream
Topic 1
Topic 2
Topic 3
Kafka for end to end visibility and logging
• Anything making
changes can write its
own events to a
centralized event log
• You can forward the
actual channel data as
well
KStream
Topic 1
Topic 2
Topic 3
Service 1
Service 2
Service 3
Emitter Topic
Global Log
Consumer
Topic ConsumerService N
Kafka as a router: Connect, MirrorMaker
• Write to local Kafka,
replicate and route as
needed
• Outbox for local services
in app, DC, or Geo
App 1
App
Health
Key take aways
AVOID THE ONE TOOL /
TOPIC TO RULE THEM
ALL
GO LOCAL – USE A
LOCAL CLUSTER /
COMPUTE
USE PORTABLE AND
OPEN FORMATS
PLAN FOR VERSIONING
AHEAD OF TIME –
CHANGE HAPPENS
Q&A
Open Stand

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Stability Patterns for Microservices
Stability Patterns for MicroservicesStability Patterns for Microservices
Stability Patterns for Microservices
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, Kanban
 
Service Mesh - Observability
Service Mesh - ObservabilityService Mesh - Observability
Service Mesh - Observability
 
Netflix Data Pipeline With Kafka
Netflix Data Pipeline With KafkaNetflix Data Pipeline With Kafka
Netflix Data Pipeline With Kafka
 
Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture
 
CQRS: Command/Query Responsibility Segregation
CQRS: Command/Query Responsibility SegregationCQRS: Command/Query Responsibility Segregation
CQRS: Command/Query Responsibility Segregation
 
Deep Dive into Apache Kafka
Deep Dive into Apache KafkaDeep Dive into Apache Kafka
Deep Dive into Apache Kafka
 
Introduction to Microservices Patterns
Introduction to Microservices PatternsIntroduction to Microservices Patterns
Introduction to Microservices Patterns
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Comparison of existing cni plugins for kubernetes
Comparison of existing cni plugins for kubernetesComparison of existing cni plugins for kubernetes
Comparison of existing cni plugins for kubernetes
 
Event Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQEvent Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQ
 
Performance Tuning RocksDB for Kafka Streams’ State Stores
Performance Tuning RocksDB for Kafka Streams’ State StoresPerformance Tuning RocksDB for Kafka Streams’ State Stores
Performance Tuning RocksDB for Kafka Streams’ State Stores
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Communication in a Microservice Architecture
Communication in a Microservice ArchitectureCommunication in a Microservice Architecture
Communication in a Microservice Architecture
 
Event Driven Software Architecture Pattern
Event Driven Software Architecture PatternEvent Driven Software Architecture Pattern
Event Driven Software Architecture Pattern
 
Kafka Streams: What it is, and how to use it?
Kafka Streams: What it is, and how to use it?Kafka Streams: What it is, and how to use it?
Kafka Streams: What it is, and how to use it?
 
DevOps with Kubernetes
DevOps with KubernetesDevOps with Kubernetes
DevOps with Kubernetes
 
Why to Cloud Native
Why to Cloud NativeWhy to Cloud Native
Why to Cloud Native
 
Producer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache KafkaProducer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache Kafka
 
Event-driven microservices
Event-driven microservicesEvent-driven microservices
Event-driven microservices
 

Semelhante a Building Event Driven Architectures with Kafka and Cloud Events (Dan Rosanova, Microsoft ) Kafka Summit SF 2019

AWS re:Invent 2016: Effective Application Data Analytics for Modern Applicati...
AWS re:Invent 2016: Effective Application Data Analytics for Modern Applicati...AWS re:Invent 2016: Effective Application Data Analytics for Modern Applicati...
AWS re:Invent 2016: Effective Application Data Analytics for Modern Applicati...
Amazon Web Services
 
Aberdeen Oil & Gas Event - Cloud Adoption Framework
Aberdeen Oil & Gas Event - Cloud Adoption FrameworkAberdeen Oil & Gas Event - Cloud Adoption Framework
Aberdeen Oil & Gas Event - Cloud Adoption Framework
Amazon Web Services
 

Semelhante a Building Event Driven Architectures with Kafka and Cloud Events (Dan Rosanova, Microsoft ) Kafka Summit SF 2019 (20)

Business and IT agility through DevOps and microservice architecture powered ...
Business and IT agility through DevOps and microservice architecture powered ...Business and IT agility through DevOps and microservice architecture powered ...
Business and IT agility through DevOps and microservice architecture powered ...
 
Enterprise Cloud Transformation
Enterprise Cloud TransformationEnterprise Cloud Transformation
Enterprise Cloud Transformation
 
Cisco ACI for the Microsoft Cloud Platform
Cisco ACI for the Microsoft Cloud PlatformCisco ACI for the Microsoft Cloud Platform
Cisco ACI for the Microsoft Cloud Platform
 
Netflix Cloud Architecture and Open Source
Netflix Cloud Architecture and Open SourceNetflix Cloud Architecture and Open Source
Netflix Cloud Architecture and Open Source
 
AWS re:Invent 2016: Effective Application Data Analytics for Modern Applicati...
AWS re:Invent 2016: Effective Application Data Analytics for Modern Applicati...AWS re:Invent 2016: Effective Application Data Analytics for Modern Applicati...
AWS re:Invent 2016: Effective Application Data Analytics for Modern Applicati...
 
Reduce Risk with End to End Monitoring of Middleware-based Applications
Reduce Risk with End to End Monitoring of Middleware-based ApplicationsReduce Risk with End to End Monitoring of Middleware-based Applications
Reduce Risk with End to End Monitoring of Middleware-based Applications
 
Large-Scale AWS Migrations with CSC
Large-Scale AWS Migrations with CSCLarge-Scale AWS Migrations with CSC
Large-Scale AWS Migrations with CSC
 
Aberdeen Oil & Gas Event - Cloud Adoption Framework
Aberdeen Oil & Gas Event - Cloud Adoption FrameworkAberdeen Oil & Gas Event - Cloud Adoption Framework
Aberdeen Oil & Gas Event - Cloud Adoption Framework
 
Deep dive into service fabric after 2 years
Deep dive into service fabric after 2 yearsDeep dive into service fabric after 2 years
Deep dive into service fabric after 2 years
 
Building stateful serverless orchestrations with Azure Durable Azure Function...
Building stateful serverless orchestrations with Azure Durable Azure Function...Building stateful serverless orchestrations with Azure Durable Azure Function...
Building stateful serverless orchestrations with Azure Durable Azure Function...
 
PCF: Platform for a New Era - Kubernetes for the Enterprise - London
PCF: Platform for a New Era - Kubernetes for the Enterprise - LondonPCF: Platform for a New Era - Kubernetes for the Enterprise - London
PCF: Platform for a New Era - Kubernetes for the Enterprise - London
 
Confluent Partner Tech Talk with Synthesis
Confluent Partner Tech Talk with SynthesisConfluent Partner Tech Talk with Synthesis
Confluent Partner Tech Talk with Synthesis
 
Migrating Thousands of Workloads to AWS at Enterprise Scale – Chris Wegmann, ...
Migrating Thousands of Workloads to AWS at Enterprise Scale – Chris Wegmann, ...Migrating Thousands of Workloads to AWS at Enterprise Scale – Chris Wegmann, ...
Migrating Thousands of Workloads to AWS at Enterprise Scale – Chris Wegmann, ...
 
Why Your Digital Transformation Strategy Demands Middleware Modernization
Why Your Digital Transformation Strategy Demands Middleware ModernizationWhy Your Digital Transformation Strategy Demands Middleware Modernization
Why Your Digital Transformation Strategy Demands Middleware Modernization
 
Global Azure 2024 - On-Premises to Azure Cloud: .NET Web App Journey
Global Azure 2024 - On-Premises to Azure Cloud: .NET Web App JourneyGlobal Azure 2024 - On-Premises to Azure Cloud: .NET Web App Journey
Global Azure 2024 - On-Premises to Azure Cloud: .NET Web App Journey
 
Netflix Cloud Platform and Open Source
Netflix Cloud Platform and Open SourceNetflix Cloud Platform and Open Source
Netflix Cloud Platform and Open Source
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Manage the Digital Transformation with Machine Learning in a Reactive Microse...
Manage the Digital Transformation with Machine Learning in a Reactive Microse...Manage the Digital Transformation with Machine Learning in a Reactive Microse...
Manage the Digital Transformation with Machine Learning in a Reactive Microse...
 
AWS re:Invent 2016: Large-scale AWS Migrations (ENT204)
AWS re:Invent 2016: Large-scale AWS Migrations (ENT204)AWS re:Invent 2016: Large-scale AWS Migrations (ENT204)
AWS re:Invent 2016: Large-scale AWS Migrations (ENT204)
 
It summit 2014_migrating_applications_to_the_cloud-5
It summit 2014_migrating_applications_to_the_cloud-5It summit 2014_migrating_applications_to_the_cloud-5
It summit 2014_migrating_applications_to_the_cloud-5
 

Mais de confluent

Mais de confluent (20)

Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Santander Stream Processing with Apache Flink
Santander Stream Processing with Apache FlinkSantander Stream Processing with Apache Flink
Santander Stream Processing with Apache Flink
 
Unlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insightsUnlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insights
 
Workshop híbrido: Stream Processing con Flink
Workshop híbrido: Stream Processing con FlinkWorkshop híbrido: Stream Processing con Flink
Workshop híbrido: Stream Processing con Flink
 
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
 
AWS Immersion Day Mapfre - Confluent
AWS Immersion Day Mapfre   -   ConfluentAWS Immersion Day Mapfre   -   Confluent
AWS Immersion Day Mapfre - Confluent
 
Eventos y Microservicios - Santander TechTalk
Eventos y Microservicios - Santander TechTalkEventos y Microservicios - Santander TechTalk
Eventos y Microservicios - Santander TechTalk
 
Q&A with Confluent Experts: Navigating Networking in Confluent Cloud
Q&A with Confluent Experts: Navigating Networking in Confluent CloudQ&A with Confluent Experts: Navigating Networking in Confluent Cloud
Q&A with Confluent Experts: Navigating Networking in Confluent Cloud
 
Citi TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Dive
 
Build real-time streaming data pipelines to AWS with 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
 
Q&A with Confluent Professional Services: Confluent Service Mesh
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
 
Citi Tech Talk: Event Driven Kafka Microservices
Citi Tech Talk: Event Driven Kafka MicroservicesCiti Tech Talk: Event Driven Kafka Microservices
Citi Tech Talk: Event Driven Kafka Microservices
 
Confluent & GSI Webinars series - Session 3
Confluent & GSI Webinars series - Session 3Confluent & GSI Webinars series - Session 3
Confluent & GSI Webinars series - Session 3
 
Citi Tech Talk: Messaging Modernization
Citi Tech Talk: Messaging ModernizationCiti Tech Talk: Messaging Modernization
Citi Tech Talk: Messaging Modernization
 
Citi Tech Talk: Data Governance for streaming and real time data
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
 
Confluent & GSI Webinars series: Session 2
Confluent & GSI Webinars series: Session 2Confluent & GSI Webinars series: Session 2
Confluent & GSI Webinars series: Session 2
 
Data In Motion Paris 2023
Data In Motion Paris 2023Data In Motion Paris 2023
Data In Motion Paris 2023
 
The Future of Application Development - API Days - Melbourne 2023
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
 
The Playful Bond Between REST And Data Streams
The Playful Bond Between REST And Data StreamsThe Playful Bond Between REST And Data Streams
The Playful Bond Between REST And Data Streams
 
The Journey to Data Mesh with Confluent
The Journey to Data Mesh with ConfluentThe Journey to Data Mesh with Confluent
The Journey to Data Mesh with Confluent
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

Building Event Driven Architectures with Kafka and Cloud Events (Dan Rosanova, Microsoft ) Kafka Summit SF 2019

  • 1. Building Event Driven Architectures with Kafka and Cloud Events @DanRosanova Group Principal Program Manager Azure Messaging Microsoft
  • 2. Who am I and why am I here? • Product owner for Azure’s messaging services • Career long Messenger • Background in trading and financial systems
  • 3. Examining the parts of this talk EVENT DRIVEN ARCHITECTURE APACHE KAFKA CNCF CLOUD EVENTS
  • 4. What is Event Driven Architecture (EDA) LOOSELY COUPLED ASYNCHRONOUS (NORMALLY) DOES NOT PROVIDE A MEANINGFUL DIRECT RESPONSE An architectural style (paradigm) built around reactive extensibility with the following core principles
  • 5. What do you mean by “Event-Driven”? • Event Notification (what we will talk about) • Event-carried state transfer (partially what we’ll talk about) • Event Sourcing (not covered today) https://martinfowler.com/articles/201701-event-driven.html photo: Christopher Ferguson Martin Fowler
  • 6. Why use EDA? Designed for distributed systems Simplifies horizontal scale Builds in resiliency
  • 7. What is an event A SIGNIFICANT CHANGE IN STATE E.G. A LIGHT TURNING FROM OFF TO ON OR A TRADE FROM OPEN TO FILLED FROM HERE FORWARD WHAT WE REALLY MEAN IS AN EVENT NOTIFICATION
  • 8. Attributes of events SELF CONTAINED AND INDEPENDENT CONTAINS PROVENANCE NOT TIED TO THE LOGIC THAT IT WILL ULTIMATELY TRIGGER NORMALLY CONSISTS OF A HEADER AND A BODY MAY OR MAY NOT CONTAIN THE ACTUAL STATE CHANGE EVENTS ARE NOT COMMANDS
  • 9. Provenance Who the source is “When” it happened What was the cause of the event
  • 10. Deep thoughts If an event happens and there’s no one to receive it
  • 11. Components of Event Driven Architecture Emitter ConsumerChannel • Generates and sends events • Unaware of the existence of consumers • Does not expect responses directly • Reacts to events • Directly processes • Forwards • May raise events of its own • Communication conduit • Exclusively responsible for the distribution of events • Does not imply transport or protocol
  • 12. Event Processing Styles Simple event processing (SEP) •Individual single events •Consumer directly processes •No further action Events stream processing (ESP) •Unit of Work is stream •Unending sequence (codata) •Consumer will have some memory / state Complex event processing (CEP) •Matching patterns across events and sources •Not bound by time
  • 13. Example stream processor simpleMA(float[] prices, int period) float result; for(int i=0;i<period;i++) result += prices[prices.length – i]; return result/period
  • 14. Another example stream processor Delay ReverbFlange
  • 15. Extended from SEP to CEP • Creating derivative events • Joining streams • Over differing time windows
  • 16. Beyond the simple diagram – how EDAs really look Price Emitter Moving Average Processor RSI Processor MACD Processor Trade Signal CEP Trading Component
  • 17. Consumer Benefits of EDA: Scale out design • Flowing changes through the EDA makes scaling out trivial • As scale grows just add more nodes • Easy! Emitter Consumer Consumer
  • 18. Benefits of EDA: Regionally distributed systems • Add content-based routing to deliver data for where it’s needed • Zero change for emitter • Each region emits • Each region receives
  • 19. Benefits of EDA: Side by side deployment • Start at the end and work backwards • Add a new version of the consumer FIRST • Consumers and Emitters exist side by side for some amount of time Emitter v1 Application v2 Application v1Application v3 Emitter v2 Emitter v3
  • 20. Benefits of EDA: Side by side deployment • Real systems are not so simple • There may be hundreds of components • Downtime is not as widely accepted as it used to be Web Frontend Inventory Management Fraud Detection
  • 21. Obvious drawbacks of EDA Eventual consistency The channel is now REALLY important End to end visibility Missed events Replay Event storms CQRS
  • 22. Hidden drawback of EDA: Semantic coupling SUBSCRIPTIONS TYPES (SCHEMA) PATTERNS USED FOR MATCHING EVENTS Behavioral dependencies between components or services <or> How to build a distributed monolith
  • 24. If you’re asking me, on the last session of the last day about what Kafka is?
  • 25. Where have you been all week?
  • 26. Key characteristics of Apache Kafka A DISTRIBUTED STREAMING PLATFORM MANIFESTED AS PARTITIONED APPEND ONLY LOG WITH CLIENT-SIDE CURSOR AND FAULT TOLERANCE
  • 28.
  • 29. Cloud Events • A specification for describing event data in common formats to provide interoperability across services, platforms and systems • An open standard built in an open forum via the CNCF’s Serverless Working Group • With many contributors across our industry (from Alibaba to VMWare: can we a W,X,Y, or Z contributor?)
  • 30. Why I believe strongly in open standards REDUCES BARRIERS TO ENTRY SPURS INNOVATION PROTECTS EVERYONE INVOLVED
  • 32. An example event { "id" : "A234-1234-1234", "source" : "https://github.com/cloudevents/spec/pull", "specversion" : "1.0-rc1", "type" : "com.github.pull.create", "subject" : "123", "time" : "2018-04-05T17:31:00Z", "datacontenttype" : "text/xml", "data" : "<much wow="xml"/>" } RequiredOptional
  • 34. Kafka as a channel: Topics Emitter Consumer • Obvious choice • Solves replay • Each consumer gets its own offsets • Decouples time • Cloud Events already has a Kafka Transport Binding Consumer
  • 35. Does this mean Kafka for every channel? No!
  • 36. Kafka as a consumer: KStreams • Kstreams can materialize a view for the scale out model we saw earlier • Can filter and forward • Joins and aggregations make CEP possible KStream Topic 1 Topic 2 Topic 3
  • 37. Kafka for end to end visibility and logging • Anything making changes can write its own events to a centralized event log • You can forward the actual channel data as well KStream Topic 1 Topic 2 Topic 3 Service 1 Service 2 Service 3 Emitter Topic Global Log Consumer Topic ConsumerService N
  • 38. Kafka as a router: Connect, MirrorMaker • Write to local Kafka, replicate and route as needed • Outbox for local services in app, DC, or Geo App 1 App Health
  • 39. Key take aways AVOID THE ONE TOOL / TOPIC TO RULE THEM ALL GO LOCAL – USE A LOCAL CLUSTER / COMPUTE USE PORTABLE AND OPEN FORMATS PLAN FOR VERSIONING AHEAD OF TIME – CHANGE HAPPENS
  • 40. Q&A