ZK on PaaS Clouds: Heroku and OpenShift Express"

From Documentation
m (→‎The Differences: OpenShift now support Node.js)
 
(32 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{Template:Smalltalk_Author|
 
{{Template:Smalltalk_Author|
 
|author=Vincent Jian, Engineer, Potix Corporation
 
|author=Vincent Jian, Engineer, Potix Corporation
|date=January 2, 2012
+
|date=February 24, 2012
|version=ZK5+
+
|version=ZK5
 
}}
 
}}
  
{{Template:UnderConstruction}}
 
  
 
= PaaS Cloud =
 
= PaaS Cloud =
Platform as a service (PaaS) 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.
+
Platform as a service (PaaS<ref>PaaS: http://en.wikipedia.org/wiki/Platform_as_a_service</ref>) is a kind of cloud computing service that provides 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 are extensive and includes the whole 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.
  
 
<div style="margin-left:10px;">
 
<div style="margin-left:10px;">
 
== Heroku ==
 
== Heroku ==
[http://www.heroku.com/ Heroku], 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.  
+
[http://www.heroku.com/ Heroku]<ref>Heroku: http://www.heroku.com/</ref>, 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.  
 
</div>
 
</div>
  
 
<div style="margin-left:10px;">
 
<div style="margin-left:10px;">
 
== OpenShift Express==
 
== OpenShift Express==
[http://openshift.redhat.com/app/ OpenShift] 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.  
+
[http://openshift.redhat.com/app/ OpenShift]<ref>OpenShift Express: http://openshift.redhat.com/app/</ref> is a free, auto-scaling platform-as-a-service for Java, Ruby, PHP, Perl and Python applications provided by Red Hat. It also supports MySQL, MySQLi, PDO MySQL, PDO SQLite, Amazon-RDS databases, and so on.  
 
</div>
 
</div>
  
= Deploying ZK to Heroku & OpenShift Express =
+
= 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.  
+
Traditionally the "standard way" to deploy an application to a cloud, is to package a war file and then upload it 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, offers the ability to source code version controlling. User will be able to push source code to cloud service and then build the project on cloud automatically.
+
Heroku and OpenShift, however, both integrated Maven and GitHub, offering the ability to remotely control source code versions. Users can build and manage their projects using Maven, and push their source code to the cloud service via GitHub and build the project on cloud automatically.
A simplified flow chart is shown as follows:
+
 
 +
The flow chart is as simple as follows:
  
 
[[Image:PaaS_FlowChart.png]]
 
[[Image:PaaS_FlowChart.png]]
  
Even though both Heroku and OpenShift supports Maven and Git, there are some differences in the steps and design.
+
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 will be explained in the next section:
The brief steps for running ZK on Heroku and OpenShift are as follows:
 
  
 
<div style="margin-left:10px;">
 
<div style="margin-left:10px;">
 
== Heroku ==
 
== Heroku ==
# Have Ruby, Git, and Heroku Gem installed and registration for Heroku.
+
# Install Ruby, Git, Heroku Gem and register for Heroku.
 
# Create a maven project with Jetty or Tomcat server embedded.
 
# Create a maven project with Jetty or Tomcat server embedded.
 +
# Add git version control to the project.
 
# Deploy the whole maven project to Heroku with '''git push heroku master''' command.
 
# 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 [[ZK_Installation_Guide/Setting_up_Servers/Heroku|Installation Guide]].
 
For more details on running ZK on Heroku, please refer to the [[ZK_Installation_Guide/Setting_up_Servers/Heroku|Installation Guide]].
Line 39: Line 39:
  
 
<div style="margin-left:10px;">
 
<div style="margin-left:10px;">
 +
 
== OpenShift Express==
 
== OpenShift Express==
# Get Your OpenShift Ready
+
# Apply OpenShift account or Ret Hat Network account
# Create an OpenShift domain name  
+
# Create an OpenShift domain name
# Create a Maven Application
+
# Create a default Maven project and visit the default web pages on OpenShift.
#: You are able to modify the project after you have created the maven application. You can choose to
+
# Modify the project after you have created the maven application.
#* Import into Eclipse IDE (Optional)
+
# Push the whole modified maven project to OpenShift with '''git push origin master''' command.
#: and then you have to
 
# Push the whole maven project to OpenShift with '''git push origin master''' command
 
 
For more details on running ZK on OpenShift, please refer to the [[ZK_Installation_Guide/Setting_up_Servers/Red_Hat_OpenShift_Express|Installation Guide]].
 
For more details on running ZK on OpenShift, please refer to the [[ZK_Installation_Guide/Setting_up_Servers/Red_Hat_OpenShift_Express|Installation Guide]].
 
</div>
 
</div>
Line 52: Line 51:
 
<div style="margin-left:10px;">
 
<div style="margin-left:10px;">
 
== The Differences==
 
== The Differences==
Let's see more detail features about Heroku and OpenShift with the table below:
+
Let's see more detailed features of Heroku and OpenShift with the table below:
 
{| border="1" style="text-align:center;"
 
{| border="1" style="text-align:center;"
|+ align="bottom" style="text-align:right" | ''Modified from [http://www.slideshare.net/simbo1905/zk-mvvm-spring-jpa-on-two-paas-clouds-10610874 Simon Massey's slideshare]''
+
|+ align="bottom" style="text-align:right" | ''Modified from [http://www.slideshare.net/simbo1905/zk-mvvm-spring-jpa-on-two-paas-clouds-10610874 Simon Massey's slideshare]''<ref>Simon Massey's slideshare: [http://www.slideshare.net/simbo1905/zk-mvvm-spring-jpa-on-two-paas-clouds-10610874 ZK, Spring & JPA On Two PaaS Clouds]</ref>
 
|- style="background-color:#7FC9FF;"
 
|- style="background-color:#7FC9FF;"
 
! style="text-align:center; padding:3px; width:200px" | Features
 
! style="text-align:center; padding:3px; width:200px" | Features
! style="text-align:center; padding:3px; width:200px" | Heroku
+
! style="text-align:center; padding:3px; width:300px" | Heroku
! style="text-align:center; padding:3px; width:200px" | OpenShift Express
+
! style="text-align:center; padding:3px; width:300px" | OpenShift Express
 +
|-
 +
! style="padding:3px; background-color:#7FC9FF;" | Supporting Languages
 +
| style="padding:3px;" | Ruby, Java, Node.js, Scala, Clojure, Python
 +
| style="padding:3px;" | Java, Ruby, PHP, Perl, Python, Node.js
 +
|-
 
|-
 
|-
 
! style="padding:3px; background-color:#7FC9FF;" | Deploy from source
 
! style="padding:3px; background-color:#7FC9FF;" | Deploy from source
Line 73: Line 77:
 
|-
 
|-
 
! style="padding:3px; background-color:#7FC9FF;" | Datebase
 
! style="padding:3px; background-color:#7FC9FF;" | Datebase
| style="padding:3px;" | NoSql add-ons, PostgreSQL
+
| style="padding:3px;" | NoSql add-ons, PostgreSQL, ClearDB, ...
| style="padding:3px;" | MySQL, PDO SQLite, MongoDB
+
| style="padding:3px;" | MySQL, PDO SQLite, MongoDB, PostgreSQL, ...
 
|-
 
|-
! style="padding:3px; background-color:#7FC9FF;" | For ZK application
+
! style="padding:3px; background-color:#7FC9FF;" | Sample ZK App
 
| style="padding:3px;" | Yes[http://glowing-light-1070.herokuapp.com/zktodo_d.zul][http://zksandbox.herokuapp.com/]
 
| style="padding:3px;" | Yes[http://glowing-light-1070.herokuapp.com/zktodo_d.zul][http://zksandbox.herokuapp.com/]
 
| style="padding:3px;" | Yes[http://zktd2-zkdemo.rhcloud.com/][http://zksandbox-zksupport.rhcloud.com/]
 
| style="padding:3px;" | Yes[http://zktd2-zkdemo.rhcloud.com/][http://zksandbox-zksupport.rhcloud.com/]
 
|}
 
|}
 +
 +
From the table above you can find that both of them allow simple Maven + Git approach but each platform supports a different set of containers and databases.
 
</div>
 
</div>
  
 
= Conclusion =
 
= Conclusion =
I have tried to deploy ZK Sandbox to both Heroku and OpenShift, and I've managed to complete the procedure in less than 1.5 hours for each which means it is easy to learn and use. The resulting performance is also satisfying. Whether to use Heroku or OpenShift or a different PaaS solution only depends on the needs but these options will definitely benefit application developers so that we can focus more on the project itself rather than worrying about deployment issues.
 
  
 +
The process of deploying ZK Sandbox to either Heruko and OpenShift requires little effort with a very shallow learning curve with satisfying resulting performance; I managed to complete the whole procedure in less than 1.5 hours for each platform even with my first attempt. To access ZK Sandbox deployed on Heroku and OpenShift, please visit [http://zksandbox.herokuapp.com/ ZK Sandbox on Heroku] and [http://zksandbox-zksupport.rhcloud.com/ ZK Sandbox on OpenShift].
 +
 +
Whether to use Heroku or OpenShift or a different PaaS solution depends on your needs and preferences but these options are available and surely benefits in enabling application developers to focus more on the project itself rather than worrying about deployment issues.
 +
 +
= References =
 +
<references/>
  
 
{{Template:CommentedSmalltalk_Footer_new|
 
{{Template:CommentedSmalltalk_Footer_new|
 
|name=Potix Corporation
 
|name=Potix Corporation
 
}}
 
}}

Latest revision as of 01:03, 27 March 2012

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

Author
Vincent Jian, Engineer, Potix Corporation
Date
February 24, 2012
Version
ZK5


PaaS Cloud

Platform as a service (PaaS[1]) is a kind of cloud computing service that provides 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 are extensive and includes the whole 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 Red Hat. It also supports MySQL, MySQLi, PDO MySQL, PDO SQLite, Amazon-RDS databases, and so on.

Deploying ZK Apps to Heroku & OpenShift Express

Traditionally the "standard way" to deploy an application to a cloud, is to package a war file and then upload it 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, however, both integrated Maven and GitHub, offering the ability to remotely control source code versions. Users can build and manage their projects 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 will be explained in the next section:

Heroku

  1. Install Ruby, Git, Heroku Gem and register 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 of Heroku and OpenShift with the table below:

Modified from Simon Massey's slideshare[4]
Features Heroku OpenShift Express
Supporting Languages Ruby, Java, Node.js, Scala, Clojure, Python Java, Ruby, PHP, Perl, Python, Node.js
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, ClearDB, ... MySQL, PDO SQLite, MongoDB, PostgreSQL, ...
Sample ZK App Yes[1][2] Yes[3][4]

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

Conclusion

The process of deploying ZK Sandbox to either Heruko and OpenShift requires little effort with a very shallow learning curve with satisfying resulting performance; I managed to complete the whole procedure in less than 1.5 hours for each platform even with my first attempt. 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 are available and surely benefits in enabling application developers to 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.