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
Copy file name to clipboardExpand all lines: documentation/modules/ROOT/pages/01-pattern.adoc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,12 @@ The team saw a https://www.youtube.com/watch?v=Rc5IO6S6ZOk[talk on _Event Mesh_]
8
8
The talk presented the advantages of moving beyond transactional architectures in favor of eventual consistency.
9
9
By leveraging event meshes with technologies like Knative, developers can achieve decoupled, reliable microservices without extensive re-engineering.
10
10
This solution addresses inefficiencies and aligns distributed systems with real-world business processes.
11
-
The team had figured out they could leverage the _CQRS_ pattern together with _Knative's Event Mesh_
11
+
The team had figured out they could leverage the https://martinfowler.com/bliki/CQRS.html[_CQRS_] pattern together with _Knative's Event Mesh_
12
12
to modernize their application in a non-extrusive way.
13
13
14
14
== The Solution
15
15
16
-
The core of this solution is an event mesh—a dynamic, flexible layer that routes, retries, and processes asynchronous events across distributed components.
16
+
The core of this solution is an event mesh -- a dynamic, flexible infrastructure layer that routes, retries, and processes asynchronous events across distributed components.
17
17
Using _Knative Eventing_ and _CloudEvents_, this pattern enables:
18
18
19
19
- *Reliable delivery* of events with retry mechanisms.
Copy file name to clipboardExpand all lines: documentation/modules/ROOT/pages/02-architecture.adoc
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,13 +22,15 @@ Based on https://kubernetes.io/[Kubernetes].
22
22
** https://www.redhat.com/en/technologies/cloud-computing/openshift/serverless[Red Hat OpenShift Serverless]
23
23
— Provides the _Event Mesh_ and _Serverless_ capabilities.
24
24
Based on https://knative.dev[Knative] project.
25
-
** https://swc.saas.ibm.com/en-us/redhat-marketplace/products/red-hat-amq[Red Hat AMQ Streams]
25
+
** https://developers.redhat.com/products/streams-for-apache-kafka[Streams for Apache Kafka]
26
26
— (Optional) Provides a persistence for _Event Mesh_, likely needed in production.
27
27
Based on https://strimzi.io/[Strimzi] project.
28
28
* Other open source technologies:
29
29
** https://cloudevents.io/[CloudEvents] — Provides a standard for event metadata
30
-
** Rust and https://access.redhat.com/products/quarkus[Quarkus] — Implementation examples.
31
30
** https://opentelemetry.io/[OpenTelemetry] — (Optional) Facilitates tracing for observability.
31
+
** Rust and Java — Implementation examples.
32
+
33
+
_Kubernetes_, _Knative_, _Strimzi_, _CloudEvents_, and _OpenTelemetry_ are https://landscape.cncf.io/[CNCF projects].
32
34
33
35
[#in_depth]
34
36
== An in-depth look at the solution's architecture
@@ -44,8 +46,8 @@ Traditional systems often enforce strict transactional consistency, which can im
44
46
For instance, upon the completion of a ride-sharing service at the end-user's destination, the system should reliably capture this real-world event.
45
47
The capture should be performed regardless of any potential operational disruptions affecting dependent services (e.g., invoicing).
46
48
47
-
In such scenarios, transactional applicationstypically return an error, which prevents any data from being changed, and causes the loss of real-world intent of end-users.
48
-
This results in an adverse user experience and a deviation from the genuine business process, potentially leading to customer dissatisfaction.
49
+
In such scenarios, transactional applications, which typically encompass a number of steps in a user workflow, make all the steps undone when an error is returned.
50
+
This prevents any data from being changed, and causes the loss of real-world intent of end-users, and results in an adverse user experience and a deviation from the genuine business process, potentially leading to customer dissatisfaction.
49
51
50
52
=== Solution Breakdown
51
53
@@ -58,13 +60,13 @@ The primary responsibility of the _Event Mesh_ is twofold.
58
60
Firstly, it persists the incoming events, thereby maintaining a record of changes in the system's state.
59
61
Secondly, it routes these events to their respective endpoints, ensuring that the appropriate microservices are notified and can subsequently update their internal states based on the event data.
60
62
61
-
The mesh's inherent resilience is further bolstered by its exponential backoff strategy, which it employs when encountering operational failures.
63
+
The mesh's inherent resilience is further bolstered by its built-in retry strategies (linear or exponential backoff), which it employs when encountering operational failures.
62
64
This mechanism ensures that the system retries the operation until it succeeds, thus mitigating the risk of data loss or system disruption due to transient issues.
63
65
64
66
By integrating the _Event Mesh_ into the system architecture, several architectural benefits are achieved:
65
67
66
68
* **Decomposition of the application into independently functioning services**:
67
-
This approach facilitates a division of labor, with each service handling specific responsibilities.
69
+
This approach facilitates a division of labor, with each service handling specific responsibilities -- the https://en.wikipedia.org/wiki/Domain-driven_design[Domain-driven design] approach fits here quite well.
68
70
This not only enhances maintainability but also fosters scalability, as services can be independently scaled based on their demands.
69
71
70
72
* **Improved business alignment**:
@@ -87,11 +89,11 @@ The event-driven flow enables eventual consistent collaboration and state synchr
87
89
A usual flow may look like:
88
90
89
91
1. An end-user application sends an _HTTP_ request to the _Event Mesh_. Such message can be understood as a _Command_ type event.
90
-
2. The _Event Mesh_ (Broker) persists the event in a queue (e.g. Kafka).
92
+
2. The _Event Mesh_ (Broker) persists the event in a queue (like an Apache Kafka topic, but the implementation is hidden from the user).
91
93
After _Event Mesh_ persists safely the data, it returns a successful _HTTP_ response with the `202 Accepted` return code.
92
94
At this point, the operation could already be considered successful, from the end-user point of view.
93
95
It will eventually settle correctly in all downstream systems.
94
-
3. The _Event Mesh_ routes the event to the appropriate endpoint based on the event's metadata and configured triggering rules.
96
+
3. The _Event Mesh_ routes the event to the appropriate endpoint based on the CloudEvent's metadata and configured triggering rules.
95
97
4. The endpoints receive the events and process them, updating their internal states and potentially emitting new events for downstream consumers.
96
98
The potential events are transmitted to the _Event Mesh_.
97
99
5. The dispatch loop continues until the event queue is empty and all the events are processed successfully.
@@ -232,7 +234,7 @@ For instance:
232
234
=== Improving Resilience in Applications
233
235
234
236
Traditional systems often rely on synchronous calls and transactions, which can cascade failures across components.
235
-
Replacing these with asynchronous event-driven communication reduces dependencies and makes the system _Eventually Consistent_.
237
+
Replacing these with asynchronous event-driven communication reduces dependencies and makes the system https://en.wikipedia.org/wiki/Eventual_consistency[_Eventually Consistent_].
236
238
237
239
For example, invoicing and notification services in a ride-sharing platform can process events independently, ensuring that downtime in one service does not block the entire workflow.
0 commit comments