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: README.md
+62-6Lines changed: 62 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,12 +34,13 @@ License: [MIT](./LICENSE)
34
34
35
35
## Table of Contents 📚
36
36
37
-
-[Features ✨](#features-✨)
38
-
-[Deployment 🚀](#deployment-🚀)
39
-
-[Client SDK 🚀](#client-sdk-🚀)
40
-
-[Author 👨💻](#author-👨💻)
41
-
-[Contributing 🤝](#contributing-🤝)
42
-
-[License 📜](#license-📜)
37
+
-[Features ✨](#features-)
38
+
-[How Does It Work? 🌟](#how-does-it-work-)
39
+
-[Deployment 🚀](#deployment-)
40
+
-[Client SDK 🚀](#client-sdk-)
41
+
-[Author 👨💻](#author-)
42
+
-[Contributing 🤝](#contributing-)
43
+
-[License 📜](#license-)
43
44
44
45
<hr>
45
46
@@ -57,6 +58,61 @@ License: [MIT](./LICENSE)
57
58
58
59
<hr>
59
60
61
+
## How Does It Work? 🌟
62
+
63
+
**MicroStream** simplifies communication between microservices using a **centralized hub-and-spoke architecture**, also known as a **star network**. In this model, the **[MicroStream Hub](https://github.com/arijitcodes/microstream-hub)** acts as the central communication point, and your microservices, equipped with the **[MicroStream Client](https://github.com/arijitcodes/microstream-client)**, connect to the Hub and communicate through it.
64
+
65
+
Here's how it works:
66
+
67
+
### 🌟 The Star Network Concept
68
+
69
+
Imagine a star:
70
+
71
+
- The **center of the star** is the **[MicroStream Hub](https://github.com/arijitcodes/microstream-hub)**.
72
+
- The **points of the star** are your **microservices** (each equipped with the **[MicroStream Client](https://github.com/arijitcodes/microstream-client)**).
73
+
74
+

75
+
76
+
In this setup:
77
+
78
+
- The **Hub** acts as the central communication point.
79
+
-**Services** (nodes) connect to the Hub and communicate through it, **not directly with each other**.
80
+
81
+
### 🚀 How It Works in Practice
82
+
83
+
1.**Service Registration**:
84
+
85
+
- Each microservice connects to the Hub using the **[MicroStream Client](https://github.com/arijitcodes/microstream-client)**.
86
+
- The **[Hub](https://github.com/arijitcodes/microstream-hub)** automatically detects and registers the service.
87
+
88
+
2.**Request-Response Communication in Real-Time**:
89
+
90
+
- When **Service A** needs to talk to **Service B**, it sends a request to the **[Hub](https://github.com/arijitcodes/microstream-hub)**.
91
+
- The **[Hub](https://github.com/arijitcodes/microstream-hub)** routes the request to **Service B**.
92
+
-**Service B** processes the request and sends a response back through the **[Hub](https://github.com/arijitcodes/microstream-hub)**.
93
+
- All communication happens in **real-time** over WebSockets, ensuring fast and reliable data exchange.
94
+
95
+
3.**Auto-Discovery**:
96
+
97
+
- Once connected, the **[Hub](https://github.com/arijitcodes/microstream-hub)** keeps track of all connected services, so you don’t need to manually configure connections between services. However, you still need to specify the target service and method when sending a request.
98
+
99
+
4.**Heartbeat Mechanism**:
100
+
- Services send regular "heartbeats" to the **[Hub](https://github.com/arijitcodes/microstream-hub)** to confirm they’re active.
101
+
- If a service stops sending heartbeats, the **[Hub](https://github.com/arijitcodes/microstream-hub)** removes it from the network.
102
+
103
+
### ✨ Why Choose MicroStream?
104
+
105
+
**MicroStream** is designed to make microservice communication **simple**, **efficient**, and **scalable**. Here’s why you’ll love it:
106
+
107
+
-**Easy Setup**: Minimal configuration required to get started.
108
+
-**Real-Time Request-Response Communication**: Built on WebSockets for instant, reliable data exchange.
109
+
-**Auto-Service-Management**: Once connected, the **[Hub](https://github.com/arijitcodes/microstream-hub)** keeps track of all services, simplifying network management.
110
+
-**Scalable**: Easily add more services without reconfiguring the network.
111
+
-**Lightweight**: Minimal overhead compared to traditional REST or gRPC.
112
+
-**Flexible**: Works seamlessly with any microservice architecture.
0 commit comments