SlideShare ist ein Scribd-Unternehmen logo
1 von 30
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

Weitere ähnliche Inhalte

Was ist angesagt?

Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesAraf Karsh Hamid
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecturetyrantbrian
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitecturePaul Mooney
 
Event driven microservices
Event driven microservicesEvent driven microservices
Event driven microservicesAnthony Martin
 
Event-Driven Architecture (EDA)
Event-Driven Architecture (EDA)Event-Driven Architecture (EDA)
Event-Driven Architecture (EDA)WSO2
 
Integration Patterns and Anti-Patterns for Microservices Architectures
Integration Patterns and Anti-Patterns for Microservices ArchitecturesIntegration Patterns and Anti-Patterns for Microservices Architectures
Integration Patterns and Anti-Patterns for Microservices ArchitecturesApcera
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architectureThe Software House
 
Apache Kafka® and API Management
Apache Kafka® and API ManagementApache Kafka® and API Management
Apache Kafka® and API Managementconfluent
 
Effective API Gateway
Effective API GatewayEffective API Gateway
Effective API GatewayHari Wiz
 
Microservices Design Patterns
Microservices Design PatternsMicroservices Design Patterns
Microservices Design PatternsHaim Michael
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services ArchitectureAraf Karsh Hamid
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservicesAnil Allewar
 
Event Driven Software Architecture Pattern
Event Driven Software Architecture PatternEvent Driven Software Architecture Pattern
Event Driven Software Architecture Patternjeetendra mandal
 
Microservices Part 3 Service Mesh and Kafka
Microservices Part 3 Service Mesh and KafkaMicroservices Part 3 Service Mesh and Kafka
Microservices Part 3 Service Mesh and KafkaAraf Karsh Hamid
 

Was ist angesagt? (20)

Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic Architecture
 
Event driven microservices
Event driven microservicesEvent driven microservices
Event driven microservices
 
Why Microservice
Why Microservice Why Microservice
Why Microservice
 
Event-Driven Architecture (EDA)
Event-Driven Architecture (EDA)Event-Driven Architecture (EDA)
Event-Driven Architecture (EDA)
 
Integration Patterns and Anti-Patterns for Microservices Architectures
Integration Patterns and Anti-Patterns for Microservices ArchitecturesIntegration Patterns and Anti-Patterns for Microservices Architectures
Integration Patterns and Anti-Patterns for Microservices Architectures
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
infrastructure as code
infrastructure as codeinfrastructure as code
infrastructure as code
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architecture
 
Apache Kafka® and API Management
Apache Kafka® and API ManagementApache Kafka® and API Management
Apache Kafka® and API Management
 
Effective API Gateway
Effective API GatewayEffective API Gateway
Effective API Gateway
 
Microservices Design Patterns
Microservices Design PatternsMicroservices Design Patterns
Microservices Design Patterns
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
 
Event driven architecture
Event driven architectureEvent driven architecture
Event driven architecture
 
Demystifying Service Mesh
Demystifying Service MeshDemystifying Service Mesh
Demystifying Service Mesh
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Event Driven Software Architecture Pattern
Event Driven Software Architecture PatternEvent Driven Software Architecture Pattern
Event Driven Software Architecture Pattern
 
Microservices Part 3 Service Mesh and Kafka
Microservices Part 3 Service Mesh and KafkaMicroservices Part 3 Service Mesh and Kafka
Microservices Part 3 Service Mesh and Kafka
 

Ähnlich wie Event-driven microservices

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 PresentationWinton Winton
 
The resurgence of event driven architecture
The resurgence of event driven architectureThe resurgence of event driven architecture
The resurgence of event driven architectureKim Clark
 
CICDforModernApplications-Oslo.pdf
CICDforModernApplications-Oslo.pdfCICDforModernApplications-Oslo.pdf
CICDforModernApplications-Oslo.pdfAmazon Web Services
 
Architecture 2020 - eComputing 2019-07-01
Architecture 2020 - eComputing 2019-07-01Architecture 2020 - eComputing 2019-07-01
Architecture 2020 - eComputing 2019-07-01Jorge 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 CloudCobus 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 CloudCobus 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 CloudCobus 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 worldGrace 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 worldGrace 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 incumbencyMichael 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 messagingKim 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 ScenariosJoe 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 MiddlewareKai 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 worldGrace Jansen
 

Ähnlich wie 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
 
