Tuesday, September 24, 2013

Demystifying Cloud Computing: What it is and learn more about OpenShift

Today I though it would be a very good day to talk about Cloud =) This buzz word that you hear every corner and people talk more and more about it. But what does it really mean? Let's find out now! First things first, a Wikipedia's quote below to give an introduction but we can clarify it more without being too wordy:
"... commonly used to refer to network-based services which appear to be provided by real server hardware, which in fact are served up by virtual hardware, simulated by software running on one or more real machines. Such virtual servers do not physically exist and can therefore be moved around and scaled up (or down) on the fly without affecting the end user - arguably, rather like a cloud."
So, to help you to make a clear picture of this, I will try to put some other way a bit longer and friendly: the cloud isn't something new, it just is a sum of many concepts that came before it and (most of them) were already there. For example, what is really behind the cloud (the other edge of the wire) is a computer, but it is probably running many more applications than you are now due it has to handle not only you, but many people in the internet.

But to you find that computer (let's say that you want to search in Google's web site), you need to know how to find the where the Google's server is (of course in Google case, there is thousands of server, many already configured to answer you due your geo-position). To make an analogy, think a messaging application (gtalk, hangout, skype, etc) installed in your computer/laptop,  you are talking directly to anyone you know (I'm simplifying things, ok) due in some moment you added them. Roughly speaking, in the internet it is more complex; the names you type in the URL are resolved by special servers called DNS which will have the real address of the host which is the IP of these computers that you want to find (known as DMZ) .

OK, now that you know there is a computer in the other side (and some thousand of devices to help to connect both sides)  and you know about the DNS, so you know that when you open your message application, it is just searching the address of the other edge to talk to another application  like yours.  But there are (many many many) more things. Like in quote in the beginning, you and your application think that you are talking to a real server (just like yours, for example) but in internet it ins't true in most of case. Due many reasons (e.g. to lower the money spent and to maximize the hardware usages of those servers), the companies uses special application in those servers that make each server to simulate many servers it wishes, due that the term virtual server. This way, a machine with one CPU/core can run 3 virtual servers that will share the resources of that machine. This is called virtualization.

**Sorry it TL;DR, from this part things are pretty more interesting**

OK, now you know that there are many devices between you machine and the virtual server you want some information in other side. The cloud is the various types of ways to provide (or help to provide) the information to you. So, to we understand better the cloud (their business model, for example) we need to understand their Service Models. The models are Infrastructure as a Service(IaaS), Platform as a Service (PaaS), Software as a Service (SaaS). The IaaS is just like the virtualization we saw above, for example, when you want a web site in the internet, there are many ways to archive that, but if you want to have the full control of the server that your web site will be hosted, you will need to have a virtual server which is provided (/created) by some vendor like Amazon using their EC2 or Nova virtual server in OpenStack Cloud solution. But, let's say that you don't want to have all the work to configure your infrastructure, want just an application server like JBoss (or a servlet container like Tomcat, can be any middleware) running to you configure it and deploy your application (in this case a web site), this is the PaaS that you can find using OpenShift, Heroku and others. The last one, SaaS, is when you sell your software/technology which runs in the cloud, for example the Dropbox sells its service (to storage in the cloud). (There are others Service Models, but these are the main ones)

Nice, if you got here we can already go to next step =) The Deployment Models of Cloud Computing. This is very easy to explain and I'm sure you will get it very easy =D. We said earlier about some Services that our cloud can provide, right? But we missed a very important thing: where? The service can be inside your company or in your house and maybe it is not accessible directly throw the internet, those types are the Private Cloud. You may want to make your cloud accessible to the internet or even using one (or more) of vendor like Amazon (which you can access using internet), those are the Public Cloud. There is others  a Deployment Models, such as Hybrid, but let's stop in those two that is already pretty awesome that your learned all these things.

Now that you are a Cloud Computer expert ( ;) ), let's talk about OpenShift. One of the many aspect that I love OpenShift is due it is Open Source with the Origin project, with that you can create your own PaaS (for both Private and/or Public Cloud) for more information take a look here. The second very cool fact about OpenShift is that  you can find the project running and use it for free too!!! It is called OpenShift Online which gives your awesome experience that I would like to give some more details of the installation to help you to lunch your applications in the cloud using this post =) There is also a subscription to get more help and answers from articles from Red Hat, called OpenShift Enterprise.

OpenShift has some languages in their documentation that you might find a bit difficult to understand in the beginning but is just few words =) First they create an abstraction to the hardware that you can put to an application to use, like CPUs or how much memory, this concept is called gear. D you remember the example I gave with JBoss that you might want to use to run your application? The things you want to install like JBoss, MySQL, MongoDB and etc are cartridges (which will help to run your application). To understand the OpenShift architecture you might  need to first know that there will be Nodes which are the (virtual) servers that will run the application+cartridge and the Broker which handle the nodes.

Awesome, you now an OpenShift expert!! Congratulations!!! But let's first practice the theory learned so far. First, to use the OpenShift Online you need an account, so sign up here . Cool. you might need to install some tools (Git which is a version control system, Ruby to install gems and rhc, that is the tool to manage your applications running in OpenShift). Below the command for Fedora:
sudo yum install rubygems git
git config --global user.email "me@here.com" #Good practice
sudo gem install rhc
rhc setup
The next steps is to continue the tutorial of the site that you might have seen when you created your account. This will lead you to create your domain, a sub-domain for an application and selecting the cartridges and gears for the application. Then you can clone the application and make changes in your application, and easily push to update your application running in the cloud!

The another advantage about OpenShift that you might not noticed but you will realize that there is no vendor lock-in, you are just using the usual tools that you might need to build any project for your enterprise. You might also have seen that OpenShift has many cartridges with cool things already pre-configured  to you and also you can create application using Java, Ruby, PHP, Python, Node.js, Perl and others languages.

There is a portuguese article that gives you a good tutorial made by Hanneli about how to setup and lunch your first application just using command-line (CLI) in this link.

Hope you have enjoyed the article and follow us to see more articles about subject that matters =D Feel free to send your comment.Thank you!

No comments:

Post a Comment