Sunday, April 14, 2013

Exploring Cloud Foundry with Spring Stack + Vaadin

Update 2013/07/21:
Since Cloud Foundry deprecated its free-tier on 2013/07/01, the sample application went offline. As of today, I have successfully migrated the application (offline since Sept 2017 after Redhat withdraw their free-tier offering) to Redhat's OpenShift.

I have been reading about Cloud Foundry for a while and finally got around to trying it out.


Cloud Foundry provide an interesting cloud play which isn't quite the same as PaaS pure play such as Google App Engine and Force.com, while provide way more tools and support then a IaaS such as Amazon EC2.

The Test Application

To test out cloud foundry, I decide to build an application that has a Web UI component and also a periodic schedule background job component.

About a year ago, I read about the Hong Kong Government Data.One project, a similar project to other initiative around the global where Governments make public data more accessible to the people. Although Hong Kong Government is quite a bit behind in this area, I am very happy to see actual progress are being made and more dataset are being added.

With this resource, I decide to build a application that pull changes from the Restaurant License data set from  the Food and Environmental Hygiene Department every day and import in into a database and track the changes.

Basic Components and Technology Overview

The application is deployed on Cloud Foundry - http://hkrestaurants.cloudfoundry.com (Unfortunately cloudfoundry ended its beta/free-tier, and as a result the application is no longer available).

The UI is quite primitive right now, but it is setup to import data daily and the changes are tracked using EclipseLink History Policy feature. After collected some more data, it might be interesting to see what are the latest restaurants in Hong Kong daily, and create some interesting visualization base on this the historic data.

Impression of Cloud Foundry

While Cloud Foundry is still in beta, so some problems was expected. When I first it out, I did encounter some problems trying to build a standalone app to do period import from an external data source. I did manage to get over the problem, by re-installing Ruby and VMC, but what happened exactly is still a mystery.

As far as I know, we can only deploy standalone application using the VMC tool. The VMC tool is build on top of Ruby. I am no expert in Ruby, but I believe Windows isn't a first class platform for Ruby. For example the very useful RVM, tool to deploy and manage multiple version of ruby, isn't available on windows. I know there is pik, but there are some oddities with it and it feels unpolished, even for a command-line tool. Besides, it appear abandon with no significant update to the project for 2 years, 45 outstanding issues and some outstanding issues date back 3 years.

Having said the above with the VMC tool, deploying Web Application is a breeze due to its amazing integration with Springsource Tool Suite (STS)! Re-Deploying the Web application is as simple as a click!


In conclusion, I think the technologies behind Cloud Foundry is an interesting one. Because the technologies are open source and widely adopted, such as PostgreSQL or MySQL vs GAE's proprietary datastore, this provides a very enticing no-lock-in ecosystem which Enterprise customer may found very attractive. The no-lock-in is fundamental to the promise of Cloud Foundry due to the opensource technology stack supported by its cloud and its opensource tool set design to interact with it. Few companies has sprung up based on Cloud Foundry such as AppFog, Tier 3 and AppClound by Uhuru Software, Inc. As they are based on the Cloud Foundry, the migration from one provider to another should be relatively straightforward.

I am familiar with Google App Engine and Amazon EC2. I am not that interested in Force.com due to it proprietary language. Here are some interesting cloud I would like to try and learn more about:

  1. OpenShift
  2. Azure
  3. OpenStack
  4. CloudBee
For Openshift and Openstack, I am not even sure whether it is a PaaS or IaaS play, so there are lots to learn. Do you know of another PaaS or IaaS provider that I should take a look?

3 comments:

  1. Saw this post from Codeaholics group. Are you interested at hosting your web app or building your own PaaS?

    I had some experience in hosting at Cloudfoundary, AppFog, and Openshift. I found that Openshift is more flexible (you can even ssh into the instance).

    Openstack is for building your own IaaS, some people got CloudFoundary running inside Openstack but I don't the resources to try it.

    ReplyDelete
  2. @Eddie thanks for your comment. I am just trying out cloudfoundry to educate myself. I dont have any serious application to host, nor do I have any plans to build a PaaS.

    ReplyDelete
  3. @Leonard, me neither, but since it's free account, it is very good to try a lot of different things. Check this page out for Openshift:
    https://www.openshift.com/developers/get-started

    I've recently tested out Tiny Tiny RSS deployed at openshift (https://www.openshift.com/quickstarts/tiny-tiny-rss) to replace my Google Reader, quite easy and fun.

    ReplyDelete