I am developing a system, which can be in very simple terms described as below:
- There are multiple servers, each running the same Java App (for scalability).
- There is a common database server, which each application server talks to.
- Millions of clients, each connecting to one random server. Each client has one open socket with one server.
Now say, Client A is connected to Server A, and wants to send a message to Client B.
What is the best approach for this kind of problem? Whats the best way to keep track which client is connected to which server, and how to make the servers talk to each other.
This is a Java specific problem. If there was only one server, it could have been done through inter thread communication. But the problem is for multiple servers. Also, are there any open source libraries that make this task easier?