Tuesday, October 8, 2013

WHAT IS THERE IN CLOUD FOR US



Cloud Computing, the name may have adopted because of its internet centric nature. And internet is pictorially represented as cloud and in cloud computing everything is over internet. Cloud computing is nothing but some service offer to you over the internet be it some virtual machine, some platform or some software as well.

Why there is so much fuss about the cloud computing and everyone thinks everyone has to move to cloud sooner or later to survive.

To understand this let us take an example of electricity in our house. Imagine if in every house we have to generate electricity by our self, the amount of complexity involve and more over what about failover. What if my personal power plant inside my house failed, I will be without electricity or maybe I have to have a backup plan. This would have made our life miserable. But luckily we are not creating electricity by our own we are consuming service provided by the electricity board. We consume their service to run appliance in our house be it television, microwave or a geyser. We have a standard socket that gives AC current (of some standard output), all we know is the socket we are not bother about how the electricity is generated whether is hydro electric, nuclear power , wind power or coal power. The abstraction here makes our life easier.
Let us come to how our IT departments works, we generate our own power. We have stacks of server, data storage possible every company from small to larger enterprise has a server room with stacks of server and wires everywhere and bunches of IT service people are working there day and night in order to keep it up and running. There is lots of complexity in it. We either rent the machine or buy them. When we need more machines we again rent more or buy some more. This takes lot of time and it is probably not done by click of one button. And moreover the machine are not efficiently used , I bet lot of times you would think if some machines are there really used or laying there just like that. And for developers we have to unnecessary get coupled with the IT infrastructure for own need. We should have concentrated on business logic not building our infrastructure stack. I often believe developers should not even worry about the load balancing or scaling of the application server. 

Would not it be nice if something like electricity board were there for our rescue?  We will just plug-in to some socket to get the service without worrying about how the service is created.  For infrastructure, I just plug in to infrastructure socked to get some machine, plug into another socket to get the platform I need to run my code. This is where cloud computing come for the rescue.

Cloud provides are centralized infrastructure with massive datacenter, who can deliver massive scalable service for your need.  As they are organised and specialized they will surely do better than what we do in our small clousy server room.  And their service is cost effective as they charge per usage, so no more worrying about any unused machines lying in my server room.

Some cloud offering is public. A public cloud is one based on the standard cloud computing model, in which a service provider makes resources, such as applications and storage, available to the general public over the Internet. Some clouds are private cloud. Private cloud (also called internal cloud or corporate cloud) is a marketing term for a proprietary computing architecture that provides hosted services to a limited number of people behind a firewall. Some providers like HP provide private cloud space for companies who are sensitive to put their data across geographical location or wants to have control over their data. Some cloud is hybrid as name suggests combination of private and public cloud

Cloud offers three flavours of services:
IAAS: Infrastructure as a service: Ask some virtual machine and we get the machine. Customize the machine and hit the replicate button to get as many as you like. Amazon EC2 and SP are the most successful IAAS provider
SAAS: software as a service. There is some predefined software in the cloud as service. Google apps are best examples of SAAS.
PAAS: Platform as a service: Cloud gives you a platform to work with be it development, build , test or anything else. Today’s PAAS providers provides full range of ALM services ranging for code repository, automating build and deploy, ever monitor. They also provide production environment. they will take care of traffic, scaling up and even scaling down in case of low traffic, clustering etc. heroku, redhat openshift, cloudbees are some of the PAAS provider.
Now we have fair idea of what cloud is but what is  there for us (developer/coder) in cloud. 

What is in cloud for us?
More companies are taking on the cloud, which means more development teams have to deal with the cloud, define what it means and make it work for their applications. Cloud will provide as mainly two kinds of work.
A)     Work as cloud provider
B)      Work as application running on cloud or migrating legacy application to cloud.
As cloud provider
We can get our self involve in development for cloud provider. Every other company is now setting up their own cloud service.  Amazon, Google, Redhat, HP, Oracle to name a few. There are few open source project that provides framework for setting up cloud solution.
 
