Going for the Clouds

Intro

I have a very simple spring boot based project that I needed to host somewhere cheaply. In case you missed it, cheaply is the keyword here. I had no budget for it so free is perfect, and a couple of dollars per month is the max I can afford. Luckily my project has no need for a database which greatly increased the options available to me.

The Contenders

As usual, I started with a web search. After a couple of hours, I had my top three contenders; AWS, Heroku and GCP. Heroku free tier offering wasn't as enticing as the other two. Now AWS vs GCP! I did some work with AWS before (Lightsail and very shallow but hey I did something with it before). So, GCP here I come.

GCP for devs

If you have the time, start here please. If not, then here is the gist of it:

Compute Engine

Pick this if you need an actual virtual machine. They do offer some huge machines with some nice magic for dealing with desks. You'll be charged for resources (not usage)

Kubernetes Engine (GKE)

The name says it all. If you have clusters/collections of containers, then this is for you. Also, resource-based charging.

Cloud Run

The new kid on the block. Any container image with code listenning on $PORT for http, and google will provide SSL termination, configurable concurrent requests per container and autoscaling. Or direct integration with GKE for some fine-grained control.

App Engine

Offers both standard (predefined runtime environments such as java 11, python, ruby , ...etc) and flexible runtimes (your container whatever it is). Excellent if you desire scaling capabilities, versioning and traffic splitting. Now you are getting charged per usage.

Cloud Functions

You have a function that needs a home? Great, you just found it. Requires you to think in events though.

My Choice

Since my project is a simple spring boot app, it lent itself nicely towards the app engine. I only had to follow a simple recipe:

  • I upgraded my project to java11 to take advantage of the simpler structure of the app engine java11 runtime.
  • Added a simple yaml for the details of runtime and some environment variables.
  • Finally, added a maven plugin (an alternative choice is available for Gradle lovers as well).

More details to follow in another post.