SlideShare a Scribd company logo
Apache Kafka
© 2019 IBM Corporation
Event-Driven
Microservices
Using IBM Apache Kafka
Andrew Schofield
Chief Architect, Event Streams
IBM Hursley Park
Event-Driven Architecture meetup
© 2019 IBM Corporation
What are microservices?
Microservices is a technique for structuring
an application as a collection of services
• Self-contained with clear interfaces and
a distinct purpose
• Loosely coupled – communicate over a
network
• Independently deployable, scalable,
maintainable and testable
Microservices ApplicationMonolithic Application
© 2019 IBM Corporation
Event-driven microservices
Microservices communicate primarily with
events, with APIs where required
• Microservices can produce and
consume events using publish/subscribe
messaging
• Events are handled by an event
backbone
• Data is eventually consistentMICROSERVICES APPLICATION
API
MICROSERVICE
MICROSERVICE
MICROSERVICE
EVENT BACKBONE
MICROSERVICE
MICROSERVICE
MICROSERVICE
MICROSERVICE
MICROSERVICE
API
SERVICE DISCOVERY
PUBLISH
PUBLISH
SUBSCRIBE
SUBSCRIBE
© 2019 IBM Corporation
Comparing messaging patterns
QUEUE 0 1 2 3 4 5 6 7
CONSUMER CONSUMER CONSUMER
PRODUCER PRODUCER
TOPIC 0 1 2 3 4 5 6 7
SUBSCRIPTION SUBSCRIPTION
PRODUCER PRODUCER
CONSUMER CONSUMER CONSUMER
POINT-TO-POINT PUBLISH/SUBSCRIBE
© 2019 IBM Corporation
Apache Kafka is an Open-Source Streaming Platform
PUBLISH/SUBSCRIBE
Read and write streams of events, like a
traditional messaging system
PROCESS
Support scalable stream processing
applications that react to events in real
time
STORE
Store streams of data safely in a
distributed, replicated, fault-tolerant
cluster
https://kafka.apache.org/
Kafka
Cluster
Producer ProducerProducer
Consumer ConsumerConsumer
Stream
Processor
Stream
Processor
Source
Connector
Sink Connector
© 2019 IBM Corporation
Introducing the event backbone
EVENT BACKBONE
Microservic
e
Microservic
e
© 2019 IBM Corporation
Introducing the event backbone
1
Building Blocks
1 :: Event sources
Microservic
e
Microservic
e
EVENT BACKBONE
© 2019 IBM Corporation
Introducing the event backbone
1
2
Building Blocks
1 :: Event sources
2 :: Stream processing
Microservic
e
Microservic
e
EVENT BACKBONE
© 2019 IBM Corporation
Introducing the event backbone
1
2 App
3
Building Blocks
1 :: Event sources
2 :: Stream processing
3 :: Event archive
Microservic
e
Microservic
e
EVENT BACKBONE
© 2019 IBM Corporation
Introducing the event backbone
App
1
2
3
4
Building Blocks
1 :: Event sources
2 :: Stream processing
3 :: Event archive
4 :: Notifications
Microservic
e
Microservic
e
EVENT BACKBONE
© 2019 IBM Corporation
A simple stream processing example
EVENT BACKBONE
Transactions
© 2019 IBM Corporation
A simple stream processing example
EVENT BACKBONE
Transactions
Alerts
© 2019 IBM Corporation
A simple stream processing example
EVENT BACKBONE
Transactions
Alerts
SMS alerts
Email alerts
Push alerts
© 2019 IBM Corporation
A simple stream processing example
EVENT BACKBONE
Send SMS
Transactions
Alerts
Send emails
Send push
notifications
SMS alerts
Email alerts
Push alerts
© 2019 IBM Corporation
How to get started
You could run an event storming workshop
https://www.ibm.com/cloud/garage/architectures/eventDrivenArchitecture/event-storming-
methodology
Identify:
Events
Actors
Data
Commands
© 2019 IBM Corporation
A more complex event-driven example
https://ibm-cloud-architecture.github.io/refarch-kc/design/readme/
© 2019 IBM Corporation
A more complex example – component view
Fleet
microservice
Containers
microservice
Voyages
microservice
Orders
microservice
API API
© 2019 IBM Corporation
A more complex example – component view
Fleet
microservice
Containers
microservice
Voyages
microservice
Orders
microservice
API API
© 2019 IBM Corporation
A more complex example – component view
EVENT BACKBONE
ships containers orders voyages
Fleet
microservice
Containers
microservice
Voyages
microservice
Orders
microservice
API API
© 2019 IBM Corporation
A more complex example – component view
EVENT BACKBONE
ships containers problems orders voyages
Fleet
microservice
Containers
microservice
Voyages
microservice
Orders
microservice
Streaming
analytics
API API
© 2019 IBM Corporation
Patterns for event-driven microservices
You want:
Loose coupling
Data consistency
Efficient queries
You need PATTERNS, such as:
Database per service
Saga
Event sourcing
CQRS
© 2019 IBM Corporation
Pattern – Database per service
Each microservice persists its own data
Protects independence of the microservice against external change
Introduces complexity for data consistency across microservices
EVENT BACKBONE
ships containers problems orders voyages
Fleet
microservice
Containers
microservice
Voyages
microservice
Orders
microservice
© 2019 IBM Corporation
Kafka log compaction for data replication
0
key:a
val:A1
1
key:b
val:B1
2
key:a
val:A2
3
key:c
val:C1
TOPIC
PARTITION
4
key:c
val:C2
PRODUCER
Consumer
takes latest
values and
builds own
data store
KEY VALUE
a A2
b <deleted>
c C2
SOURCE CHANGE
LOG
Read
© 2019 IBM Corporation
Kafka log compaction for data replication
0
key:a
val:A1
1
key:b
val:B1
2
key:a
val:A2
3
key:c
val:C1
TOPIC
PARTITION
4
key:c
val:C2
KEY VALUE
a A2
b <deleted>
c C2
2
key:a
val:A2
4
key:b
val:C2
TOPIC
PARTITION
(rewritten)
PERIODIC COMPACTION ELIMINATES
DUPLICATE KEYS TO MINIMIZE STORAGE
© 2019 IBM Corporation
Pattern – Sagas
Orchestration of multi-step operations across microservices
Data consistency across microservices without distributed transactions
Programming can be complex, particularly for failure compensation
EVENT BACKBONE
Fleet
microservice
Containers
microservice
Voyages
microservice
Orders
microservice
1 2 3 4 5
© 2019 IBM Corporation
EVENT BACKBONE
Pattern – Event sourcing
Every state change to an object is captured as an event stored in sequence
Replaying the events in order rebuilds the current state of the objects
By subscribing to the events, you get an evolving copy of the objects’ state
Query
handler
Command
handler
USER
Order1
Created
Order1
Updated
Order2
Created
Order1
Complete
Order3
Created
Order2
Canceled
Order3
Updated
Order3
Complete
© 2019 IBM Corporation
Pattern – Event sourcing with Kafka
Order2
Created
Order2
Updated
Order4
Created
Order2
Complete
Order4
Canceled
Order3
Created
Order3
Updated
Order6
Created
Order3
Complete
Order3
Created
Order6
Updated
Order1
Created
Order1
Updated
Order5
Created
Order1
Complete
Order7
Created
Order5
Canceled
Order7
Updated
Order7
Complete
TOPIC orders
PARTITION 0
TOPIC orders
PARTITION 1
TOPIC orders
PARTITION 2
CONSUMER GROUP A
p0, offset 7
p1, offset 3
p2, offset 5
CONSUMER
CONSUMER
CONSUMER
CONSUMER GROUP B
p0, offset 7
p1, offset 3
p2, offset 5
CONSUMER
CONSUMER
© 2019 IBM Corporation
Pattern – Command Query Responsibility Segregation (CQRS)
Atomic writes and efficient reads at the same time
API split into commands (change state) and queries (read only)
Complex in practice
EVENT BACKBONE
1 2 3 4 5
Fleet MS
WRITE
MODEL
Fleet MS
READ MODEL
Write-optimized
store
Read-optimized
store
Write API Read API
© 2019 IBM Corporation
Summary
Event-driven microservices offer an effective way to build loosely coupled applications
Techniques such as event storming can be used to derive the objects, commands and
events in an application
Patterns such as event sourcing and sagas make the complexity manageable
© 2019 IBM Corporation
Thank you
Andrew Schofield
Chief Architect, Event Streams
IBM Hursley Park
andrew_schofield@uk.ibm.com
Ad

