Architecture for XMPP Web Based Chat Service

Suppose I want to create a web chat and a socket based web service. And let them also say that I need some discrete chats.

I need to scale this, so I am thinking of using XMPP so that I can transparently use multiple servers. Is the architecture shown on the diagram what I need?

enter image description here

And, will I even need NodeJS?

+4
source share
1 answer

How about load balancing of node.js and multiple node.js servers.

use something like redis to store data and process message passing. See Article.

Then each client lives on the node.js server, you don't care.

Each message is processed by the node.js server (you don't care).

Each message is sent to redis by the node.js server, which processes this incoming message.

Then each node.js server selects it and pushes it to all clients connected to this server and this chat room.

You will need a little black magic to send messages from one socket.io connection on your load balancer to tcp sockets on several node.js servers.

+2
source

Source: https://habr.com/ru/post/1347971/


All Articles