Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Lets say I have Spring Framework App that is running on Tomcat and uses MySQL database:

enter image description here

What would be the best solution in this instance that would allow for sociability (price/performance/integration time)?

More precisely: What would be on the Web Load balancer box, and who should be the tomcat web server clustered? What would be on the Database Load balancer box and how should be the database servers clustered? And if at all possible specific technical integration links would be of great help.

share|improve this question

migrated from stackoverflow.com Nov 12 '11 at 13:10

This question came from our site for professional and enthusiast programmers.

3 Answers 3

up vote 3 down vote accepted
+25
  1. For web load balancing, there are multiple solutions, opensource and paid, I personally have used cisco load balancers(CSM and ACE) and F5 and like them(but those solutions can get expensive). There are multiple for opensource, one that comes to mind is http://www.linuxvirtualserver.org/

  2. For mysql load balancing, you can look at master to master replication for msyql. Look at: http://www.howtoforge.com/mysql_master_master_replication. What I have done in past for a project, I had 3 web servers serverfarm behind big IP(F5) and they all talked to one mysql server. And I had exact same setup in a different site, and both mysql servers had master to master replication. So users would use all the webservers and db servers and if one of the DB server, went down, web farm on that site would go down and users would only use the other site. (DNS failover and monitoring for multiple site monitoring and failover). You can use global load balancer if you have the budget to get more granular.

share|improve this answer

Plain MySQL does not have a load-balancing option, but MySQL Cluster does.

I would recommend using MySQL Cluster for your multiple MySQL instances.

Then you can use MySQL Connector/J with transparently load-balancing JDBC URLs. See http://dev.mysql.com/doc/ndbapi/en/mccj-using-connectorj.html

PS: I voted to move this question to ServerFault.com.

share|improve this answer

I would not recomend using MySQL Cluster. I have never seen it perform well and not crash alot. Havent used it in a while though (since it didnt realy work a year or so ago).

Simply use a master with slaves. Do al your read operations on the slaves (unless you need to read your own writes or data current to the ms). If that doesnt scale enough for you (you have to many writes). It is time to look at sharding.

Another option, if your application allows it (or can be turned into allowing

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.