Question

I currently have a web based private chat application that is going very well.

Now the problem is that I am using mysql to save and then get received messages, this is very inefficient and I was thinking to migrate to node.js or socket.io to handle the sent private messages. As the traffic I am receiving is growing everyday, I will soon end up having to handle tens, and then hundreds of thousands of connections.

how can I achieve that? do I need multiple servers? or can a single powerful server handle such huge connection number?

Thank you in advance.

Was it helpful?

Solution

You need either a big powerful machine with high computing power and huge RAM OR multiple machines.

You also need a pub-sub software such as Redis or ZeroMQ to communicate between the machines (ex: a user sends a message to machine A, but the message needs to be transmitted to all the machines and after that the machines need to send the message to the end users).

Edit: Also if would probably be more efficient to replace MySQL with something like MongoDB, which is can perform a lot better considering the use case.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top