The resurgence of event driven architecture
The resurgence of event driven architectureThe resurgence of event driven architecture
The resurgence of event driven architecture
 
CICDforModernApplications-Oslo.pdf
CICDforModernApplications-Oslo.pdfCICDforModernApplications-Oslo.pdf
CICDforModernApplications-Oslo.pdf
 
Architecture 2020 - eComputing 2019-07-01
Architecture 2020 - eComputing 2019-07-01Architecture 2020 - eComputing 2019-07-01
Architecture 2020 - eComputing 2019-07-01
 
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
 
[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
 
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
 
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...
 
App Modernization
App ModernizationApp Modernization
App Modernization
 
CI/CD for Modern Applications
CI/CD for Modern ApplicationsCI/CD for Modern Applications
CI/CD for Modern Applications
 
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...
 
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...
 
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
 
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
 
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
 
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
 
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...
 
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
 
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
 
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
 

Mehr von 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 CaptureAndrew Schofield
 
IBM Message Hub: Cloud-Native Messaging
IBM Message Hub: Cloud-Native MessagingIBM Message Hub: Cloud-Native Messaging
IBM Message Hub: Cloud-Native MessagingAndrew Schofield
 
Effectively Managing a Hybrid Messaging Environment
Effectively Managing a Hybrid Messaging EnvironmentEffectively Managing a Hybrid Messaging Environment
Effectively Managing a Hybrid Messaging EnvironmentAndrew 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 KafkaAndrew 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 cloudAndrew Schofield
 
Ame 2269 ibm mq high availability
Ame 2269 ibm mq high availabilityAme 2269 ibm mq high availability
Ame 2269 ibm mq high availabilityAndrew Schofield
 
Connecting IBM MessageSight to the Enterprise
Connecting IBM MessageSight to the EnterpriseConnecting IBM MessageSight to the Enterprise
Connecting IBM MessageSight to the EnterpriseAndrew Schofield
 
Introduction to IBM MessageSight
Introduction to IBM MessageSightIntroduction to IBM MessageSight
Introduction to IBM MessageSightAndrew Schofield
 

Mehr von 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
 
IBM Message Hub: Cloud-Native Messaging
IBM Message Hub: Cloud-Native MessagingIBM Message Hub: Cloud-Native Messaging
IBM Message Hub: Cloud-Native Messaging
 
Effectively Managing a Hybrid Messaging Environment
Effectively Managing a Hybrid Messaging EnvironmentEffectively Managing a Hybrid Messaging Environment
Effectively Managing a Hybrid Messaging Environment
 
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
 
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
 
Ame 2269 ibm mq high availability
Ame 2269 ibm mq high availabilityAme 2269 ibm mq high availability
Ame 2269 ibm mq high availability
 
Ame 4166 ibm mq appliance
Ame 4166 ibm mq applianceAme 4166 ibm mq appliance
Ame 4166 ibm mq appliance
 
Connecting IBM MessageSight to the Enterprise
Connecting IBM MessageSight to the EnterpriseConnecting IBM MessageSight to the Enterprise
Connecting IBM MessageSight to the Enterprise
 
Introduction to IBM MessageSight
Introduction to IBM MessageSightIntroduction to IBM MessageSight
Introduction to IBM MessageSight
 

Kürzlich hochgeladen

Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Lecture # 8 software design and architecture (SDA).ppt
Lecture # 8 software design and architecture (SDA).pptLecture # 8 software design and architecture (SDA).ppt
Lecture # 8 software design and architecture (SDA).pptesrabilgic2
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
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...confluent
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 

Kürzlich hochgeladen (20)

Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Lecture # 8 software design and architecture (SDA).ppt
Lecture # 8 software design and architecture (SDA).pptLecture # 8 software design and architecture (SDA).ppt
Lecture # 8 software design and architecture (SDA).ppt
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
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...
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 

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 andrew_schofield@uk.ibm.com

Hinweis der Redaktion

  1. Why event-driven? Proper loose-coupling means asynchronous communication Enables responsive applications In the real world, things often take time to complete
  2. Kafka is a great choice for the event backbone Publish/subscribe Stream history Partitioning – workload distribution and ordering
  3. 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.
  4. 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
  5. Could use Kafka’s stream-table duality which layers a database on topic of a key-value-based stream
  6. https://simplesource.io/simple_sagas_key_concepts.html
  7. write subsystem to publish changes to an event log, and the query subsystem to materialize the views it requires by applying these changes