Skip to content

re: How do you scale a nodejs real-time API to concurrently serve a million users? VIEW POST


XMPP server is best solution for chat. Do not use node.js as chat data streaming.


Could you provide some details / data on your statement. Why would you choose XMPP over a NodeJS app? Do you have any personal experience / empirical evidence the poster could use for references?


Yes. 8 Android app built by me use XMPP (Openfire).

I previously use Node.js but there are many limitations in node.js

1) You need to built all things from scratch but in openfire XMPP server each and every thing that i want to use is already prebuild.

2) Node.js is good for broadcasting messages. But for one-to-one messaging. It is disastrous. On the other hand Openfire provides both of these.

3) Main problem with node.js is offline messaging.

Example. When User_A send message to User_B and User_B is offline at the time of messaging. Then message lost. To solve this problem you need to code all thing for this from scratch in node.js. But in openfire you don't need to worry.

4) You need to track all users sockets. But in openfire there is no such problem.
5) You don't detect which user is online or not in node.js. You need to program it that node.js ping for every 'X' seconds to users to track their availability. But In openfire you don't need to worry.

There are many other points.

In other words You just need to install XMPP server like openfire. And Go for your project. you don't create all thing from scratch like in node.js

I have one question. Why google,facebook,whatsapp use XMPP server for instant messaging and push notification. Why they don't even try to use Node.js

Node.JS real time API is just for fun.

I use Node.js previously But I face many problem . My client complaint that they don't receive messages. Buy when i heard of XMPP server. i used that in all my apps for push notifications and for chat.

Thank you for the details. That is some very helpful information. I sure @presto412 has a better idea of the route to take now.

How would you rate this? I'd like to keep my codebase consistent

Hey I would like to discuss this a lot further, could you follow me back or send me a mail at ?

Mr. Priyansh Jain. That is node.js xmpp client not XMPP server.

I think you don't read comment section in first block of code.

first : we need an xmpp chat server

second : establish connection to the chat server

Love all the knowledge sharing in this thread. Just a friendly reminder everyone’s here to learn from each other’s experiences. 👍🏻


Hey! A little late to the discussion, but I have a question. What if my application has custom chat requirements, such as only some users being able to message other users. For this we do need some sort of proxy/server in between the client and the XMPP server. How exactly should this case be handled where requirement is based on data stored outside of XMPP? A little overview/nudge in the right direction would be highly appreciated.


Hi Sandeep, are you available for some on going development work? If you are please contact me on to discuss.


code of conduct - report abuse