Schedule a chat

Super Cheap and Flexible Hosting of your Go Application

Apr 2, 2017

We have lots of ways to host web applications these days – AWS, Google Cloud Platform, Digital Ocean, Vultr, Heroku, Linode – the list goes on. But as many options as there are, each option comes with its own potential set of challenges. The cheaper VPS options don’t always provide an easy means to scale your application with load balancers, health checks, and autoscaling features. More expensive options like AWS have the means to scale your application, but require a more complicated setup process and cost more money.

I began a search for a nearly free way to host a prototype application that has the ability to scale (for more money) if needed and has a backing datastore of some sort. Since I’ve used AWS almost extensively for the past 8 years and host both my own and clients’ applications there, it was the natural choice.

While AWS does offer a free tier for 12 months, I’m well past that threshold and so any micro instances I launch are immediately billed, so to start I’m looking at close to $30/mo for a single instance + load balancer. I didn’t want to spend another $30/mo for an RDS instance as a backing datastore, so I began working with DynamoDB – that seemed to fit the bill. After a bit of experimentation, it became evident that the use-case for this application (fetching a handful of calendar dates quite often) would burn through quite a bit of DynamoDB throughput everytime the application was accessed. What I thought was a solid choice just didn’t fit well.

Left without any nearly free datastore options I decided to re-evaluate Google App Engine. While App Engine does have a more modern Flexible Environment, that environment is also far from free. However, the Standard Environment promises:

  • A free usage tier until I need to scale and billing kicks in
  • Billing limits
  • Access to other Google Cloud Platform services like Cloud Datastore

Cloud Datastore offers a similar experience to that of DynamoDB, but has a much more attractive pricing model with a free daily quota of 1GB of storage, 50,000 entity reads, and 20,000 entity writes. DynamoDB seems to offer inexpensive pricing, but charges based on throughput. For an application that needs to return a chunk of entities at a time, Cloud Datastore is the better option.

To summarize, this is now a Standard App Engine Environment serving a Go application backed by Cloud Datastore for $0/mo and has the flexibility to scale if traffic increases (additional charges of course).

This also isn’t limited to Go – App Engine Standard also supports Python 2.7, Java 7, and PHP 5.5.

In this particular use-case, App Engine definitely wins the super cheap and flexible hosting award!

comments powered by Disqus