More Related Content

What's hot (20)

Azure API Management
Azure API ManagementAzure API Management
Azure API Management
Daniel Toomey
 
Microservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native AppsMicroservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native Apps
Araf Karsh Hamid
 
Simplify DevOps with Microservices and Mobile Backends.pptx
Simplify DevOps with Microservices and Mobile Backends.pptxSimplify DevOps with Microservices and Mobile Backends.pptx
Simplify DevOps with Microservices and Mobile Backends.pptx
ssuser5faa791
 
Microservices, DevOps & SRE
Microservices, DevOps & SREMicroservices, DevOps & SRE
Microservices, DevOps & SRE
Araf Karsh Hamid
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, Kanban
Araf Karsh Hamid
 
Event driven microservices
Event driven microservicesEvent driven microservices
Event driven microservices
Anthony Martin
 
Cloud Architecture - Multi Cloud, Edge, On-Premise
Cloud Architecture - Multi Cloud, Edge, On-PremiseCloud Architecture - Multi Cloud, Edge, On-Premise
Cloud Architecture - Multi Cloud, Edge, On-Premise
Araf Karsh Hamid
 
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
Timothy McAliley
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
Anil Allewar
 
The Architecture of an API Platform
The Architecture of an API PlatformThe Architecture of an API Platform
The Architecture of an API Platform
Johannes Ridderstedt
 
