Skip to content

Commit dbd0c8b

Browse files
committed
docs(readme.md): updated README.md to elaborate how the whole structure works for MicroStream
1 parent 0abd8d9 commit dbd0c8b

1 file changed

Lines changed: 62 additions & 6 deletions

File tree

README.md

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ License: [MIT](./LICENSE)
3434

3535
## Table of Contents 📚
3636

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-)
4344

4445
<hr>
4546

@@ -57,6 +58,61 @@ License: [MIT](./LICENSE)
5758

5859
<hr>
5960

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+
![MicroStream Star Network Diagram](https://mermaid.ink/svg/eyJjb2RlIjoiZ3JhcGggVERcbiAgICBIdWJbTWljcm9TdHJlYW0gSHViXSAtLT4gU2VydmljZTFbU2VydmljZSAxXVxuICAgIEh1YiAtLT4gU2VydmljZTJbU2VydmljZSAyXVxuICAgIEh1YiAtLT4gU2VydmljZTNbU2VydmljZSAzXVxuICAgIEh1YiAtLT4gU2VydmljZTRbU2VydmljZSA0XVxuICAgIEh1YiAtLT4gU2VydmljZTVbU2VydmljZSA1XVxuIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQiLCJsaW5lV2lkdGgiOiIzIn19)
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.
113+
114+
<hr>
115+
60116
## Deployment 🚀
61117

62118
### Running via Docker 🐳

0 commit comments

Comments
 (0)