OpenStack is a open source project that delivers a massively scalable cloud operating system.  OpenStack was originally developed by NASA and Rackspace, and is also backed by the likes of IBM, HP and Dell. It's primiraly series of three core projects that can be used to build a private cloud platform: Compute, Object Storage and Image Service. These three projects provide the base for managing virtual servers, storage and machine images. The core projects do not provide a self-service portal, but there are OpenStack-incubated projects that do. OpenStack provides full hypervisor support for KVM and Xen, with limited support for Microsoft Hyper-V, Citrix Xen Server, VMware ESX and others. Persistent storage is provided using OpenStack Object Storage to manage the local disk on compute node clusters. Lastly, machine images of various types (including Raw, VHD, VDI, VMDK and OVF) are managed through the OpenStack Image Service. 

CloudStack has been around since 2009 and is implemented in more than 100 production clouds (including GoDaddy, KT and Tata). It's governed by the Apache Software Foundation and supported by Citrix and about 50 other technology partners. Unlike OpenStack, the CloudStack installation is very streamlined and well documented. The CloudStack open source code was acquired by Citrix with the Cloud.com acquisition and released as open source. This gives CloudStack a head start as it was already software being used in production. CloudStack is designed for massive scalability and centralized management, allowing tens of thousands of geographically distributed servers to be managed from a single portal. CloudStack software works with a variety of hypervisors, including Oracle VM, KVM, vSphere and Citrix XenServer, with Oracle VM being a key differentiator from CloudStack. Another differentiator is support for bare-metal servers. Additionally, CloudStack supports multiple networking models, such as OpenFlow, VLANs and flat networks.
More on openstack and cloudstack is out of scope for this blog. Refer the reference column to know more about openstack and coudstack. They have readymade virtual machines to download and kick start your own private cloud.

Work on application running on cloud or migrating legacy application to cloud.
We can also tailor our existing application to deploy it into cloud or create application that can run on cloud. There will be a time when if not all, majority if the software that we will develop will be cloud supported. There are lot of PAAS provider that provides us to development and runtime environment for our application. Though most of them are still in their beta phrase, I picked some of them and almost all of them have free account for development. So created account in some of the providers to see how much I have to come out of my traditional programming to make my application run on cloud. Most of PAAS provider support programming language like java, ruby, scala mostly language that runs on multiple platform. For .Net programmer you have the option to check out Microsoft Azure cloud, they support .Net. I being java developer from my birth chose to evaluate java application with some of the cloud providers

Salesforge, Heroku, Cloudbees.
To my surprise I don’t have to do much refactoring to deploy my application to cloud. There are changes like
a) I cannot code to specific application server or database. Most of the providers hibernate for database connectivity so that the application developers are abstracted to the underlying database type.  Providers like Heroku expose data source name as environment variable to be used by the code and they provides MySql database only.
b) I cannot write to a file directly , In case I need to I have to use their API like Salesforce provides some objects base I/0 provider API to make write operations.
c) As scaling /clustering will be there we are discourage to depend heavily on HTTP sessions state. If at all any state needs to be maintained save it with their persistent API.
Similarly there are some areas we need to refractor our application to support cloud environment. The list is minimal but there are different list for different providers. Refer to the provider’s website to know more.
We developer’s scope is not limited here, with the popularity of cloud lots of new trends are immerging like NoSQL, Object based I/O to name a few. With application on cloud there won’t be issues in scaling or infrastructure, this will give us more time to make the application do what it is meant to do better. But the downside of cloud is that it is mostly based on “Everyone fits one size”. Remember the example of electricity, we cannot ask for socket with 420 volts or socket of 100 volts. It is standard 220 volts so we have to ensure our application works on 220 volts. Same goes with cloud where we have to tailor our application to fit to cloud not change the cloud to fit our application needs.

References:

No comments: