Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/puskar-roy/scaleable-chat-app
Scaleable Chat App Using Typescript, Node.js, Express Js, Socket.IO, Redis, Pub/sub
https://github.com/puskar-roy/scaleable-chat-app
expressjs nextjs14 nodejs pubsub redis socket-io typescript
Last synced: about 1 month ago
JSON representation
Scaleable Chat App Using Typescript, Node.js, Express Js, Socket.IO, Redis, Pub/sub
- Host: GitHub
- URL: https://github.com/puskar-roy/scaleable-chat-app
- Owner: Puskar-Roy
- Created: 2024-05-12T06:30:32.000Z (8 months ago)
- Default Branch: monorepo
- Last Pushed: 2024-05-15T07:49:59.000Z (8 months ago)
- Last Synced: 2024-05-16T13:37:59.940Z (8 months ago)
- Topics: expressjs, nextjs14, nodejs, pubsub, redis, socket-io, typescript
- Language: TypeScript
- Homepage:
- Size: 414 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Upscaling Node.js + Socket.IO Server 🚀
When scaling a Node.js + Socket.IO server, you might encounter several issues related to maintaining user connections and state consistency across multiple server instances. This document outlines common problems and provides solutions for effectively scaling your Socket.IO server.
### Issues 😧
## User Connections Across Multiple Servers 📥
### Problem
When you scale horizontally by creating multiple server instances, users may get connected to different servers. This fragmentation can disrupt real-time communication as users connected to different instances cannot interact with each other seamlessly
![server](./docs/assets/socket-server-problem.png)
### Solution
Use a message broker like Redis to share connection information and state across all server instances. This ensures that messages and events are broadcasted to all users, regardless of the server instance they are connected to.