Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloud Foundry : Spring boot vs WAR file

I am new to the world of Cloud, CloudFoundry, Saas, PaaS, IaaS, etc.

So I have few very fundamental questions.

  • Who is better Spring boot or war file in terms of deploying an application or a service to a cloud using cloud foundry?
  • WHY ?
  • If I want to deploy my war file on a PaaS cloud then who kicks it off?
  • As in where is the server?
  • How will I know which server my war file is deployed to?
  • Is using Spring-boot with embeded tomcat for PaaS mandatory?
  • What if my application does not use spring-boot (no spring reference in pom as well) then can I deploy my application war file on cloud? How?
like image 386
Tiya Avatar asked Nov 25 '25 01:11

Tiya


1 Answers

There is nothing like better in war or Spring boot jar. They both are underhood same things, where Spring boot jar manages the server embedded in it and war does not have that.

Cloud Foundry has something like BuildPacks. You need to define a buildpack when you do a cf push. If you select a java build pack it has the things required to run a war on server. It gets the Java, Tomcat Server and all other dependencies needed to run the war.

https://github.com/cloudfoundry/java-buildpack

Cloud foundry creates a droplet, which is basically the execution context with all required dependencies. This is used to run the actual VM on the cloud.

You need not know which server your war is deployed to. That is the basic idea behind the cloud deployment. It may be on a single/multiple VMs under the hood. So what you need to know is something called routes. Routes are the actual addresses to your apps. You need to create routes and bind them to your application, and later app can be accessed using the routes.

https://docs.cloudfoundry.org/devguide/deploy-apps/routes-domains.html#routes

No using embedded servers is not mandatory in Any Cloud PAAS. War can be directly deployed. All PAAS platforms has support for this. Cloud foundry way of doing this is through build packs.

CF : https://docs.cloudfoundry.org/buildpacks/

Heroku : https://devcenter.heroku.com/articles/java-webapp-runner

Any application/ non spring apps which is plain war or jar can be used to run on PAAS platforms.

like image 59
Praneeth Ramesh Avatar answered Nov 27 '25 22:11

Praneeth Ramesh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!