title: How to write scalable java-ee application
body: <p>I am planning to implement a web application with database. Database servers are of the following structure: 1 Master and several Slave servers.
  The goal is to make the application scalable, so that if I add and/or remove one more database Slave server - it will keep working without the need in recompilation. </p>
  
  <p>The question is how to make a java EE application independent on the amount of servers? 
  Usually I inject the resourses, however in this case this solution won't work, because the amount of servers is not fixed.</p>
  
  <p>What should I read to understand about it?</p>