A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 A pattern language for microservices - June 2021
A pattern language for microservices - June 2021
Chris Richardson
 
API Management in Azure
API Management in AzureAPI Management in Azure
API Management in Azure
Tomasso Groenendijk
 
App Modernization
App ModernizationApp Modernization
App Modernization
PT Datacomm Diangraha
 
The Top 5 Apache Kafka Use Cases and Architectures in 2022
The Top 5 Apache Kafka Use Cases and Architectures in 2022The Top 5 Apache Kafka Use Cases and Architectures in 2022
The Top 5 Apache Kafka Use Cases and Architectures in 2022
Kai Wähner
 
Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven Architecture
Stefan Norberg
 
The Rise Of Event Streaming – Why Apache Kafka Changes Everything
The Rise Of Event Streaming – Why Apache Kafka Changes EverythingThe Rise Of Event Streaming – Why Apache Kafka Changes Everything
The Rise Of Event Streaming – Why Apache Kafka Changes Everything
Kai Wähner
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
Nguyen Tung
 
Microservice architecture design principles
Microservice architecture design principlesMicroservice architecture design principles
Microservice architecture design principles
Sanjoy Kumar Roy
 
Real-Life Use Cases & Architectures for Event Streaming with Apache Kafka
Real-Life Use Cases & Architectures for Event Streaming with Apache KafkaReal-Life Use Cases & Architectures for Event Streaming with Apache Kafka
Real-Life Use Cases & Architectures for Event Streaming with Apache Kafka
Kai Wähner
 
Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture
Solace
 
Azure API Management
Azure API ManagementAzure API Management
Azure API Management
Daniel Toomey
 
Microservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native AppsMicroservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native Apps
Araf Karsh Hamid
 
Simplify DevOps with Microservices and Mobile Backends.pptx
Simplify DevOps with Microservices and Mobile Backends.pptxSimplify DevOps with Microservices and Mobile Backends.pptx
Simplify DevOps with Microservices and Mobile Backends.pptx
ssuser5faa791
 
Microservices, DevOps & SRE
Microservices, DevOps & SREMicroservices, DevOps & SRE
Microservices, DevOps & SRE
Araf Karsh Hamid
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, Kanban
Araf Karsh Hamid
 
Event driven microservices
Event driven microservicesEvent driven microservices
Event driven microservices
Anthony Martin
 
Cloud Architecture - Multi Cloud, Edge, On-Premise
Cloud Architecture - Multi Cloud, Edge, On-PremiseCloud Architecture - Multi Cloud, Edge, On-Premise
Cloud Architecture - Multi Cloud, Edge, On-Premise
Araf Karsh Hamid
 
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
Azure Cloud Adoption Framework + Governance - Sana Khan and Jay Kumar
Timothy McAliley
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
Anil Allewar
 
The Architecture of an API Platform
The Architecture of an API PlatformThe Architecture of an API Platform
The Architecture of an API Platform
Johannes Ridderstedt
 
A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 A pattern language for microservices - June 2021
A pattern language for microservices - June 2021
Chris Richardson
 
The Top 5 Apache Kafka Use Cases and Architectures in 2022
The Top 5 Apache Kafka Use Cases and Architectures in 2022The Top 5 Apache Kafka Use Cases and Architectures in 2022
The Top 5 Apache Kafka Use Cases and Architectures in 2022
Kai Wähner
 
Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven Architecture
Stefan Norberg
 
The Rise Of Event Streaming – Why Apache Kafka Changes Everything
The Rise Of Event Streaming – Why Apache Kafka Changes EverythingThe Rise Of Event Streaming – Why Apache Kafka Changes Everything
The Rise Of Event Streaming – Why Apache Kafka Changes Everything
Kai Wähner
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
Nguyen Tung
 
Microservice architecture design principles
Microservice architecture design principlesMicroservice architecture design principles
Microservice architecture design principles
Sanjoy Kumar Roy
 
Real-Life Use Cases & Architectures for Event Streaming with Apache Kafka
Real-Life Use Cases & Architectures for Event Streaming with Apache KafkaReal-Life Use Cases & Architectures for Event Streaming with Apache Kafka
Real-Life Use Cases & Architectures for Event Streaming with Apache Kafka
Kai Wähner
 
Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture Introduction to Event-Driven Architecture
Introduction to Event-Driven Architecture
Solace
 

Similar to Event-driven microservices (20)

Kafka with IBM Event Streams - Technical Presentation
Kafka with IBM Event Streams - Technical PresentationKafka with IBM Event Streams - Technical Presentation
Kafka with IBM Event Streams - Technical Presentation
Winton Winton
 
