Load balancing strategy
As it's stated in documentation, Tigase has load balancing enabled by default.
Let's say we have several cluster servers and user only knows the address of a main server. When user connects to the server his request is redirected to one of the machines based on the selected strategy (SeeOtherHostHashed). Could you please confirm this is the correct behavior and how does Tigase solves a single point of failure issue when the main server goes down?
Added by Artur Hefczyc about 4 years ago
Yes, this is correct behavior.
The single point of failure problem can be solved in many ways. The simplest and very effective is by using DNS round-robin. Let's say you run Tigase in a cluster mode on 4 servers at address: xmpp.example.com*. Then you setup DNS record for the domain *xmpp.example.com to point to all 4 servers. When a client connects to the server it queries DNS for the domain and gets address of a random of 4 servers. It connects to the server and then the Tigase logic for load balancing kicks in and, if necessary, Tigase sends a redirect to the client to reconnect to a different server. To optimize things you can make the client software to remember last recommended cluster server, so next time it reconnects it can try to connect to the correct server first.