I have a medium sized web application which currently runs in tomcat. I'm looking at clustering to give me fail over and load balance. I could just go ahead and cluster it as is but as more functionalty comes along the application is starting to look a bit big and clumsey.
I want to break the application up into various sub projects / packages , tidy up the struts web tier and implement a proper DAO layer down at the bottom. I want each one of my sub projects to be nice a loosley coupled through a container so that one does not depend on the other.
I want a simple container which will let me plug in Hibernate and take care of my persistence, keep the web tier seperate and hold all my other business layer sub packages together without any dependancy to the container or each other, (well, as much as is possbile). I don't particularly want to get bogged down with EJB, just nice simple POJOs in my business layer. The whole thing must be very easy to scale horizontally, so when I get more and more load I can just stick another server on with no fuss.
Okay, I'll get to the questions now! Should I -
1) Use JBoss as my app server implement Hibernate as a service, web service as a war, everything else jarred up and all dumped in an EAR?
2) Stick with tomcat and use Spring or maybe nanocontainer, again implementing Hibernate through the container?
3) Not bother with a container and just refactor my current code, splitting it up into sub projects each as a jar and war the whole thing up to be dropped into tomcat as currently is the case?
After reading up and having a play with JBoss, Spring, pecocontainer I favour number 2. Even JBoss seems a bit to heavy weight, I don't really see the point unless I'm using EJB. Can I use Spring simply with tomcat? If so, whats the deal? Does Spring just go into the war as any other jar? Will it deal with clustering the application when I cluster tomcat?
Maybe I'm asking too general a question here, but any input would be greatly appreciated.