1

I have 5 Spring Boot web applications but have only one Server (low-end).

What is the best way to deploy all 5 in one Server? Having only one web container (Tomcat) and deploy all of them as separate war files on the same Tomcat or run all 5 on different Tomcat containers (Spring Boot default behavior)?

What is your recommendation by considering performance and maintenanability?

Kapila
  • 85
  • 2
  • 6

4 Answers4

1

IMHO, if you're running a resource-constrained server, your best bet is to deploy all of your applications as war files under a single tomcat instance. Running multiple servers would just add un-needed overhead.

GreyBeardedGeek
  • 29,460
  • 2
  • 47
  • 67
1

If you have little resources on your server, you don't have much choice. Each Java virtual machine has a significant overhead, so running separate containers will make you reach the limits of your low-end server earlier.

You will have to deploy your wars in the same tomcat server, with different servlet contexts.

However, if you have sufficient RAM, the cleanest way in my opinion is creating docker images and running the standalone spring-boot jars in each container.

Luis Muñiz
  • 4,649
  • 1
  • 27
  • 43
0

My recommendations are:

  • If these WARs are independent of each other, deploy them in a different Web server, not only Tomcat or whatever container you're using, but also in either different virtual server, dedicated server or Cloud instances.
  • Deploying in different "virtual server" you can scale horizontally, so this is good for future workloads.
  • Deploy a load balancer from your hosting provider, or you can use Nginx for doing that.

Hope this helps!

Ele
  • 33,468
  • 7
  • 37
  • 75
0

From my experience, using container such as docker is the easiest way to maintenance multiple spring-boot applications. When you have a new server, it can be migrated easily, and the application can be updated without interrupting other applications. But you may need to spend extra time to learn how to use the container.

If using Tomcat, it is recommended to separate the tomcat instances. One tomcat for each WAR file. Putting multiple WAR files in one tomcat can make the maintenance difficult. Tomcat hot deployment / auto deploy tends to have some errors which require you to restart the whole tomcat

JSas
  • 126
  • 2
  • 5