-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
Improved Saga Support for 3.0 #988
Comments
I have only just started experimenting with sagas myself, does Is saga state documents (in marten integration)? Asking because that would lead to some useful functionality around being able to query saga state for inspection/monitoring purposes. Other than that, optimistic concurrency sounds like a great idea 👍 |
@elexisvenator So:
Yes, exact same mechanics and underlying code
If using Marten, yes |
For the Marten saga persistence, then ended up using |
wip: using IRevisioned with Saga First bit of working code for lightweight Sql Server based sagas End to end functionality with the lightweight Sql Server saga persistence Mild refactoring of the saga code Full end to end Sql Server lightweight sagas Fixed after applying the lightweight Sql Server sagas Lightweight saga persistence for Postgresql Updated docs for sagas
While the 3.0 work is happening, now is a good time to talk about possible improvements to the Saga support. I've got a couple things in mind:
Concurrency Protection
You could fake the concurrency a little bit with Marten, but it would be nice to have first class concurrency protection with sagas so that parallel work doesn't necessarily overwrite Saga state. My only ideas so far are based on Marten's
FetchForWriting()
implementation:Saga
, which is easy enough. In this case we will "know" the current revision of the saga because we're loading it to begin with. On committing the saga state we'll have the database reject the changes if the saga has been changed since the transaction startedIn all cases, throw a distinct exception so that it's easy to apply retry rules on any operations against the saga
Lightweight database storage
Especially when using SQL Server or Postgresql w/o Marten, use a crude table storage and JSON serialization. Quicker and easier the messing around with EF Core mapping IMO
The text was updated successfully, but these errors were encountered: