Welcome to the VirtuQ Forums.

basant

Cloud Application Development: Introduction

Rate this Entry
This interesting articles is shared by Anil Sharma. He can be reached at https://in.linkedin.com/in/anilsil.

#####

Have you ever thought about application development in cloud? First thing first let’s understand which cloud (layer) we are talking about. The basic definition of cloud would be virtual resources or services which you can access over internet or network while you don’t worry about underlying infrastructure. For example, if you want to develop an application for ‘Internet of Things’ you may choose to deploy your application on IBM bluemix while using various services provided by it without actually worrying where and how they are hosted.

There are different layers of clouds in general which is presented as below. We’ll be mostly concentrating around PaaS – Platform as service and best practices of application development on PaaS. I’ve particularly experimented with cloud foundry which is available as both open source version and enterprise version from Pivotal.


Service
Examples
SaaS
Software as a Service
Salesforce.com
Google Apps
Zimba
workday
PaaS
Platform as a Service
Cloud Foundry
Windows Azure
Heroku
IaaS
Infrastructure as a Service
Amazon Web Services
rackspace


Infrastructure as a Service (IaaS)
Infrastructure as a Service (IaaS) is a form of cloud that provides virtualized computing resources over the Internet. The examples are Amazon web services (AWS), Rackspace or your hosting provider where you have deployed your newly registered website etc.

Platform as a Service (PaaS)
Platform as a service (PaaS) is a layer of cloud services that provides a platform allowing one to develop, run, and manage applications without the need of building and maintaining the infrastructure typically associated with developing and launching an app. The examples of easily available PaaS offering are cloudfoundry, heroku, azure. If you have developed application for facebook then you probably know that you can freely deploy it on heroku. Also you can choose any hosted PaaS environments like Pivotal Web services (PWS).

Software as a Service (SaaS)
These are on-demand hosted software which are generally available on subscription model, accessed via web-browser. The example are google docs, workday, salesforce etc.

Since we are discussing application development for cloud on PaaS, these are few general benefits of PaaS like cloud foundry-

  • As a developer you focus on application code.
  • It abstracts virtual machines and middleware.
  • It abstracts containers and process.
  • Provides data related services.
  • Eliminate bottle neck of provisioning and deployments.


As it is clear that in cloud application development you actually focus of your app code while in traditional development model you focus more about environments, configuration and dependencies of application being developed.

Let me give glimpse of developer experience on cloudfoundry PaaS offering.


  • Target your cloud foundry provider, choose where you want to deploy (local, private PaaS or hosted PaaS)
  • Push your application to target
  • Bind services to your application (like database, email, AMPQ bus…)
  • Scale your application as needed.
  • OutofBox monitoring of your application’s health.
  • OutofBox monitoring of your application’s logs.
  • OutofBox monitoring of your application’s performance.


Now what are the basic considerations for building cloud native applications, these are known are “Twelve factor app

  • CodeBase – one codebase, multiple deployments
  • Dependencies – Explicitly declare dependencies
  • Config – Store configuration in environment, outside application
  • Backing services – Treat backing services as attached resources, you can bind & unbind as you may want.
  • Build, release and run – Separate build and run stages
  • Process – Execute applications as stateless process(es)
  • Port binding – export services via port binding
  • Concurrency - Scale out via process model
  • Disposability – fast startup, graceful shutdown
  • Dev / production parity – same environments for development, test and production
  • Logs – Treat logs are event streams
  • Admin process - Run admin / management tasks as one-off processed.


This twelve-factors methodology is applicable for apps written in any programming language using any or many backend services.

If you want to tryout a basic cloud native application, download this sample application from the following git location https://github.com/anilsil/spring-demo.git . This is a spring-boot application which is basically a java application that will run into tomcat. Here are the steps to run it in cloud-foundry.




Code:
 >cf login -a api.my-unique-domain.io
 >cf push demo-app

The last command
cf push shall deploy your application to Pivotal web services hosted cloud foundry PaaS, on completion it would give to following details which shall contain url of your “Hello World” cloud demo-app application. As you see, you did not even specify that it is java application because cloud foundry detects it automatically but you do have option to specify if you want.

Code:
requested state:    started
instances:              1/1
usage:                   512M x 1 instances
urls:                      demo-app.my-unique-domain.io
last uploaded:       Sun Jun 19 14:23:55 UTC 2016

Give it a try and enjoy.