We got this JavaEE WebApp (JSP+Struts+Hibernate+MySQL) which currently is running on a single server. Due to growth of the website and performance issues we've decided to cluster the project on some machines. The Web Site should tolerate something like 5000 requests per second. After some googling around and reading stuff I've come around some strategies to get this done:
- Using Apache as a front-end Load Balancer and reverse proxy, some Tomcat Instances each one on a separated machine, and finally a DB Server running MySQL. Tomcat instances can scale in the time of need.
- Using Nginx as a front-end Load Balancer and reverse proxy. The rest would be the same as above.
- Using HAProxy as a front-end Load Balancer and reverse proxy. The rest would be the same as above.
I suppose in aforementioned approaches all the traffic should pass through the front-end load balancer (Apache, Nginx or HAProxy Server). this makes the front-end server a bottleneck and also a SPOF. Is that right? can a single front-end server tolerate all the traffic of a big webapp?
to come around this issue, I've come up with a kinda handmade strategy:
- Putting the Login page and authenticating actions on a front-end server (for example it will be accessible from myapp.com). when a user logs in successfully, he is redirected to one of the backend servers (like srv1.myapp.com) and continues his activity there.
So, am I in the right path?
Let me know of your opinions on these approaches and if you are thinking of a better one please me by mentioning it here.