Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saga as a first class citizen #141

Open
falconepl opened this issue Nov 8, 2019 · 1 comment
Open

Saga as a first class citizen #141

falconepl opened this issue Nov 8, 2019 · 1 comment

Comments

@falconepl
Copy link

When it comes to entities interacting with each other, Aecor is more on a choreography side, by design. However, oftentimes I run into cases when being able to organize my code in the form of an orchestration could make it easier to reason about the data flow and simplify application's architecture significantly.

Of course, it seems that one could create a single entity with a bunch of processes (that receive events and in turn issue new commands) and make it act like a saga, to have that orchestration part with Aecor. The obvious flaw here is that we end up having loads of boilerplate, even when having a few entities to orchestrate (we need a saga entity, its own events and quite a lot of separate processes that allow us to form kind of a distributed transaction with other entities/aggregate roots).

But what if we make saga a first class citizen in Aecor? To eliminate all that boilerplate and provide a seamless experience when orchestration is one's choice. Do you think that some building blocks for a saga pattern could be a part of Aecor or should it be placed in a separate library/toolkit that leverages Aecor to deliver FP-style event sourcing for Scala?

@notxcain
Copy link
Owner

notxcain commented Dec 9, 2019

Hi! As you already said it is possible to implement stateful saga using Aecor Entity, as it allows to perform arbitrary effects during command processing.
I'm open to any suggestions on how to design Saga module, preferably on top of Aecor Entity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants