-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added solution for projection exercise with eventual consistency
- Loading branch information
1 parent
8b8ade3
commit 19cb103
Showing
6 changed files
with
939 additions
and
1 deletion.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...sourcing/src/solved/10_projections_single_stream_eventual_consistency/README.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Exercise 09 - Projections Idempotency | ||
|
||
With the [Database](./tools/database.ts) interface representing the sample database, implement the following projections: | ||
|
||
1. Detailed view of the shopping cart: | ||
- total amount of products in the basket, | ||
- total number of products | ||
- list of products (e.g. if someone added the same product twice, then we should have one element with the sum). | ||
2. View with short information about pending shopping carts. It's intended to be used as list view for administration: | ||
- total amount of products in the basket, | ||
- total number of products | ||
- confirmed and canceled shopping carts should not be visible. | ||
|
||
Add event handlers registrations in [projections.exercise.test.ts](./projections.exercise.test.ts) calling [eventStore.subscribe](./tools/eventStore.ts) method. | ||
|
||
If needed expand existing classes definition. | ||
|
||
Track and implement proper eventual consistency handling in projection event handlers. Change documents definitions, projection logic or database if needed. | ||
|
||
Read more about projections in my article: | ||
|
||
- [Guide to Projections and Read Models in Event-Driven Architecture](https://event-driven.io/en/projections_and_read_models_in_event_driven_architecture/?utm_source=event_sourcing_nodejs&utm_campaign=workshop) | ||
- [A simple trick for idempotency handling in the Elastic Search read model](https://event-driven.io/en/simple_trick_for_idempotency_handling_in_elastic_search_readm_model/?utm_source=event_sourcing_nodejs&utm_campaign=workshop) | ||
- [Dealing with Eventual Consistency and Idempotency in MongoDB projections](https://event-driven.io/en/dealing_with_eventual_consistency_and_idempotency_in_mongodb_projections//?utm_source=event_sourcing_nodejs&utm_campaign=workshop) |
1 change: 0 additions & 1 deletion
1
...n_to_event_sourcing/src/solved/10_projections_single_stream_eventual_consistency/index.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.