SlideShare uma empresa Scribd logo
1 de 39
Baixar para ler offline
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/

Mais conteúdo relacionado

Mais procurados

Apache Kafka® and API Management
Apache Kafka® and API ManagementApache Kafka® and API Management
Apache Kafka® and API Managementconfluent
 
CQRS and Event Sourcing, An Alternative Architecture for DDD
CQRS and Event Sourcing, An Alternative Architecture for DDDCQRS and Event Sourcing, An Alternative Architecture for DDD
CQRS and Event Sourcing, An Alternative Architecture for DDDDennis Doomen
 
Stream processing using Kafka
Stream processing using KafkaStream processing using Kafka
Stream processing using KafkaKnoldus Inc.
 
Kafka Streams for Java enthusiasts
Kafka Streams for Java enthusiastsKafka Streams for Java enthusiasts
Kafka Streams for Java enthusiastsSlim Baltagi
 
A Deep Dive into Kafka Controller
A Deep Dive into Kafka ControllerA Deep Dive into Kafka Controller
A Deep Dive into Kafka Controllerconfluent
 
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
 
Distributed tracing using open tracing &amp; jaeger 2
Distributed tracing using open tracing &amp; jaeger 2Distributed tracing using open tracing &amp; jaeger 2
Distributed tracing using open tracing &amp; jaeger 2Chandresh Pancholi
 
Building secure applications with keycloak
Building secure applications with keycloak Building secure applications with keycloak
Building secure applications with keycloak Abhishek Koserwal
 
Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...
Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...
Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...confluent
 
CQRS + Event Sourcing
CQRS + Event SourcingCQRS + Event Sourcing
CQRS + Event SourcingMike Bild
 
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
 
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드confluent
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to RedisDvir Volk
 
Apache Flink in the Cloud-Native Era
Apache Flink in the Cloud-Native EraApache Flink in the Cloud-Native Era
Apache Flink in the Cloud-Native EraFlink Forward
 
Kafka Tutorial: Kafka Security
Kafka Tutorial: Kafka SecurityKafka Tutorial: Kafka Security
Kafka Tutorial: Kafka SecurityJean-Paul Azar
 
Making Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta LakeMaking Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta LakeDatabricks
 
How to Lock Down Apache Kafka and Keep Your Streams Safe
How to Lock Down Apache Kafka and Keep Your Streams SafeHow to Lock Down Apache Kafka and Keep Your Streams Safe
How to Lock Down Apache Kafka and Keep Your Streams Safeconfluent
 
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMwareEvent Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMwareHostedbyConfluent
 

Mais procurados (20)

Apache Kafka® and API Management
Apache Kafka® and API ManagementApache Kafka® and API Management
Apache Kafka® and API Management
 
CQRS and Event Sourcing, An Alternative Architecture for DDD
CQRS and Event Sourcing, An Alternative Architecture for DDDCQRS and Event Sourcing, An Alternative Architecture for DDD
CQRS and Event Sourcing, An Alternative Architecture for DDD
 
Stream processing using Kafka
Stream processing using KafkaStream processing using Kafka
Stream processing using Kafka
 
Kafka Streams for Java enthusiasts
Kafka Streams for Java enthusiastsKafka Streams for Java enthusiasts
Kafka Streams for Java enthusiasts
 
A Deep Dive into Kafka Controller
A Deep Dive into Kafka ControllerA Deep Dive into Kafka Controller
A Deep Dive into Kafka Controller
 
ELK Stack
ELK StackELK Stack
ELK Stack
 
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
 
Distributed tracing using open tracing &amp; jaeger 2
Distributed tracing using open tracing &amp; jaeger 2Distributed tracing using open tracing &amp; jaeger 2
Distributed tracing using open tracing &amp; jaeger 2
 
Building secure applications with keycloak
Building secure applications with keycloak Building secure applications with keycloak
Building secure applications with keycloak
 
Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...
Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...
Kafka Cluster Federation at Uber (Yupeng Fui & Xiaoman Dong, Uber) Kafka Summ...
 
CQRS + Event Sourcing
CQRS + Event SourcingCQRS + Event Sourcing
CQRS + Event Sourcing
 
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
 
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
Apache Flink in the Cloud-Native Era
Apache Flink in the Cloud-Native EraApache Flink in the Cloud-Native Era
Apache Flink in the Cloud-Native Era
 
Kafka Tutorial: Kafka Security
Kafka Tutorial: Kafka SecurityKafka Tutorial: Kafka Security
Kafka Tutorial: Kafka Security
 
Making Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta LakeMaking Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta Lake
 
How to Lock Down Apache Kafka and Keep Your Streams Safe
How to Lock Down Apache Kafka and Keep Your Streams SafeHow to Lock Down Apache Kafka and Keep Your Streams Safe
How to Lock Down Apache Kafka and Keep Your Streams Safe
 
Introducing Akka
Introducing AkkaIntroducing Akka
Introducing Akka
 
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMwareEvent Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
 

Semelhante a 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
 

Semelhante a 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...
 

Mais de 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
 

Mais de confluent (20)

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

Último

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Último (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

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/