SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Downloaden Sie, um offline zu lesen
SIMPLE MACHINES
Sagas in Kafka
SAGAS IN KAFKA !1
Stephen Zoio — Principal Consultant
SIMPLE MACHINES SAGAS IN KAFKA
!2
Journey to Sagas
Coordinating microservices Sagas
Kafka as a database
Events
A protocol for distributed and long running transactions
SIMPLE MACHINES SAGAS IN KAFKA
!3
Microservice Transactions
www.
Flight Booking
Hotel Booking
Car Rental Payment
Trips
?
SIMPLE MACHINES SAGAS IN KAFKA
!4
Two Phase Commit
www.
Flight Booking
Hotel Booking
Car Rental Payment
Trips
Prepare
Response
Confirm
Acknowledgement
• Too strict
• Too slow
• Too complex
Not that popular in practice…
SIMPLE MACHINES SAGAS IN KAFKA
!5
Saga Transaction
www.
Flight Booking
Hotel Booking
Car Rental Payment
Trips
Action
Success Response
• Much simpler protocol
• Minimises latency and comms
• Services don’t need to care
about sagas
SIMPLE MACHINES SAGAS IN KAFKA
!6
Saga Failure
www.
Flight Booking
Hotel Booking
Car Rental Payment
Trips
Action
Success Response
Compensation
Failure
work backwards, executing
compensating actions
Compensation Response
SIMPLE MACHINES SAGAS IN KAFKA
!7
Saga Data Consistency
SQL Database
A Atomicity
C Consistency
I Isolation
D Durability
Sagas
A Atomicity
C Consistency
I Isolation
D Durability
We give up isolation, but we
can live without it…
SIMPLE MACHINES SAGAS IN KAFKA
!8
Kafka and Event Sourcing
Kafka as a database?
Event sourcing
Event processingKafka
Events
WHY NOT STORE
THE DATA LIKE WE
USE IT?
WE’RE ALREADY
USING KAFKA FOR
MESSAGING
SIMPLE MACHINES SAGAS IN KAFKA
!9
Event Log Consistency
e.g. Bank Account
Events
Simple Sourcing
• Balance always positive
• Account never debited twice
Taking advantage of
• Kafka exactly once processing
• Per topic-partition ordering guarantee
An API to support
these consistency
requirements
SIMPLE MACHINES SAGAS IN KAFKA
!11
Simple Sourcing Concepts
Type Represents Example
C Command Intent debit Bob’s account $100
E Event Outcome Bob’s account debited $100
A Aggregate State Bob’s account balance=$700, available=$650
K Key Identity Bob’s account number
Based on CQRS (Command query responsibility segregation)
SIMPLE MACHINES SAGAS IN KAFKA
!12
Simple Sourcing Data Flow
Kafka
Command request
Aggregate state
Command response
Event
Bob’s
balance
>$100?
Debit Bob’s account $100
Return Success
Publish event
AccountDebited(bob, 100)
Return error response
Debit Bob’s account $100
Yes
No
Everything happens in a single atomic transaction
SIMPLE MACHINES SAGAS IN KAFKA
!13
Simple Sourcing Programming Model
In Scala types
(Command, Aggregate) => Either[Error, List[Event]]
(Event, Aggregate) => Aggregate
Key => Aggregate
COMMAND HANDLER
EVENT AGGREGATOR
INITIAL VALUE
SIMPLE MACHINES SAGAS IN KAFKA
!14
Event Sourced Apps
Coordinating between aggregates: Bike auction scenario
Account Aggregate
Key Total Reserved
Bob’s a/c 400 200
Charlie’s a/c 500 –
Auction Aggregate
Key Bidder Amount
Bicycle Bob 200
Reserve Charlie’s account $250
Bid $250 for Charlie
Release $200 for Bob
$200 Current bid: Bob $200
Bob
$250 Next bid: Charlie $250
Charlie
250
Auction Aggregate
Key Bidder Amount
Bicycle Charlie 250
–
SIMPLE MACHINES SAGAS IN KAFKA
!15
Auction App
Coordinating between aggregates
Charlie
$250
Account Aggregate
Key Total Reserved
Bob’s a/c 400 –
Charlie’s a/c 500
Alice’s a/c 500
Auction Aggregate
Key Bidder Amount
Bicycle Charlie 250
Reserve Bob’s account $300
Bid $300 for Bob
Undo Bob’s reservation
Reserve Alice’s account $350
Bid $350 for Alice
Release $250 for Charlie
Charlie has the current best bid of $250
Bob
$300 Bob bid’s again, this time $300
Alice
$350 Meanwhile Alice arrives and bids $350
300
350
300
350Alice
Sagas are suitable for synchronising between
multiple aggregates in an event sourced application
-
-250
SIMPLE MACHINES SAGAS IN KAFKA
!16
Representing Sagas
A stateful directed acyclic graph (DAG)
a undo
A
b c undo
C
d undo
D
e
a
undo
A
Saga actions
Undo (compensation) actions
SIMPLE MACHINES SAGAS IN KAFKA
!17
Representing Sagas
Auction bid saga
reserve
account
cancel
reservation
bid on auction
cancel
previous
reservation
SIMPLE MACHINES
(Event, Aggregate) => Aggregate
(Command, Aggregate) => Either[Error, List[Event]]
Key => Aggregate
COMMAND HANDLER
EVENT AGGREGATOR
INITIAL VALUE
(_, _) => true
(_, aggregate) => if (aggregate) Error("email taken") else List(EventClaimed)
_ => false
SAGAS IN KAFKA
!18
Useful Patterns
Enforcing uniqueness
Claim Email
Type Example
C Command
claim email address, rejects command if
aggregate is set
A Aggregate either true or false
K Key email address
*Each user must have a unique email
Claim email address:
bob@xyz.com
Create user with email address:
bob@xyz.com
Claim
email
Create
user
release
email
SIMPLE MACHINES SAGAS IN KAFKA
!19
Useful Patterns
Pessimistic lock
Claim lock
Perform action on resource
Release lock
Claim lock Create user
release lock
Create userDo actions Release lock
SIMPLE MACHINES SAGAS IN KAFKA
!20
Saga State a undo
A
b c undo
C
d undo
D
e
Pending
In progress
Completed
Failed
N/A
• Saga state (in progress, in failure)
• Action state (pending, in progress)
• The actions themselves (for dynamic actions)
a undo
A
b c undo
C
d undo
D
e
a undo
A
b c undo
C
d undo
D
e
a undo
A
b c undo
C
d undo
D
e
a undo
A
b c undo
C
d undo
D
e
a undo
A
b c undo
C
d undo
D
e
a undo
A
b c undo
C
d undo
D
e
a undo
A
b c undo
C
d undo
D
e
a undo
A
b c undo
C
d undo
D
e
a undo
A
b c undo
C
d undo
D
e
SIMPLE MACHINES SAGAS IN KAFKA
!21
Saga State a undo
A
b c undo
C
d undo
D
e
Pending
In progress
Completed
Failed
N/A
Failure mode
saga into switches into undo mode
a undo
A
b c undo
C
d undo
D
e
undo
A
b undo
C
undo
D
undo
E
undo
A
b undo
C
undo
D
undo
E
undo
A
b undo
C
undo
D
undo
E
undo
A
b undo
C
undo
D
undo
E
undo
A
b undo
C
undo
D
undo
E
SIMPLE MACHINES SAGAS IN KAFKA
!22
Saga DSL
Scala DSL loosely based on Akka Streams
a
b
c
a ~> b ~> c
SIMPLE MACHINES SAGAS IN KAFKA
!23
Saga DSL
with undo (compensation) actions
a ~> b.withUndo(undoB) ~> c
a
b
c
undo
B
SIMPLE MACHINES SAGAS IN KAFKA
!24
Saga DSL
parallel execution
a undo
A
b c undo
C
d undo
D
e
a.withUndo(undoA) ~> parallel(b, c.withUndo(undoC)) ~> d.withUndo(undoD) ~> e
SIMPLE MACHINES SAGAS IN KAFKA
!25
Saga DSL
These are all equivalent:
(a ~> b ~> c) ~> d ~> e
a ~> (b ~> c ~> d) ~> e
a ~> List(b, c, d).inSeries ~> e
(a ~> b) ~> c ~> (d ~> e)
~> is associative
This enables a building
block approach to
constructing sagas
SIMPLE MACHINES SAGAS IN KAFKA
!26
Simple Sagas
A simple Kafka-based Sagas framework
Saga coordinator
Action processors
Client
SIMPLE MACHINES SAGAS IN KAFKA
!27
Saga Coordinator
Saga request Saga response
Action request Action response
Saga coordinator
{
"sagaId": 12,
"actions": [
{"actionId": 1, "command": "BookFlight(...)"},
{"actionId": 2, "command": "BookCar(...)"}
],
"dependencies": {"2": [1], "4": [2, 3]}
}
{
"sagaId": 12,
"success": true
}
{
"actionId": 1,
"command": "BookFlight(...)"}
}
{
"actionId": 1,
"success": true
}
SIMPLE MACHINES SAGAS IN KAFKA
!28
Saga Coordinator Saga request
Saga(A, B, C, D, E)
Saga state transition
Start(saga=Saga(A, B, C, D, E))
ActionStarted(action=A)
ActionFinished(action=A)
ActionStarted(action=B,C)
ActionFinished(action=C)
Saga state
Saga(A, B, C, D, E)
Saga(A=started, B, C, D, E)
Saga(A=finished, B, C, D, E)
Saga(A=finished, B=started, C=started,..)
Saga(A=finished, B=finished, C=started,..)
Saga
Saga Client
Saga request Saga response
Saga state transition
Aggregate state
Event processor Saga state machine
Action request Action response
Action processor
Saga coordinator
SIMPLE MACHINES SAGAS IN KAFKA
!29
Saga Coordinator Apps
Application main method
SagaApp<SpecificRecord> sagaApp = SagaApp.of(
sagaSpec,
actionSpec,
topicBuilder -> topicBuilder.withTopicPrefix("saga-"));
sagaApp.withActions(
"account_action",
"auction_action",
"payment_action");
sagaApp.run(properties);
SIMPLE MACHINES SAGAS IN KAFKA
!30
Action Processor
{
"sagaId": 1,
"commandId": 34,
"command": "BookFlight(...)",
"actionType": "book_flight"
}
{
"sagaId": 1,
"commandId": 34,
"success": true,
"undo": {
"command": "CancelFlight(...)",
"actionType": "cancel_flight"
}
}
Action request Action response
Action processor
Idempotent effect
Use the built in ones, or roll your own
?
SIMPLE MACHINES SAGAS IN KAFKA
!31
Event Sourcing Action Processor
Action request
Key Value
Saga ID DebitAccount(amount=100)
Saga Coordinator
Command processor Event Aggregator
Action request
Simple Sourcing
Command request
Aggregate state
Event
Action response
Command request
Key Value
Bob’s a/c DebitAccount(amount=100)
Event
Key Value
Bob’s a/c DebitAccount(amount=100)
Aggregate state
Key Value
Bob’s a/c Account(balance=500)
Bob’s a/c DebitAccount(amount=100)
Command response
Key Value
Bob’s a/c DebitAccount(amount=100)
Action response
Key Value
Bob’s a/c DebitAccount(amount=100)
Command response
Event sourcing action
processor
saga-long per-aggregate
consistency guarantee
SIMPLE MACHINES SAGAS IN KAFKA
!32
Async Action Processor
Action request
Key Value
Saga id ThirdPartyPayment(amount=50)
Saga Coordinator
Action request Action response
Async output
Key Value
? Payment(token=XXX)
Action response
Key Value
Saga id Response(success=true,
undoCommand=CancelPayment(X
XX))
Action output
Async action processor
Microservice
{
"success": true,
“booking_reference": “XXX"
}
Callback
Async / http invoke
undo actions can also be
defined dynamically from
web service result
update saga with new
undo action
SIMPLE MACHINES
streamApp
.withActionProcessor(EventSourcingBuilder.apply(
accountCommandSpec,
topicBuilder -> topicBuilder.withTopicPrefix("action-"),
topicBuilder -> topicBuilder.withTopicPrefix("command-")
.withActionProcessor(EventSourcingBuilder.apply(
auctionCommandSpec,
topicBuilder -> topicBuilder.withTopicPrefix("action-"),
topicBuilder -> topicBuilder.withTopicPrefix("command-")
streamApp.run(configProperties);
SAGAS IN KAFKA
!33
Action Processor Apps
EventSourcingSpec<SpecificRecord, AccountCommand, AccountId, AccountCommand> accountCommandSpec =
EventSourcingSpec.builder()
.actionType("account_action")
.aggregateName("account")
.decode(a -> Result.success((AccountCommand) a))
.commandMapper(c -> c)
.keyMapper(AccountCommand::getId)
.sequenceMapper(c -> Sequence.position(c.getSequence()))
.timeout(Duration.ofSeconds(30))
.build();
Application main method
EventSourcingSpec<SpecificRecord, AuctionCommand, AuctionId, AuctionCommand> auctionCommandSpec = ...;
SIMPLE MACHINES SAGAS IN KAFKA
!34
Saga Client
public interface SagaAPI<A> {
FutureResult<SagaError, SagaId> submitSaga(SagaRequest<A> request);
FutureResult<SagaError, SagaResponse> getSagaResponse(
SagaId requestId,
Duration timeout);
}
submitSaga
Saga request
Saga response
Saga Coordinator
getSagaResponse
Consumer
Private response topic
COMPLETES FUTURE
client is typically another service,
such as a web application
SIMPLE MACHINES SAGAS IN KAFKA
!35
Deployment
Single node
Application Instance
Saga coordinator
Action processor 1
Action processor 2
Kafka broker
Kafka broker
SIMPLE MACHINES SAGAS IN KAFKA
!36
Deployment
Application Instance 1
Separate sagas and actions
Application Instance 2
Kafka broker
Kafka broker
Microservice
Saga coordinator
Action processor 1 (event sourcing)
Action processor 2 (event sourcing)
Action processor 3 (async)
SIMPLE MACHINES
Action processors
SAGAS IN KAFKA
!37
Deployment
Saga coordinators
Kafka brokers
Resilient cluster setup
application instance failureapplication instance recovery
Kafka broker failureKafka broker recovery
SIMPLE MACHINES SAGAS IN KAFKA
!38
Saga coordinators
Kafka brokers
Event Sourcing
Hybrid Architectures
Async / Http
Simple Sourcing Other microservices
SIMPLE MACHINES
Questions…
SAGAS IN KAFKA !39
https://simplesource.io/

Weitere ähnliche Inhalte

Was ist angesagt?

Kafka Tutorial: Kafka Security
Kafka Tutorial: Kafka SecurityKafka Tutorial: Kafka Security
Kafka Tutorial: Kafka SecurityJean-Paul Azar
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013mumrah
 
A visual introduction to Apache Kafka
A visual introduction to Apache KafkaA visual introduction to Apache Kafka
A visual introduction to Apache KafkaPaul Brebner
 
Deploying Confluent Platform for Production
Deploying Confluent Platform for ProductionDeploying Confluent Platform for Production
Deploying Confluent Platform for Productionconfluent
 
Apache Kafka® Security Overview
Apache Kafka® Security OverviewApache Kafka® Security Overview
Apache Kafka® Security Overviewconfluent
 
From Message to Cluster: A Realworld Introduction to Kafka Capacity Planning
From Message to Cluster: A Realworld Introduction to Kafka Capacity PlanningFrom Message to Cluster: A Realworld Introduction to Kafka Capacity Planning
From Message to Cluster: A Realworld Introduction to Kafka Capacity Planningconfluent
 
Apache kafka performance(latency)_benchmark_v0.3
Apache kafka performance(latency)_benchmark_v0.3Apache kafka performance(latency)_benchmark_v0.3
Apache kafka performance(latency)_benchmark_v0.3SANG WON PARK
 
Webinar: Deep Dive on Apache Flink State - Seth Wiesman
Webinar: Deep Dive on Apache Flink State - Seth WiesmanWebinar: Deep Dive on Apache Flink State - Seth Wiesman
Webinar: Deep Dive on Apache Flink State - Seth WiesmanVerverica
 
Saga about distributed business transactions in microservices world
Saga about distributed business transactions in microservices worldSaga about distributed business transactions in microservices world
Saga about distributed business transactions in microservices worldMikalai Alimenkou
 
Saga pattern and event sourcing with kafka
Saga pattern and event sourcing with kafkaSaga pattern and event sourcing with kafka
Saga pattern and event sourcing with kafkaRoan Brasil Monteiro
 
Intro ProxySQL
Intro ProxySQLIntro ProxySQL
Intro ProxySQLI Goo Lee
 
Almost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
Almost Perfect Service Discovery and Failover with ProxySQL and OrchestratorAlmost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
Almost Perfect Service Discovery and Failover with ProxySQL and OrchestratorJean-François Gagné
 
Understanding PostgreSQL LW Locks
Understanding PostgreSQL LW LocksUnderstanding PostgreSQL LW Locks
Understanding PostgreSQL LW LocksJignesh Shah
 
Tuning Apache Kafka Connectors for Flink.pptx
Tuning Apache Kafka Connectors for Flink.pptxTuning Apache Kafka Connectors for Flink.pptx
Tuning Apache Kafka Connectors for Flink.pptxFlink Forward
 
Consumer offset management in Kafka
Consumer offset management in KafkaConsumer offset management in Kafka
Consumer offset management in KafkaJoel Koshy
 
SpringBoot 3 Observability
SpringBoot 3 ObservabilitySpringBoot 3 Observability
SpringBoot 3 ObservabilityKnoldus Inc.
 
Apache Kafka Architecture & Fundamentals Explained
Apache Kafka Architecture & Fundamentals ExplainedApache Kafka Architecture & Fundamentals Explained
Apache Kafka Architecture & Fundamentals Explainedconfluent
 
Resilience testing with Wiremock and Spock
Resilience testing with Wiremock and SpockResilience testing with Wiremock and Spock
Resilience testing with Wiremock and SpockDavid Schmitz
 
Why My Streaming Job is Slow - Profiling and Optimizing Kafka Streams Apps (L...
Why My Streaming Job is Slow - Profiling and Optimizing Kafka Streams Apps (L...Why My Streaming Job is Slow - Profiling and Optimizing Kafka Streams Apps (L...
Why My Streaming Job is Slow - Profiling and Optimizing Kafka Streams Apps (L...confluent
 
ELK in Security Analytics
ELK in Security Analytics ELK in Security Analytics
ELK in Security Analytics nullowaspmumbai
 

Was ist angesagt? (20)

Kafka Tutorial: Kafka Security
Kafka Tutorial: Kafka SecurityKafka Tutorial: Kafka Security
Kafka Tutorial: Kafka Security
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
 
A visual introduction to Apache Kafka
A visual introduction to Apache KafkaA visual introduction to Apache Kafka
A visual introduction to Apache Kafka
 
Deploying Confluent Platform for Production
Deploying Confluent Platform for ProductionDeploying Confluent Platform for Production
Deploying Confluent Platform for Production
 
Apache Kafka® Security Overview
Apache Kafka® Security OverviewApache Kafka® Security Overview
Apache Kafka® Security Overview
 
From Message to Cluster: A Realworld Introduction to Kafka Capacity Planning
From Message to Cluster: A Realworld Introduction to Kafka Capacity PlanningFrom Message to Cluster: A Realworld Introduction to Kafka Capacity Planning
From Message to Cluster: A Realworld Introduction to Kafka Capacity Planning
 
Apache kafka performance(latency)_benchmark_v0.3
Apache kafka performance(latency)_benchmark_v0.3Apache kafka performance(latency)_benchmark_v0.3
Apache kafka performance(latency)_benchmark_v0.3
 
Webinar: Deep Dive on Apache Flink State - Seth Wiesman
Webinar: Deep Dive on Apache Flink State - Seth WiesmanWebinar: Deep Dive on Apache Flink State - Seth Wiesman
Webinar: Deep Dive on Apache Flink State - Seth Wiesman
 
Saga about distributed business transactions in microservices world
Saga about distributed business transactions in microservices worldSaga about distributed business transactions in microservices world
Saga about distributed business transactions in microservices world
 
Saga pattern and event sourcing with kafka
Saga pattern and event sourcing with kafkaSaga pattern and event sourcing with kafka
Saga pattern and event sourcing with kafka
 
Intro ProxySQL
Intro ProxySQLIntro ProxySQL
Intro ProxySQL
 
Almost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
Almost Perfect Service Discovery and Failover with ProxySQL and OrchestratorAlmost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
Almost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
 
Understanding PostgreSQL LW Locks
Understanding PostgreSQL LW LocksUnderstanding PostgreSQL LW Locks
Understanding PostgreSQL LW Locks
 
Tuning Apache Kafka Connectors for Flink.pptx
Tuning Apache Kafka Connectors for Flink.pptxTuning Apache Kafka Connectors for Flink.pptx
Tuning Apache Kafka Connectors for Flink.pptx
 
Consumer offset management in Kafka
Consumer offset management in KafkaConsumer offset management in Kafka
Consumer offset management in Kafka
 
SpringBoot 3 Observability
SpringBoot 3 ObservabilitySpringBoot 3 Observability
SpringBoot 3 Observability
 
Apache Kafka Architecture & Fundamentals Explained
Apache Kafka Architecture & Fundamentals ExplainedApache Kafka Architecture & Fundamentals Explained
Apache Kafka Architecture & Fundamentals Explained
 
Resilience testing with Wiremock and Spock
Resilience testing with Wiremock and SpockResilience testing with Wiremock and Spock
Resilience testing with Wiremock and Spock
 
Why My Streaming Job is Slow - Profiling and Optimizing Kafka Streams Apps (L...
Why My Streaming Job is Slow - Profiling and Optimizing Kafka Streams Apps (L...Why My Streaming Job is Slow - Profiling and Optimizing Kafka Streams Apps (L...
Why My Streaming Job is Slow - Profiling and Optimizing Kafka Streams Apps (L...
 
ELK in Security Analytics
ELK in Security Analytics ELK in Security Analytics
ELK in Security Analytics
 

Ähnlich wie Simplifying Distributed Transactions with Sagas in Kafka (Stephen Zoio, Simple Machines) Kafka Summit London 2019

Socket applications
Socket applicationsSocket applications
Socket applicationsJoão Moura
 
#u-wardley-mapping Wardley Maps: practical session - 2 hour
#u-wardley-mapping Wardley Maps: practical session - 2 hour#u-wardley-mapping Wardley Maps: practical session - 2 hour
#u-wardley-mapping Wardley Maps: practical session - 2 hourOpen Security Summit
 
OSDC 2019 | The Benefits of Orchestration in Distributed Systems by Niall Deehan
OSDC 2019 | The Benefits of Orchestration in Distributed Systems by Niall DeehanOSDC 2019 | The Benefits of Orchestration in Distributed Systems by Niall Deehan
OSDC 2019 | The Benefits of Orchestration in Distributed Systems by Niall DeehanNETWAYS
 
A dive into akka streams: from the basics to a real-world scenario
A dive into akka streams: from the basics to a real-world scenarioA dive into akka streams: from the basics to a real-world scenario
A dive into akka streams: from the basics to a real-world scenarioGioia Ballin
 
Creating Custom Actions in SharePoint 2010
Creating Custom Actions in SharePoint 2010Creating Custom Actions in SharePoint 2010
Creating Custom Actions in SharePoint 2010Geoff Varosky
 
Geoff Varosky: Creating Custom Actions in SharePoint 2010
Geoff Varosky: Creating Custom Actions in SharePoint 2010Geoff Varosky: Creating Custom Actions in SharePoint 2010
Geoff Varosky: Creating Custom Actions in SharePoint 2010SharePoint Saturday NY
 
RH_QCon_Preso_v3_compressed.pptx
RH_QCon_Preso_v3_compressed.pptxRH_QCon_Preso_v3_compressed.pptx
RH_QCon_Preso_v3_compressed.pptxChris Stetson
 
Abusing the Cloud for Fun and Profit
Abusing the Cloud for Fun and ProfitAbusing the Cloud for Fun and Profit
Abusing the Cloud for Fun and ProfitAlan Pinstein
 
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento webA reviravolta do desenvolvimento web
A reviravolta do desenvolvimento webWallace Reis
 
SAP Workflow Po create workflow by pavan golesar
SAP Workflow Po create workflow by pavan golesarSAP Workflow Po create workflow by pavan golesar
SAP Workflow Po create workflow by pavan golesarPavan Golesar
 
JCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problemsJCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problemsBernd Ruecker
 
Kafka Summit SF 2017 - Riot's Journey to Global Kafka Aggregation
Kafka Summit SF 2017 - Riot's Journey to Global Kafka AggregationKafka Summit SF 2017 - Riot's Journey to Global Kafka Aggregation
Kafka Summit SF 2017 - Riot's Journey to Global Kafka Aggregationconfluent
 
Case study: Carleton University – managing 600+ single installs
Case study: Carleton University – managing 600+ single installsCase study: Carleton University – managing 600+ single installs
Case study: Carleton University – managing 600+ single installsMichael Corkum
 
Heroku 101 py con 2015 - David Gouldin
Heroku 101   py con 2015 - David GouldinHeroku 101   py con 2015 - David Gouldin
Heroku 101 py con 2015 - David GouldinHeroku
 
Deliver Business Value Faster with AWS Step Functions
Deliver Business Value Faster with AWS Step FunctionsDeliver Business Value Faster with AWS Step Functions
Deliver Business Value Faster with AWS Step FunctionsDaniel Zivkovic
 
Why Agile Works But Isn't Working For You
Why Agile Works But Isn't Working For YouWhy Agile Works But Isn't Working For You
Why Agile Works But Isn't Working For YouDavid Harvey
 
Microservies Vienna - Lost in transactions
Microservies Vienna - Lost in transactionsMicroservies Vienna - Lost in transactions
Microservies Vienna - Lost in transactionsNiallDeehan
 
Patterns and practices for building resilient serverless applications
Patterns and practices for building resilient serverless applicationsPatterns and practices for building resilient serverless applications
Patterns and practices for building resilient serverless applicationsYan Cui
 
Patterns and Practices for Building Resilient Serverless Applications
Patterns and Practices for Building Resilient Serverless ApplicationsPatterns and Practices for Building Resilient Serverless Applications
Patterns and Practices for Building Resilient Serverless ApplicationsYan Cui
 
Essential ingredients for real time stream processing @Scale by Kartik pParam...
Essential ingredients for real time stream processing @Scale by Kartik pParam...Essential ingredients for real time stream processing @Scale by Kartik pParam...
Essential ingredients for real time stream processing @Scale by Kartik pParam...Big Data Spain
 

Ähnlich wie Simplifying Distributed Transactions with Sagas in Kafka (Stephen Zoio, Simple Machines) Kafka Summit London 2019 (20)

Socket applications
Socket applicationsSocket applications
Socket applications
 
#u-wardley-mapping Wardley Maps: practical session - 2 hour
#u-wardley-mapping Wardley Maps: practical session - 2 hour#u-wardley-mapping Wardley Maps: practical session - 2 hour
#u-wardley-mapping Wardley Maps: practical session - 2 hour
 
OSDC 2019 | The Benefits of Orchestration in Distributed Systems by Niall Deehan
OSDC 2019 | The Benefits of Orchestration in Distributed Systems by Niall DeehanOSDC 2019 | The Benefits of Orchestration in Distributed Systems by Niall Deehan
OSDC 2019 | The Benefits of Orchestration in Distributed Systems by Niall Deehan
 
A dive into akka streams: from the basics to a real-world scenario
A dive into akka streams: from the basics to a real-world scenarioA dive into akka streams: from the basics to a real-world scenario
A dive into akka streams: from the basics to a real-world scenario
 
Creating Custom Actions in SharePoint 2010
Creating Custom Actions in SharePoint 2010Creating Custom Actions in SharePoint 2010
Creating Custom Actions in SharePoint 2010
 
Geoff Varosky: Creating Custom Actions in SharePoint 2010
Geoff Varosky: Creating Custom Actions in SharePoint 2010Geoff Varosky: Creating Custom Actions in SharePoint 2010
Geoff Varosky: Creating Custom Actions in SharePoint 2010
 
RH_QCon_Preso_v3_compressed.pptx
RH_QCon_Preso_v3_compressed.pptxRH_QCon_Preso_v3_compressed.pptx
RH_QCon_Preso_v3_compressed.pptx
 
Abusing the Cloud for Fun and Profit
Abusing the Cloud for Fun and ProfitAbusing the Cloud for Fun and Profit
Abusing the Cloud for Fun and Profit
 
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento webA reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
 
SAP Workflow Po create workflow by pavan golesar
SAP Workflow Po create workflow by pavan golesarSAP Workflow Po create workflow by pavan golesar
SAP Workflow Po create workflow by pavan golesar
 
JCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problemsJCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problems
 
Kafka Summit SF 2017 - Riot's Journey to Global Kafka Aggregation
Kafka Summit SF 2017 - Riot's Journey to Global Kafka AggregationKafka Summit SF 2017 - Riot's Journey to Global Kafka Aggregation
Kafka Summit SF 2017 - Riot's Journey to Global Kafka Aggregation
 
Case study: Carleton University – managing 600+ single installs
Case study: Carleton University – managing 600+ single installsCase study: Carleton University – managing 600+ single installs
Case study: Carleton University – managing 600+ single installs
 
Heroku 101 py con 2015 - David Gouldin
Heroku 101   py con 2015 - David GouldinHeroku 101   py con 2015 - David Gouldin
Heroku 101 py con 2015 - David Gouldin
 
Deliver Business Value Faster with AWS Step Functions
Deliver Business Value Faster with AWS Step FunctionsDeliver Business Value Faster with AWS Step Functions
Deliver Business Value Faster with AWS Step Functions
 
Why Agile Works But Isn't Working For You
Why Agile Works But Isn't Working For YouWhy Agile Works But Isn't Working For You
Why Agile Works But Isn't Working For You
 
Microservies Vienna - Lost in transactions
Microservies Vienna - Lost in transactionsMicroservies Vienna - Lost in transactions
Microservies Vienna - Lost in transactions
 
Patterns and practices for building resilient serverless applications
Patterns and practices for building resilient serverless applicationsPatterns and practices for building resilient serverless applications
Patterns and practices for building resilient serverless applications
 
Patterns and Practices for Building Resilient Serverless Applications
Patterns and Practices for Building Resilient Serverless ApplicationsPatterns and Practices for Building Resilient Serverless Applications
Patterns and Practices for Building Resilient Serverless Applications
 
Essential ingredients for real time stream processing @Scale by Kartik pParam...
Essential ingredients for real time stream processing @Scale by Kartik pParam...Essential ingredients for real time stream processing @Scale by Kartik pParam...
Essential ingredients for real time stream processing @Scale by Kartik pParam...
 

Mehr von confluent

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

Mehr von confluent (20)

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

Kürzlich hochgeladen

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 

Kürzlich hochgeladen (20)

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 

Simplifying Distributed Transactions with Sagas in Kafka (Stephen Zoio, Simple Machines) Kafka Summit London 2019

  • 1. SIMPLE MACHINES Sagas in Kafka SAGAS IN KAFKA !1 Stephen Zoio — Principal Consultant
  • 2. SIMPLE MACHINES SAGAS IN KAFKA !2 Journey to Sagas Coordinating microservices Sagas Kafka as a database Events A protocol for distributed and long running transactions
  • 3. SIMPLE MACHINES SAGAS IN KAFKA !3 Microservice Transactions www. Flight Booking Hotel Booking Car Rental Payment Trips ?
  • 4. SIMPLE MACHINES SAGAS IN KAFKA !4 Two Phase Commit www. Flight Booking Hotel Booking Car Rental Payment Trips Prepare Response Confirm Acknowledgement • Too strict • Too slow • Too complex Not that popular in practice…
  • 5. SIMPLE MACHINES SAGAS IN KAFKA !5 Saga Transaction www. Flight Booking Hotel Booking Car Rental Payment Trips Action Success Response • Much simpler protocol • Minimises latency and comms • Services don’t need to care about sagas
  • 6. SIMPLE MACHINES SAGAS IN KAFKA !6 Saga Failure www. Flight Booking Hotel Booking Car Rental Payment Trips Action Success Response Compensation Failure work backwards, executing compensating actions Compensation Response
  • 7. SIMPLE MACHINES SAGAS IN KAFKA !7 Saga Data Consistency SQL Database A Atomicity C Consistency I Isolation D Durability Sagas A Atomicity C Consistency I Isolation D Durability We give up isolation, but we can live without it…
  • 8. SIMPLE MACHINES SAGAS IN KAFKA !8 Kafka and Event Sourcing Kafka as a database? Event sourcing Event processingKafka Events WHY NOT STORE THE DATA LIKE WE USE IT? WE’RE ALREADY USING KAFKA FOR MESSAGING
  • 9. SIMPLE MACHINES SAGAS IN KAFKA !9 Event Log Consistency e.g. Bank Account Events Simple Sourcing • Balance always positive • Account never debited twice Taking advantage of • Kafka exactly once processing • Per topic-partition ordering guarantee
  • 10. An API to support these consistency requirements
  • 11. SIMPLE MACHINES SAGAS IN KAFKA !11 Simple Sourcing Concepts Type Represents Example C Command Intent debit Bob’s account $100 E Event Outcome Bob’s account debited $100 A Aggregate State Bob’s account balance=$700, available=$650 K Key Identity Bob’s account number Based on CQRS (Command query responsibility segregation)
  • 12. SIMPLE MACHINES SAGAS IN KAFKA !12 Simple Sourcing Data Flow Kafka Command request Aggregate state Command response Event Bob’s balance >$100? Debit Bob’s account $100 Return Success Publish event AccountDebited(bob, 100) Return error response Debit Bob’s account $100 Yes No Everything happens in a single atomic transaction
  • 13. SIMPLE MACHINES SAGAS IN KAFKA !13 Simple Sourcing Programming Model In Scala types (Command, Aggregate) => Either[Error, List[Event]] (Event, Aggregate) => Aggregate Key => Aggregate COMMAND HANDLER EVENT AGGREGATOR INITIAL VALUE
  • 14. SIMPLE MACHINES SAGAS IN KAFKA !14 Event Sourced Apps Coordinating between aggregates: Bike auction scenario Account Aggregate Key Total Reserved Bob’s a/c 400 200 Charlie’s a/c 500 – Auction Aggregate Key Bidder Amount Bicycle Bob 200 Reserve Charlie’s account $250 Bid $250 for Charlie Release $200 for Bob $200 Current bid: Bob $200 Bob $250 Next bid: Charlie $250 Charlie 250 Auction Aggregate Key Bidder Amount Bicycle Charlie 250 –
  • 15. SIMPLE MACHINES SAGAS IN KAFKA !15 Auction App Coordinating between aggregates Charlie $250 Account Aggregate Key Total Reserved Bob’s a/c 400 – Charlie’s a/c 500 Alice’s a/c 500 Auction Aggregate Key Bidder Amount Bicycle Charlie 250 Reserve Bob’s account $300 Bid $300 for Bob Undo Bob’s reservation Reserve Alice’s account $350 Bid $350 for Alice Release $250 for Charlie Charlie has the current best bid of $250 Bob $300 Bob bid’s again, this time $300 Alice $350 Meanwhile Alice arrives and bids $350 300 350 300 350Alice Sagas are suitable for synchronising between multiple aggregates in an event sourced application - -250
  • 16. SIMPLE MACHINES SAGAS IN KAFKA !16 Representing Sagas A stateful directed acyclic graph (DAG) a undo A b c undo C d undo D e a undo A Saga actions Undo (compensation) actions
  • 17. SIMPLE MACHINES SAGAS IN KAFKA !17 Representing Sagas Auction bid saga reserve account cancel reservation bid on auction cancel previous reservation
  • 18. SIMPLE MACHINES (Event, Aggregate) => Aggregate (Command, Aggregate) => Either[Error, List[Event]] Key => Aggregate COMMAND HANDLER EVENT AGGREGATOR INITIAL VALUE (_, _) => true (_, aggregate) => if (aggregate) Error("email taken") else List(EventClaimed) _ => false SAGAS IN KAFKA !18 Useful Patterns Enforcing uniqueness Claim Email Type Example C Command claim email address, rejects command if aggregate is set A Aggregate either true or false K Key email address *Each user must have a unique email Claim email address: bob@xyz.com Create user with email address: bob@xyz.com Claim email Create user release email
  • 19. SIMPLE MACHINES SAGAS IN KAFKA !19 Useful Patterns Pessimistic lock Claim lock Perform action on resource Release lock Claim lock Create user release lock Create userDo actions Release lock
  • 20. SIMPLE MACHINES SAGAS IN KAFKA !20 Saga State a undo A b c undo C d undo D e Pending In progress Completed Failed N/A • Saga state (in progress, in failure) • Action state (pending, in progress) • The actions themselves (for dynamic actions) a undo A b c undo C d undo D e a undo A b c undo C d undo D e a undo A b c undo C d undo D e a undo A b c undo C d undo D e a undo A b c undo C d undo D e a undo A b c undo C d undo D e a undo A b c undo C d undo D e a undo A b c undo C d undo D e a undo A b c undo C d undo D e
  • 21. SIMPLE MACHINES SAGAS IN KAFKA !21 Saga State a undo A b c undo C d undo D e Pending In progress Completed Failed N/A Failure mode saga into switches into undo mode a undo A b c undo C d undo D e undo A b undo C undo D undo E undo A b undo C undo D undo E undo A b undo C undo D undo E undo A b undo C undo D undo E undo A b undo C undo D undo E
  • 22. SIMPLE MACHINES SAGAS IN KAFKA !22 Saga DSL Scala DSL loosely based on Akka Streams a b c a ~> b ~> c
  • 23. SIMPLE MACHINES SAGAS IN KAFKA !23 Saga DSL with undo (compensation) actions a ~> b.withUndo(undoB) ~> c a b c undo B
  • 24. SIMPLE MACHINES SAGAS IN KAFKA !24 Saga DSL parallel execution a undo A b c undo C d undo D e a.withUndo(undoA) ~> parallel(b, c.withUndo(undoC)) ~> d.withUndo(undoD) ~> e
  • 25. SIMPLE MACHINES SAGAS IN KAFKA !25 Saga DSL These are all equivalent: (a ~> b ~> c) ~> d ~> e a ~> (b ~> c ~> d) ~> e a ~> List(b, c, d).inSeries ~> e (a ~> b) ~> c ~> (d ~> e) ~> is associative This enables a building block approach to constructing sagas
  • 26. SIMPLE MACHINES SAGAS IN KAFKA !26 Simple Sagas A simple Kafka-based Sagas framework Saga coordinator Action processors Client
  • 27. SIMPLE MACHINES SAGAS IN KAFKA !27 Saga Coordinator Saga request Saga response Action request Action response Saga coordinator { "sagaId": 12, "actions": [ {"actionId": 1, "command": "BookFlight(...)"}, {"actionId": 2, "command": "BookCar(...)"} ], "dependencies": {"2": [1], "4": [2, 3]} } { "sagaId": 12, "success": true } { "actionId": 1, "command": "BookFlight(...)"} } { "actionId": 1, "success": true }
  • 28. SIMPLE MACHINES SAGAS IN KAFKA !28 Saga Coordinator Saga request Saga(A, B, C, D, E) Saga state transition Start(saga=Saga(A, B, C, D, E)) ActionStarted(action=A) ActionFinished(action=A) ActionStarted(action=B,C) ActionFinished(action=C) Saga state Saga(A, B, C, D, E) Saga(A=started, B, C, D, E) Saga(A=finished, B, C, D, E) Saga(A=finished, B=started, C=started,..) Saga(A=finished, B=finished, C=started,..) Saga Saga Client Saga request Saga response Saga state transition Aggregate state Event processor Saga state machine Action request Action response Action processor Saga coordinator
  • 29. SIMPLE MACHINES SAGAS IN KAFKA !29 Saga Coordinator Apps Application main method SagaApp<SpecificRecord> sagaApp = SagaApp.of( sagaSpec, actionSpec, topicBuilder -> topicBuilder.withTopicPrefix("saga-")); sagaApp.withActions( "account_action", "auction_action", "payment_action"); sagaApp.run(properties);
  • 30. SIMPLE MACHINES SAGAS IN KAFKA !30 Action Processor { "sagaId": 1, "commandId": 34, "command": "BookFlight(...)", "actionType": "book_flight" } { "sagaId": 1, "commandId": 34, "success": true, "undo": { "command": "CancelFlight(...)", "actionType": "cancel_flight" } } Action request Action response Action processor Idempotent effect Use the built in ones, or roll your own ?
  • 31. SIMPLE MACHINES SAGAS IN KAFKA !31 Event Sourcing Action Processor Action request Key Value Saga ID DebitAccount(amount=100) Saga Coordinator Command processor Event Aggregator Action request Simple Sourcing Command request Aggregate state Event Action response Command request Key Value Bob’s a/c DebitAccount(amount=100) Event Key Value Bob’s a/c DebitAccount(amount=100) Aggregate state Key Value Bob’s a/c Account(balance=500) Bob’s a/c DebitAccount(amount=100) Command response Key Value Bob’s a/c DebitAccount(amount=100) Action response Key Value Bob’s a/c DebitAccount(amount=100) Command response Event sourcing action processor saga-long per-aggregate consistency guarantee
  • 32. SIMPLE MACHINES SAGAS IN KAFKA !32 Async Action Processor Action request Key Value Saga id ThirdPartyPayment(amount=50) Saga Coordinator Action request Action response Async output Key Value ? Payment(token=XXX) Action response Key Value Saga id Response(success=true, undoCommand=CancelPayment(X XX)) Action output Async action processor Microservice { "success": true, “booking_reference": “XXX" } Callback Async / http invoke undo actions can also be defined dynamically from web service result update saga with new undo action
  • 33. SIMPLE MACHINES streamApp .withActionProcessor(EventSourcingBuilder.apply( accountCommandSpec, topicBuilder -> topicBuilder.withTopicPrefix("action-"), topicBuilder -> topicBuilder.withTopicPrefix("command-") .withActionProcessor(EventSourcingBuilder.apply( auctionCommandSpec, topicBuilder -> topicBuilder.withTopicPrefix("action-"), topicBuilder -> topicBuilder.withTopicPrefix("command-") streamApp.run(configProperties); SAGAS IN KAFKA !33 Action Processor Apps EventSourcingSpec<SpecificRecord, AccountCommand, AccountId, AccountCommand> accountCommandSpec = EventSourcingSpec.builder() .actionType("account_action") .aggregateName("account") .decode(a -> Result.success((AccountCommand) a)) .commandMapper(c -> c) .keyMapper(AccountCommand::getId) .sequenceMapper(c -> Sequence.position(c.getSequence())) .timeout(Duration.ofSeconds(30)) .build(); Application main method EventSourcingSpec<SpecificRecord, AuctionCommand, AuctionId, AuctionCommand> auctionCommandSpec = ...;
  • 34. SIMPLE MACHINES SAGAS IN KAFKA !34 Saga Client public interface SagaAPI<A> { FutureResult<SagaError, SagaId> submitSaga(SagaRequest<A> request); FutureResult<SagaError, SagaResponse> getSagaResponse( SagaId requestId, Duration timeout); } submitSaga Saga request Saga response Saga Coordinator getSagaResponse Consumer Private response topic COMPLETES FUTURE client is typically another service, such as a web application
  • 35. SIMPLE MACHINES SAGAS IN KAFKA !35 Deployment Single node Application Instance Saga coordinator Action processor 1 Action processor 2 Kafka broker Kafka broker
  • 36. SIMPLE MACHINES SAGAS IN KAFKA !36 Deployment Application Instance 1 Separate sagas and actions Application Instance 2 Kafka broker Kafka broker Microservice Saga coordinator Action processor 1 (event sourcing) Action processor 2 (event sourcing) Action processor 3 (async)
  • 37. SIMPLE MACHINES Action processors SAGAS IN KAFKA !37 Deployment Saga coordinators Kafka brokers Resilient cluster setup application instance failureapplication instance recovery Kafka broker failureKafka broker recovery
  • 38. SIMPLE MACHINES SAGAS IN KAFKA !38 Saga coordinators Kafka brokers Event Sourcing Hybrid Architectures Async / Http Simple Sourcing Other microservices
  • 39. SIMPLE MACHINES Questions… SAGAS IN KAFKA !39 https://simplesource.io/