You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 📊 Event-First Design with Event Sourcing Foundation
20
20
* 🧱 Clean Architecture
21
21
22
-
### Concept
23
-
**v1.0.0**
24
-
-`Aggregate` wraps the `root aggregate` entity that you wish to manage within a domain bounded context (microservice). Changes are applied to aggregate entity by publishing commands.
25
-
-`Saga` is a long running transaction that subscribes to `commands` to apply actual updates to aggregate entity. Saga basically `orchestrates` the success and failure flows to `preserve` the `state` of `root aggregate` accordingly. Saga can also publish `commands` to `itself` or `other` saga's. Saga can be defined to raise `events` when handling commands.
26
-
-`Events` are published to `subscribers`. There are two subscribers to event - ie. i. `Aggregates` ii. `Views`
27
-
-`Aggregate` subscribes to `events` to publish `changes` to root aggregate based upon `external` stimulus. ie. potential changes from any other saga workflow that could affect the state of Aggregate in context.
28
-
-`View` subscribes to `events` to `write` data to `view model`, view sources `transformed` data for interested viewers. ie. `UI` (viewer) could read data from view model (with eventual consistency).
29
-
30
-
**v2.0.0**
31
-
-`Command Dispatcher` will dispatch `commands` to `Cloud`. It basically targets a specific command `queue`.
32
-
-`Command Queue` is the queue designated for the `bounded context` (microservice). When command is sent to this queue it gets dispatched to subscribing `Saga's` in the domain context.
33
-
-`Event Disptacher` will dispatch `events` to the `Cloud`. It basically publishes to certain `Topic`.
34
-
-`Event Listeners` is a bootstrap component `listening` to subscribed `topics`. When it receives the `event` for the topic then it dispatches to subscribing `Aggregates` and `Views` within the domain context.
22
+
### Core Concepts
23
+
24
+
#### v1.0.0 Architecture
25
+
26
+
**Aggregates**
27
+
- An `Aggregate` encapsulates a root domain entity within a bounded context (microservice)
28
+
- Changes to aggregates are initiated by publishing commands
29
+
- Aggregates subscribe to events to react to external changes from other sagas or workflows that may affect their state
30
+
31
+
**Sagas**
32
+
- A `Saga` represents a long-running transaction that orchestrates complex business processes
33
+
- Sagas subscribe to commands and execute the actual updates to aggregate entities
34
+
- They manage both success and failure flows to ensure data consistency and preserve aggregate state
35
+
- Sagas can publish commands to themselves or other sagas to coordinate multi-step workflows
36
+
- Events can be raised by sagas during command handling to notify other components of state changes
37
+
38
+
**Events**
39
+
- Events are published to interested subscribers when state changes occur
40
+
- Two primary event subscribers exist in the framework:
41
+
-**Aggregates**: React to events from external workflows that impact their domain state
42
+
-**Views**: Project event data into optimized read models for query operations
43
+
44
+
**Views**
45
+
- Views subscribe to events and transform domain data into denormalized view models
46
+
- View models provide optimized read access for consumers such as UIs or reporting systems
47
+
- Data in view models follows eventual consistency patterns
48
+
49
+
#### v2.0.0 Roadmap (Cloud Integration)
50
+
51
+
**Command Dispatcher**
52
+
- Dispatches commands to cloud-based message queues for distributed processing
53
+
- Targets specific command queues based on bounded context routing
54
+
55
+
**Command Queue**
56
+
- A dedicated queue for each bounded context (microservice)
57
+
- Routes incoming commands to the appropriate subscribing sagas within the domain
58
+
59
+
**Event Dispatcher**
60
+
- Publishes domain events to cloud-based topics for cross-service communication
61
+
- Enables event-driven architecture across distributed systems
62
+
63
+
**Event Listeners**
64
+
- Bootstrap components that listen to subscribed event topics
65
+
- Dispatch received events to the appropriate aggregates and views within each domain context
66
+
- Enable seamless integration across bounded contexts
0 commit comments