Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between JAR and WAR deployment based on performance

What are the major differences between a web application deployed as a JAR versus it deployed on an application server as a WAR?

My case is that, I have developed a REST service using Spring Boot and that is packaged as a JAR file. The service may have to handle 500-1000 requests at the same time and I'm working on improving the performance of the service.

From a performance perspective, is it better to install an application server and deploy the application as a WAR rather than just execute the JAR as a standalone process?

Would the application server like Tomcat give more control related to number of configurable threads as compared to its JAR counterpart?

like image 931
seriousgeek Avatar asked Jun 24 '26 17:06

seriousgeek


1 Answers

The question is a bit incorrect, as JAR and WAR are simply a packaging format.

SpringBoot uses Tomcat as an embedded server by default, so there won't be a difference between running Tomcat as application server and deploying your application as WAR, or simply running a JAR.

What really matters is your code. If you plan to serve 1000rps, I would highly advice looking at Spring Reactor (as you already use Spring) or Vert.x, to provide as much concurrency as possible.

like image 169
Alexey Soshin Avatar answered Jun 26 '26 07:06

Alexey Soshin