Not sure if this is a ServerFault or StackOverflow question. I'm posting it here since it's more of a server-related thing.
We're running a SpringBoot application (Java) running in a Tomcat container on an Ubuntu server (as a REST API). As expected, there will be times that we will need to upload a new version of the application, and I'm wondering what is the preferred method for restarting?
Currently, we use a shell script that detects a JAR file of a certain name to be present in a certain directory, and if found, it stops the process, moves the new file, backs up the old file and restarts the application using the new JAR file.
The problem is, at times, Tomcat can take up to 15 seconds to restart, leaving the REST service down for that time. Not a lot of time, but 15 seconds in our world is an eternity.
I'm mainly asking if this is a good or terrible way to go about this, and if there is something that can be done differently to expedite the reloading of the REST application.
Thanks in advance for any pointers...