Java EE Application Servers Are Not Suitable To Host Microservices
Due to low footprint, fast startup and low runtime overhead ("The Overhead Of Java EE Application Servers"), deploying multiple WARs into one application server instance running on a single JVM does not save a considerable amount of resources unless you have to deal with Netflix-like scale (ten thousands of dynamic VMs).
You could manage multiple WAR-microservices on a shared application server, but this approach would come with serious disadvantages:
- Less Isolation: A misbehaving WAR can influence other microservices
- Complicated Monitoring: it is harder to monitor the activity of a single WAR
- Less Stability: a redeployment of a WAR could influence others (memory leaks, classloader leaks)
- Less scalability: it is harder to scale a single process, than multiple processes
- More complex CI / CD: an executable image will contain multiple microservices and requires coordination between teams
Java EE Application Servers are not suitable to host multiple microservices. The way to go is to ship exactly one Thin WAR ("Thin WARs, Java EE 7, Docker and Productivity") with one application server instance and consider the OS, JVM, applicaton server and the Thin WAR as the executable unit.
A Java EE microservice architecture is about multiple application servers hosting exactly one WAR ("Why Not One Application Per Server?) communicating with each other. Using a single application server instance as a microservice runtime is too brittle, too complicated and hard to justify with numbers.See you at Java EE Microservices where we build Java EE Thin WARs, and Java EE CI/CD, Testing and Quality workshop where the Thin WARs get automatically deployed.
If you're developing microservices, wouldn't it be nicer to have the complete set of services running on a single app server running on your localhost...., advantages of being able to start one server for the entire system to be running within seconds, debugging, not worrying about setting up links between different containers etc.
However, when comes the time to deploy, moving to 1 war per server ,os , container is a simple configuration change...and get all the advantages what you say.
That's the great thing about JavaEE - dont have to make that choice up front.
Posted by tony on October 10, 2017 at 10:50 AM CEST #