The resurgence of event driven architecture
The resurgence of event driven architectureThe resurgence of event driven architecture
The resurgence of event driven architecture
Kim Clark
 
Architecture 2020 - eComputing 2019-07-01
Architecture 2020 - eComputing 2019-07-01Architecture 2020 - eComputing 2019-07-01
Architecture 2020 - eComputing 2019-07-01
Jorge Hidalgo
 
AWS Accra Meetup - Developing Modern Applications in the Cloud
AWS Accra Meetup - Developing Modern Applications in the CloudAWS Accra Meetup - Developing Modern Applications in the Cloud
AWS Accra Meetup - Developing Modern Applications in the Cloud
Cobus Bernard
 
[CPT DevOps Meetup] Developing Modern Applications in the Cloud
[CPT DevOps Meetup] Developing Modern Applications in the Cloud[CPT DevOps Meetup] Developing Modern Applications in the Cloud
[CPT DevOps Meetup] Developing Modern Applications in the Cloud
Cobus Bernard
 
AWS Jozi Meetup Developing Modern Applications in the Cloud
AWS Jozi Meetup Developing Modern Applications in the CloudAWS Jozi Meetup Developing Modern Applications in the Cloud
AWS Jozi Meetup Developing Modern Applications in the Cloud
Cobus Bernard
 
How IBM is helping developers win the race to innovate with next-gen cloud se...
How IBM is helping developers win the race to innovate with next-gen cloud se...How IBM is helping developers win the race to innovate with next-gen cloud se...
How IBM is helping developers win the race to innovate with next-gen cloud se...
Michael Elder
 
Creating Microservices Application with IBM Cloud Private (ICP) - introductio...
Creating Microservices Application with IBM Cloud Private (ICP) - introductio...Creating Microservices Application with IBM Cloud Private (ICP) - introductio...
Creating Microservices Application with IBM Cloud Private (ICP) - introductio...
PT Datacomm Diangraha
 
IBM Hybrid Cloud Integration UCC Talk, 23rd November 2021 - Cloud Application...
IBM Hybrid Cloud Integration UCC Talk, 23rd November 2021 - Cloud Application...IBM Hybrid Cloud Integration UCC Talk, 23rd November 2021 - Cloud Application...
IBM Hybrid Cloud Integration UCC Talk, 23rd November 2021 - Cloud Application...
Michael O'Sullivan
 
Jfokus - Reacting to an event-driven world
Jfokus - Reacting to an event-driven worldJfokus - Reacting to an event-driven world
Jfokus - Reacting to an event-driven world
Grace Jansen
 
JSpring Virtual 2020 - Reacting to an event-driven world
JSpring Virtual 2020 - Reacting to an event-driven worldJSpring Virtual 2020 - Reacting to an event-driven world
JSpring Virtual 2020 - Reacting to an event-driven world
Grace Jansen
 
An architect’s guide to leveraging your incumbency
An architect’s guide to leveraging your incumbencyAn architect’s guide to leveraging your incumbency
An architect’s guide to leveraging your incumbency
Michael Elder
 
Agile integration architecture in relation to APIs and messaging
Agile integration architecture in relation to APIs and messagingAgile integration architecture in relation to APIs and messaging
Agile integration architecture in relation to APIs and messaging
Kim Clark
 
IBM Cloud UCC Talk, 8th December 2020 - Cloud Native, Microservices, and Serv...
IBM Cloud UCC Talk, 8th December 2020 - Cloud Native, Microservices, and Serv...IBM Cloud UCC Talk, 8th December 2020 - Cloud Native, Microservices, and Serv...
IBM Cloud UCC Talk, 8th December 2020 - Cloud Native, Microservices, and Serv...
Michael O'Sullivan
 
IBM Cloud Private and IBM Power Systems: Overview and Real-World Scenarios
IBM Cloud Private and IBM Power Systems: Overview and Real-World ScenariosIBM Cloud Private and IBM Power Systems: Overview and Real-World Scenarios
IBM Cloud Private and IBM Power Systems: Overview and Real-World Scenarios
Joe Cropper
 
Trends at JavaOne 2016: Microservices, Docker and Cloud-Native Middleware
Trends at JavaOne 2016: Microservices, Docker and Cloud-Native MiddlewareTrends at JavaOne 2016: Microservices, Docker and Cloud-Native Middleware
Trends at JavaOne 2016: Microservices, Docker and Cloud-Native Middleware
Kai Wähner
 
VJUG - Reacting to an event driven world
VJUG - Reacting to an event driven worldVJUG - Reacting to an event driven world
VJUG - Reacting to an event driven world
Grace Jansen
 
F5 Distributed Cloud.pptx
F5 Distributed Cloud.pptxF5 Distributed Cloud.pptx
F5 Distributed Cloud.pptx
abenyeung1
 
Convergence of Integration and Application Development
Convergence of Integration and Application DevelopmentConvergence of Integration and Application Development
Convergence of Integration and Application Development
Kim Clark
 
AWS Community Day, Chennai - 2019
AWS Community Day, Chennai - 2019AWS Community Day, Chennai - 2019
AWS Community Day, Chennai - 2019
Pranesh Vittal
 
Kafka with IBM Event Streams - Technical Presentation
Kafka with IBM Event Streams - Technical PresentationKafka with IBM Event Streams - Technical Presentation
Kafka with IBM Event Streams - Technical Presentation
Winton Winton
 
The resurgence of event driven architecture
The resurgence of event driven architectureThe resurgence of event driven architecture
The resurgence of event driven architecture
Kim Clark
 
Architecture 2020 - eComputing 2019-07-01
Architecture 2020 - eComputing 2019-07-01Architecture 2020 - eComputing 2019-07-01
Architecture 2020 - eComputing 2019-07-01
Jorge Hidalgo
 
AWS Accra Meetup - Developing Modern Applications in the Cloud
AWS Accra Meetup - Developing Modern Applications in the CloudAWS Accra Meetup - Developing Modern Applications in the Cloud
AWS Accra Meetup - Developing Modern Applications in the Cloud
Cobus Bernard
 
[CPT DevOps Meetup] Developing Modern Applications in the Cloud
[CPT DevOps Meetup] Developing Modern Applications in the Cloud[CPT DevOps Meetup] Developing Modern Applications in the Cloud
[CPT DevOps Meetup] Developing Modern Applications in the Cloud
Cobus Bernard
 
AWS Jozi Meetup Developing Modern Applications in the Cloud
AWS Jozi Meetup Developing Modern Applications in the CloudAWS Jozi Meetup Developing Modern Applications in the Cloud
AWS Jozi Meetup Developing Modern Applications in the Cloud
Cobus Bernard
 
How IBM is helping developers win the race to innovate with next-gen cloud se...
How IBM is helping developers win the race to innovate with next-gen cloud se...How IBM is helping developers win the race to innovate with next-gen cloud se...
How IBM is helping developers win the race to innovate with next-gen cloud se...
Michael Elder
 
Creating Microservices Application with IBM Cloud Private (ICP) - introductio...
Creating Microservices Application with IBM Cloud Private (ICP) - introductio...Creating Microservices Application with IBM Cloud Private (ICP) - introductio...
Creating Microservices Application with IBM Cloud Private (ICP) - introductio...
PT Datacomm Diangraha
 
IBM Hybrid Cloud Integration UCC Talk, 23rd November 2021 - Cloud Application...
IBM Hybrid Cloud Integration UCC Talk, 23rd November 2021 - Cloud Application...IBM Hybrid Cloud Integration UCC Talk, 23rd November 2021 - Cloud Application...
IBM Hybrid Cloud Integration UCC Talk, 23rd November 2021 - Cloud Application...
Michael O'Sullivan
 
Jfokus - Reacting to an event-driven world
Jfokus - Reacting to an event-driven worldJfokus - Reacting to an event-driven world
Jfokus - Reacting to an event-driven world
Grace Jansen
 
JSpring Virtual 2020 - Reacting to an event-driven world
JSpring Virtual 2020 - Reacting to an event-driven worldJSpring Virtual 2020 - Reacting to an event-driven world
JSpring Virtual 2020 - Reacting to an event-driven world
Grace Jansen
 
An architect’s guide to leveraging your incumbency
An architect’s guide to leveraging your incumbencyAn architect’s guide to leveraging your incumbency
An architect’s guide to leveraging your incumbency
Michael Elder
 
Agile integration architecture in relation to APIs and messaging
Agile integration architecture in relation to APIs and messagingAgile integration architecture in relation to APIs and messaging
Agile integration architecture in relation to APIs and messaging
Kim Clark
 
IBM Cloud UCC Talk, 8th December 2020 - Cloud Native, Microservices, and Serv...
IBM Cloud UCC Talk, 8th December 2020 - Cloud Native, Microservices, and Serv...IBM Cloud UCC Talk, 8th December 2020 - Cloud Native, Microservices, and Serv...
IBM Cloud UCC Talk, 8th December 2020 - Cloud Native, Microservices, and Serv...
Michael O'Sullivan
 
IBM Cloud Private and IBM Power Systems: Overview and Real-World Scenarios
IBM Cloud Private and IBM Power Systems: Overview and Real-World ScenariosIBM Cloud Private and IBM Power Systems: Overview and Real-World Scenarios
IBM Cloud Private and IBM Power Systems: Overview and Real-World Scenarios
Joe Cropper
 
