Saturday, July 12, 2014

AppEngine Managed VMs hands-on

Google finally released documentation for a feature they publicly announced a few weeks ago already: Managed VMs for AppEngine. I knew from the first time I heard about it that this is going to be a great new addition to the Google Cloud Platform.

In case you haven't heard of Managed VMs before: it's pretty much exactly the same like Heroku. Google allows you to deploy your server on preconfigured VMs for easy setup, but you also have the freedom to do... pretty much everything with this VM. Compared to AppEngine, this is completely different: AppEngine has several restrictions in order to "enforce scalability" of your code (e.g. no local files, no threads, etc), but sometimes you simply need those things - even if it's only that you can't afford the time to modify your existing server code base so that it works in such a restricted environment. In that case, you want to use Managed VMs. You don't have as much restrictions, but you can still take advantage of some of the AppEngine-only features, like Datastore.

Another usecase of Managed VMs is if you want to use some exotic language / framework which AppEngine doesn't support. One example: Dart - although support for Dart on AppEngine is coming pretty soon I'm sure. With Managed VMs you are able to (automatically) configure VMs in such a way that it is able to host your Dart server.

One thing that I was really disappointed about when I read the documentation for Managed VMs is that currently only manual scaling of instances is supported. This means you don't have the advantage of a "real" AppEngine server, which scales infinitely if need be. However, this feature is "coming soon" according to Google engineers...

Minor annoyance: you configure VMs using XML. Yikes! So for example if you want to install git on all your VMs for some reason, you would have a config like this:
I'd have preferred to write a bash script or something, but okay...

From what I understand it seems that we will be able to use Docker-containers in the future to configure our VMs. That would be awesome indeed! (blogpost explaining Docker coming soon hopefully)

Google AppEngine Managed VMs are invite-only right now, but I think you can expect an invite within a few weeks or so if you sign up. When this eventually goes public it would make the question Google AppEngine vs. Heroku more of a question of pricing and which ecosystem you prefer, rather than a question of features.
And with automatic scaling of Managed VMs "supported in a future release" I can only recommend giving AppEngine a try!

If you want to find out more about Managed VMs I recommend you to take a look at the documentation first, followed by a glance at the Java sample.

Oh, and while we're at it: Google is giving away credits worth 500$ for its Cloud Platform. Simply go to g.co/CloudStarterPack and enter the code "GoogleIO"!