-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: kick-off event sourced tasks-svc #587
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MaxSchaefer
force-pushed
the
issue/x-cqrs-es-arch
branch
from
December 26, 2023 22:23
c3ad43f
to
c749aee
Compare
MaxSchaefer
force-pushed
the
issue/x-cqrs-es-arch
branch
3 times, most recently
from
December 29, 2023 22:41
8eba2f4
to
4803a8e
Compare
Co-authored-by: Max Baumann <[email protected]>
Co-authored-by: Max Baumann <[email protected]>
Co-authored-by: Max Baumann <[email protected]>
… aggregate.GetStreamID() private
FoseFx
reviewed
Jan 22, 2024
MaxSchaefer
commented
Jan 22, 2024
FoseFx
approved these changes
Jan 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥂
MaxSchaefer
changed the title
feat: event sourced tasks-svc
feat: kick-off event sourced tasks-svc
Jan 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request starts our journey towards event sourcing and domain-driven-design in general. Therefore I've implemented
libs/hwes
that gets consumed bytasks-svc
(and every other service that wants to utilizing event sourcing).libs/hwes
introduces the concepts of Commands, Events, Aggregates and Aggregates stores. These concepts are implemented bytasks-svc
, for exampleTaskAggregate
orCreateTaskCommand
orTaskCreatedEvent
.We already did a meeting on this new architecture but here is an outline:
2.1 Create empty aggregate by the passed ID
2.2 Load all events from the event store for that aggregate (every aggregate has its own event stream)
2.3 Applying all events in order on the aggregate
4.1
libs/hwes
calculates the expected revision of the targeted event stream by combining the applied events of step 2. and the uncommitted events of step 3. .4.2.a If the revision cannot be reached due to concurrent changes to the targeted event stream the request fails.
4.2.b If the revision can be reached during persistence, the events got stored successfully.
Step 4.2 describes optimistic concurrency. The application needs to keep track of versioning. We could apply all events, regarding there version but this can result in data conflicts and issues with idempotency. Its quite unlikely that Step 4.2.a occur but we need to keep track of this architecture trade-off with future metrics and tracing.
tasks-svc
is not yet production ready. We can either integrate the event sourced task domain into the currenttask-svc
or the other way around. Upcoming issues will work towards the production readiness.To-dos for later issues
Also closes #344