Trends at JavaOne 2016: Microservices, Docker and Cloud-Native Middleware
Trends at JavaOne 2016: Microservices, Docker and Cloud-Native MiddlewareTrends at JavaOne 2016: Microservices, Docker and Cloud-Native Middleware
Trends at JavaOne 2016: Microservices, Docker and Cloud-Native Middleware
Kai Wähner
 
VJUG - Reacting to an event driven world
VJUG - Reacting to an event driven worldVJUG - Reacting to an event driven world
VJUG - Reacting to an event driven world
Grace Jansen
 
F5 Distributed Cloud.pptx
F5 Distributed Cloud.pptxF5 Distributed Cloud.pptx
F5 Distributed Cloud.pptx
abenyeung1
 
Convergence of Integration and Application Development
Convergence of Integration and Application DevelopmentConvergence of Integration and Application Development
Convergence of Integration and Application Development
Kim Clark
 
AWS Community Day, Chennai - 2019
AWS Community Day, Chennai - 2019AWS Community Day, Chennai - 2019
AWS Community Day, Chennai - 2019
Pranesh Vittal
 
Ad

More from Andrew Schofield (9)

Technology choices for Apache Kafka and Change Data Capture
Technology choices for Apache Kafka and Change Data CaptureTechnology choices for Apache Kafka and Change Data Capture
Technology choices for Apache Kafka and Change Data Capture
Andrew Schofield
 
IBM Message Hub: Cloud-Native Messaging
IBM Message Hub: Cloud-Native MessagingIBM Message Hub: Cloud-Native Messaging
IBM Message Hub: Cloud-Native Messaging
Andrew Schofield
 
Effectively Managing a Hybrid Messaging Environment
Effectively Managing a Hybrid Messaging EnvironmentEffectively Managing a Hybrid Messaging Environment
Effectively Managing a Hybrid Messaging Environment
Andrew Schofield
 
Introducing IBM Message Hub: Cloud-scale messaging based on Apache Kafka
Introducing IBM Message Hub: Cloud-scale messaging based on Apache KafkaIntroducing IBM Message Hub: Cloud-scale messaging based on Apache Kafka
Introducing IBM Message Hub: Cloud-scale messaging based on Apache Kafka
Andrew Schofield
 
IBM Message Hub service in Bluemix - Apache Kafka in a public cloud
IBM Message Hub service in Bluemix - Apache Kafka in a public cloudIBM Message Hub service in Bluemix - Apache Kafka in a public cloud
IBM Message Hub service in Bluemix - Apache Kafka in a public cloud
Andrew Schofield
 
Ame 2269 ibm mq high availability
Ame 2269 ibm mq high availabilityAme 2269 ibm mq high availability
Ame 2269 ibm mq high availability
Andrew Schofield
 
Ame 4166 ibm mq appliance
Ame 4166 ibm mq applianceAme 4166 ibm mq appliance
Ame 4166 ibm mq appliance
Andrew Schofield
 
Connecting IBM MessageSight to the Enterprise
Connecting IBM MessageSight to the EnterpriseConnecting IBM MessageSight to the Enterprise
Connecting IBM MessageSight to the Enterprise
Andrew Schofield
 
Introduction to IBM MessageSight
Introduction to IBM MessageSightIntroduction to IBM MessageSight
Introduction to IBM MessageSight
Andrew Schofield
 
Technology choices for Apache Kafka and Change Data Capture
Technology choices for Apache Kafka and Change Data CaptureTechnology choices for Apache Kafka and Change Data Capture
Technology choices for Apache Kafka and Change Data Capture
Andrew Schofield
 
IBM Message Hub: Cloud-Native Messaging
IBM Message Hub: Cloud-Native MessagingIBM Message Hub: Cloud-Native Messaging
IBM Message Hub: Cloud-Native Messaging
Andrew Schofield
 
Effectively Managing a Hybrid Messaging Environment
Effectively Managing a Hybrid Messaging EnvironmentEffectively Managing a Hybrid Messaging Environment
Effectively Managing a Hybrid Messaging Environment
Andrew Schofield
 
Introducing IBM Message Hub: Cloud-scale messaging based on Apache Kafka
Introducing IBM Message Hub: Cloud-scale messaging based on Apache KafkaIntroducing IBM Message Hub: Cloud-scale messaging based on Apache Kafka
Introducing IBM Message Hub: Cloud-scale messaging based on Apache Kafka
Andrew Schofield
 
IBM Message Hub service in Bluemix - Apache Kafka in a public cloud
IBM Message Hub service in Bluemix - Apache Kafka in a public cloudIBM Message Hub service in Bluemix - Apache Kafka in a public cloud
IBM Message Hub service in Bluemix - Apache Kafka in a public cloud
Andrew Schofield
 
Ame 2269 ibm mq high availability
Ame 2269 ibm mq high availabilityAme 2269 ibm mq high availability
Ame 2269 ibm mq high availability
Andrew Schofield
 
Connecting IBM MessageSight to the Enterprise
Connecting IBM MessageSight to the EnterpriseConnecting IBM MessageSight to the Enterprise
Connecting IBM MessageSight to the Enterprise
Andrew Schofield
 
Introduction to IBM MessageSight
Introduction to IBM MessageSightIntroduction to IBM MessageSight
Introduction to IBM MessageSight
Andrew Schofield
 
Ad

Recently uploaded (20)

Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 

Event-driven microservices

  • 1. Apache Kafka © 2019 IBM Corporation Event-Driven Microservices Using IBM Apache Kafka Andrew Schofield Chief Architect, Event Streams IBM Hursley Park Event-Driven Architecture meetup
  • 2. © 2019 IBM Corporation What are microservices? Microservices is a technique for structuring an application as a collection of services • Self-contained with clear interfaces and a distinct purpose • Loosely coupled – communicate over a network • Independently deployable, scalable, maintainable and testable Microservices ApplicationMonolithic Application
  • 3. © 2019 IBM Corporation Event-driven microservices Microservices communicate primarily with events, with APIs where required • Microservices can produce and consume events using publish/subscribe messaging • Events are handled by an event backbone • Data is eventually consistentMICROSERVICES APPLICATION API MICROSERVICE MICROSERVICE MICROSERVICE EVENT BACKBONE MICROSERVICE MICROSERVICE MICROSERVICE MICROSERVICE MICROSERVICE API SERVICE DISCOVERY PUBLISH PUBLISH SUBSCRIBE SUBSCRIBE
  • 4. © 2019 IBM Corporation Comparing messaging patterns QUEUE 0 1 2 3 4 5 6 7 CONSUMER CONSUMER CONSUMER PRODUCER PRODUCER TOPIC 0 1 2 3 4 5 6 7 SUBSCRIPTION SUBSCRIPTION PRODUCER PRODUCER CONSUMER CONSUMER CONSUMER POINT-TO-POINT PUBLISH/SUBSCRIBE
  • 5. © 2019 IBM Corporation Apache Kafka is an Open-Source Streaming Platform PUBLISH/SUBSCRIBE Read and write streams of events, like a traditional messaging system PROCESS Support scalable stream processing applications that react to events in real time STORE Store streams of data safely in a distributed, replicated, fault-tolerant cluster https://kafka.apache.org/ Kafka Cluster Producer ProducerProducer Consumer ConsumerConsumer Stream Processor Stream Processor Source Connector Sink Connector
  • 6. © 2019 IBM Corporation Introducing the event backbone EVENT BACKBONE Microservic e Microservic e
  • 7. © 2019 IBM Corporation Introducing the event backbone 1 Building Blocks 1 :: Event sources Microservic e Microservic e EVENT BACKBONE
  • 8. © 2019 IBM Corporation Introducing the event backbone 1 2 Building Blocks 1 :: Event sources 2 :: Stream processing Microservic e Microservic e EVENT BACKBONE
  • 9. © 2019 IBM Corporation Introducing the event backbone 1 2 App 3 Building Blocks 1 :: Event sources 2 :: Stream processing 3 :: Event archive Microservic e Microservic e EVENT BACKBONE
  • 10. © 2019 IBM Corporation Introducing the event backbone App 1 2 3 4 Building Blocks 1 :: Event sources 2 :: Stream processing 3 :: Event archive 4 :: Notifications Microservic e Microservic e EVENT BACKBONE
  • 11. © 2019 IBM Corporation A simple stream processing example EVENT BACKBONE Transactions
  • 12. © 2019 IBM Corporation A simple stream processing example EVENT BACKBONE Transactions Alerts
  • 13. © 2019 IBM Corporation A simple stream processing example EVENT BACKBONE Transactions Alerts SMS alerts Email alerts Push alerts
  • 14. © 2019 IBM Corporation A simple stream processing example EVENT BACKBONE Send SMS Transactions Alerts Send emails Send push notifications SMS alerts Email alerts Push alerts
  • 15. © 2019 IBM Corporation How to get started You could run an event storming workshop https://www.ibm.com/cloud/garage/architectures/eventDrivenArchitecture/event-storming- methodology Identify: Events Actors Data Commands
  • 16. © 2019 IBM Corporation A more complex event-driven example https://ibm-cloud-architecture.github.io/refarch-kc/design/readme/
  • 17. © 2019 IBM Corporation A more complex example – component view Fleet microservice Containers microservice Voyages microservice Orders microservice API API
  • 18. © 2019 IBM Corporation A more complex example – component view Fleet microservice Containers microservice Voyages microservice Orders microservice API API
  • 19. © 2019 IBM Corporation A more complex example – component view EVENT BACKBONE ships containers orders voyages Fleet microservice Containers microservice Voyages microservice Orders microservice API API
  • 20. © 2019 IBM Corporation A more complex example – component view EVENT BACKBONE ships containers problems orders voyages Fleet microservice Containers microservice Voyages microservice Orders microservice Streaming analytics API API
  • 21. © 2019 IBM Corporation Patterns for event-driven microservices You want: Loose coupling Data consistency Efficient queries You need PATTERNS, such as: Database per service Saga Event sourcing CQRS
  • 22. © 2019 IBM Corporation Pattern – Database per service Each microservice persists its own data Protects independence of the microservice against external change Introduces complexity for data consistency across microservices EVENT BACKBONE ships containers problems orders voyages Fleet microservice Containers microservice Voyages microservice Orders microservice
  • 23. © 2019 IBM Corporation Kafka log compaction for data replication 0 key:a val:A1 1 key:b val:B1 2 key:a val:A2 3 key:c val:C1 TOPIC PARTITION 4 key:c val:C2 PRODUCER Consumer takes latest values and builds own data store KEY VALUE a A2 b <deleted> c C2 SOURCE CHANGE LOG Read
  • 24. © 2019 IBM Corporation Kafka log compaction for data replication 0 key:a val:A1 1 key:b val:B1 2 key:a val:A2 3 key:c val:C1 TOPIC PARTITION 4 key:c val:C2 KEY VALUE a A2 b <deleted> c C2 2 key:a val:A2 4 key:b val:C2 TOPIC PARTITION (rewritten) PERIODIC COMPACTION ELIMINATES DUPLICATE KEYS TO MINIMIZE STORAGE
  • 25. © 2019 IBM Corporation Pattern – Sagas Orchestration of multi-step operations across microservices Data consistency across microservices without distributed transactions Programming can be complex, particularly for failure compensation EVENT BACKBONE Fleet microservice Containers microservice Voyages microservice Orders microservice 1 2 3 4 5
  • 26. © 2019 IBM Corporation EVENT BACKBONE Pattern – Event sourcing Every state change to an object is captured as an event stored in sequence Replaying the events in order rebuilds the current state of the objects By subscribing to the events, you get an evolving copy of the objects’ state Query handler Command handler USER Order1 Created Order1 Updated Order2 Created Order1 Complete Order3 Created Order2 Canceled Order3 Updated Order3 Complete
  • 27. © 2019 IBM Corporation Pattern – Event sourcing with Kafka Order2 Created Order2 Updated Order4 Created Order2 Complete Order4 Canceled Order3 Created Order3 Updated Order6 Created Order3 Complete Order3 Created Order6 Updated Order1 Created Order1 Updated Order5 Created Order1 Complete Order7 Created Order5 Canceled Order7 Updated Order7 Complete TOPIC orders PARTITION 0 TOPIC orders PARTITION 1 TOPIC orders PARTITION 2 CONSUMER GROUP A p0, offset 7 p1, offset 3 p2, offset 5 CONSUMER CONSUMER CONSUMER CONSUMER GROUP B p0, offset 7 p1, offset 3 p2, offset 5 CONSUMER CONSUMER
  • 28. © 2019 IBM Corporation Pattern – Command Query Responsibility Segregation (CQRS) Atomic writes and efficient reads at the same time API split into commands (change state) and queries (read only) Complex in practice EVENT BACKBONE 1 2 3 4 5 Fleet MS WRITE MODEL Fleet MS READ MODEL Write-optimized store Read-optimized store Write API Read API
  • 29. © 2019 IBM Corporation Summary Event-driven microservices offer an effective way to build loosely coupled applications Techniques such as event storming can be used to derive the objects, commands and events in an application Patterns such as event sourcing and sagas make the complexity manageable
  • 30. © 2019 IBM Corporation Thank you Andrew Schofield Chief Architect, Event Streams IBM Hursley Park [email protected]

Editor's Notes

  • #4: Why event-driven? Proper loose-coupling means asynchronous communication Enables responsive applications In the real world, things often take time to complete
  • #6: Kafka is a great choice for the event backbone Publish/subscribe Stream history Partitioning – workload distribution and ordering
  • #12: Stream processing takes a sequence of data (the stream) and applies a sequence of processing to each element in the stream. Optimised for this continuous, event-at-a-time processing Techniques such as pipelining, or batching of transactions.
  • #16: Outcome is a design built from loosely coupled microservices linked through an event-driven architecture using one or more event backbones 6-8 people including domain experts and stakeholders – sticky notes, stand up, collaborate Domain event – past tense ”order completed” Actor – users Command – action/decision Data - needed for the commands Phases Domain events, placed on a timeline Commands Data Aggregates – group together related events and commands and data – potential boundary of microservices
  • #22: Could use Kafka’s stream-table duality which layers a database on topic of a key-value-based stream
  • #26: https://simplesource.io/simple_sagas_key_concepts.html
  • #29: write subsystem to publish changes to an event log, and the query subsystem to materialize the views it requires by applying these changes