This repository outlines the architecture for a scalable chat application using multiple WebSocket servers with a Publish-Subscribe (Pub-Sub) model. This design allows multiple users to connect to different WebSocket servers and subscribe to the same room, ensuring seamless message delivery across the network.
- Node.js: JavaScript runtime environment.
- TypeScript: Superset of JavaScript with static typing.
- Redis: In-memory data structure store, used here for Pub-Sub messaging.
-
WebSocket Servers:
- Handle client connections.
- Manage subscriptions to rooms.
- Publish messages to subscribed clients.
-
Pub-Sub System:
- Manages message distribution.
- Propagates messages to all WebSocket servers with clients subscribed to the room.
-
Rooms:
- Virtual channels for group communication.
- Broadcast messages to all subscribers.