ZK on PaaS Clouds: Heroku and OpenShift Express

From Documentation
DocumentationSmall Talks2012FebruaryZK on PaaS Clouds: Heroku and OpenShift Express
ZK on PaaS Clouds: Heroku and OpenShift Express

Author
Vincent Jian, Engineer, Potix Corporation
Date
January 2, 2012
Version
ZK5+

WarningTriangle-32x32.png This page is under construction, so we cannot guarantee the accuracy of the content!

PaaS Cloud

Platform as a service (PaaS[1]) is a kind of cloud computing services that provide a computing platform and a solution stack as a service. Instead of hosting and maintaining server by themselves, many companies start to take advantage of PaaS services as the offerings could be extensive and will include a total cycle of application hosting, development, testing, and deployment environment, along with a complete options of integrated services that consist of scalability, maintenance, and more. Here we will introduce how to deploy ZK applications on two popular PaaS platforms - Heroku and OpenShift Express.

Heroku

Heroku[2], owned by Salesforce.com currently supports six languages: Ruby, Java, Node.js, Scala, Clojure and Python cloud PaaS. It also provides a lot of add-ons, such as Heroku Scheduler, ClearDB MySQL Database, NoSql related database, and so on.

OpenShift Express

OpenShift[3] is a free, auto-scaling platform-as-a-service for Java, Ruby, PHP, Perl and Python applications provided by Ret Hat. It also supports MySQL, MySQLi, PDO MySQL, PDO SQLite, and Amazon-RDS database.

Deploying ZK Apps to Heroku & OpenShift Express

Traditionally the "standard way" to deploy an application to the cloud, is to package a war file and then upload to the cloud. Whenever there is a change, we will have to update the war file locally again, and then re-upload the file. Heroku and OpenShift both integrated Maven and GitHub, offering the ability to control source code versions remotely. Users can build and manage their project using Maven, and push their source code to the cloud service via GitHub and build the project on cloud automatically. The flow chart is as simple as follows:

PaaS FlowChart.png

Even though both Heroku and OpenShift supports Maven and Git for ease of deployment and maintenance, there are some differences in the usage and supported platforms. The brief steps for running ZK on Heroku and OpenShift are as follows:

Heroku

  1. Have Ruby, Git, and Heroku Gem installed and registration for Heroku.
  2. Create a maven project with Jetty or Tomcat server embedded.
  3. Add git version control to the project.
  4. Deploy the whole maven project to Heroku with git push heroku master command.

For more details on running ZK on Heroku, please refer to the Installation Guide.

OpenShift Express

  1. Apply OpenShift account or Ret Hat Network account
  2. Create an OpenShift domain name
  3. Create a default Maven project and visit the default web pages on OpenShift.
  4. Modify the project after you have created the maven application.
  5. Push the whole modified maven project to OpenShift with git push origin master command.

For more details on running ZK on OpenShift, please refer to the Installation Guide.

The Differences

Let's see more detailed features about Heroku and OpenShift with the table below:

Modified from Simon Massey's slideshare[4]
Features Heroku OpenShift Express
Deploy from source Git + Maven Git + Maven
Deploy from existing war No Yes
Container Embedded Jetty or Tomcat JBossAS 7.0
Datebase NoSql add-ons, PostgreSQL MySQL, PDO SQLite, MongoDB
Sample ZK app Yes[1][2] Yes[3][4]

From the table above you can find that both of them allow the simple Maven + Git way but each platform supports a different set of containers and databases.

Conclusion

I have deployed ZK Sandbox to both Heroku and OpenShift, and I've managed to complete the whole procedure in less than 1.5 hours for each platform even with my first attempt, which means both are easy to learn and use. The resulting performance is also satisfying. To access ZK Sandbox deployed on Heroku and OpenShift, please visit ZK Sandbox on Heroku and ZK Sandbox on OpenShift.

Whether to use Heroku or OpenShift or a different PaaS solution depends on your needs and preferences but these options will for sure benefit application developers so that we can focus more on the project itself rather than worrying about deployment issues.

References


Comments



Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.