Questions tagged [saga]

A pattern that enables a service bus to deal with long-running processes, fault tolerance and scalability.

Long-running business processes exist in many systems. Whether the steps are automated, manual, or a combination, effective handling of these processes is critical.

NServiceBus employs event-driven architectural principles to bake fault-tolerance and scalability into these processes.

The Saga is a pattern that addresses these challenges uncovered by the relational database community years ago, packaged in NServiceBus for ease of use by developers.

MassTransit supports sagas, and Automatonymous is a saga implementation built on top of MassTransit.

497 questions
68
votes
3 answers

2PC vs Sagas (distributed transactions)

I'm developing my insight about distributed systems, and how to maintain data consistency across such systems, where business transactions covers multiple services, bounded contexts and network boundaries. Here are two approaches which I know are…
Tuomas Toivonen
  • 21,690
  • 47
  • 129
  • 225
45
votes
3 answers

How to implement a saga using a scatter/Gather pattern In MassTransit 3.0

Jimmy Boagard describes a McDonalds fast food chain here comparing it to a scatter gather pattern. Workflow image stolen from above article: Initial Implementation Thoughts: To have a common interface for all of the types of FoodOrdered events…
Ashtonian
  • 4,371
  • 2
  • 18
  • 25
21
votes
3 answers

CQRS sagas - did I understand them right?

I'm trying to understand sagas, and meanwhile I have a specific way of thinking of them - but I am not sure whether I got the idea right. Hence I'd like to elaborate and have others tell me whether it's right or wrong. In my understanding, sagas are…
Golo Roden
  • 140,679
  • 96
  • 298
  • 425
15
votes
2 answers

Why the pattern for microservices distributed transactions named as SAGA?

I have gone through various SAGA patterns(Orchestration,Choreography), suggested for maintaining database consistency in microservices during distributed transactions. But I am not able to relate the literal word SAGA in the context. Why is it named…
15
votes
3 answers

DDD, difference between a Saga and an Event Dispatcher?

On multiple sites (e.g. here or here Sagas are described as a mechanism that listens to domain events and reacts to them, executing new commands, and finally modifying the domain, etc. Is there any difference between a Saga and a simple event…
fj123x
  • 6,904
  • 12
  • 46
  • 58
14
votes
3 answers

How to test redux-saga delay

Problem In redux-saga, I am using yield delay(1000);. During my unit test, I do expect(generator.next().value).toEqual(delay(1000));. I expect the test to pass. This is my sagas.js: import { delay } from 'redux-saga'; export function*…
Dimitri Kopriwa
  • 13,139
  • 27
  • 98
  • 204
12
votes
1 answer

Event Sourcing vs Event Driven Architecture difference

I was looking in to event base architecture and came to know about two architecture Event Sourcing & Event Driven Architecture. My understanding is following Event driven : used for distributed transactions like saga event is pushed to message…
mubir
  • 719
  • 1
  • 8
  • 15
12
votes
2 answers

Implementing sagas with Kafka

I am using Kafka for Event Sourcing and I am interested in implementing sagas using Kafka. Any best practices on how to do this? The Commander pattern mentioned here seems close to the architecture I am trying to build but sagas are not mentioned…
George
  • 263
  • 3
  • 10
10
votes
4 answers

Microservices Saga pattern consumer awaits response

I would like to clarify what'd be the best way of organizing architecture. I've got rest api and microservices architecture. I have applied the Database per Service pattern. So let's imagine that the user wants to create an order(an e-commerce…
9
votes
1 answer

Is event sourcing an enhanced pattern of choreography-based SAGA pattern?

These days I am researching the Microservice inter-service communication patterns. So during my research, I found that there are two patterns called SAGA and event sourcing. But I couldn't find a resource on the internet to learn the difference…
Hasindu Dahanayake
  • 1,344
  • 2
  • 14
  • 37
9
votes
3 answers

react native app works on debug mode, but not works release mode on ios

I Have an app on react native. Debug mode works on ios. But Release mode not works. I tried change the optimization level but not helped. The problem that I don't see any error. Just not working some functional. And I can't debug release version of…
Kamil Ibadov
  • 1,436
  • 2
  • 20
  • 44
8
votes
1 answer

EventSourced Saga Implementation

I have written an Event Sourced Aggregate and now implemented an Event Sourced Saga... I have noticed the two are similair and created an event sourced object as a base class from which both derive. I have seen one demo here…
morleyc
  • 2,169
  • 10
  • 48
  • 108
7
votes
1 answer

Time based Sagas with Event Sourcing

Let's say I wanted to have a saga that get's created by some event, then sits and wait for a few hours, and if nothing happens, sends off some command. Now, if this Saga was all in-memory and I had to restart the app/server, the saga would be…
Kristoffer Lindvall
  • 2,674
  • 1
  • 18
  • 27
7
votes
2 answers

No overload matches this call in saga call effect

I want to pass action.url string as a parameter of topicDummy function which return Promise, but It keeps show me No overload matches this call. The last overload gave the following error. Argument of type '(url: string) =>…
dante
  • 933
  • 4
  • 16
  • 39
7
votes
2 answers

Redux saga: What is the difference between using yield call() and async/await?

I'm using a Redux Saga template and it uses generator functions that contain instances of yield call(). Basically it looks like this: function *a(){ yield call(); } yield takeLatest(SOME_ACTION, a) My questions are as follows: 1)…
gkeenley
  • 6,088
  • 8
  • 54
  • 129
1
2 3
33 34