Sunday, March 17, 2013


Rackspace Cloud - What lies beneath?

Nowadays, the term 'Cloud' no more refers to a cloud that brings rain in the season of monsoon!  It also refers to the software technology that brings a lot of benefits over the traditional and conventional methodologies of hosting your software applications.  I consider myself fortunate to grab the opportunity to work on Cloud technologies and have explored each and every aspect of the cloud offerings in its entirety.  Generally speaking the most of the Indian software companies work more on providing consultation and services to their business partners. There are very less organizations in India that has got the privilege    to make decisions for their business partners (clients).  This is fortunate as well as unfortunate in its own sense.  This can be viewed as fortunate because the organizations can generate regular income by serving their IT partners. It is unfortunate because these companies are highly dependent on their client to make decisions. They hardly get chance to explore any technology to its deepest possible level and come up with their own proposals. This is because their clients have already done the background work and give them the checklist which they have to follow.  In my view, it restricts the thought process.  Well, it’s a separate topic of discussion. :)

Like I previously said that I am fortunate to grab an opportunity to explore cloud technologies in its entirety is only because it was my personal craving to explore the word 'Cloud'.  I was part of the team who were using Rackspace Cloud for their daily deployments and maintenance.  Sometimes I wonder why word 'Cloud'?  I thought a lot over it and finally got the convincing answer from my mind that Cloud is seen from everywhere and from any part of the world, hence the creators might have used the word 'Cloud'!  This is analogous to the way we expect our Cloud-based applications to perform.  The owner of the application expects that the application should be accessible from any part of the world and should be up and running most of the times without putting more efforts in its maintenance.  I am writing this post to enable our community to make most of the cloud technologies. I will be referring to Rackspace Cloud unless explicitly mentioned.

For those who do not have any background about Rackspace Inc., it is the firm that provides cloud infrastructure for their customers.  They have great features embedded in their control panel application to administer and monitor the cloud based applications.  Just like any other technology, cloud also follows specific sets of RFC's.  RFC (Request for Comments) becomes the input for any provider to implement the new technology so that consistency is maintained between the implementations of different vendors.  The taxonomy and terminologies may differ a bit in its name but they help us to achieve the same functionality across different vendors.  Some vendors may like to take a patent or register the name of specific implementation to uniquely identify their brand name. e.g.: the design and shape of the grills near the bonnet of the cars are patented by their manufacturers so that anyone can identify the car manufacturer by looking at the design and shape of the grills!

The cloud can be viewed as the large set of Virtual Machines (VMs) that are spread across the world using millions of GB of space and many processors.  It, truly, works on the concept of virtualization where in the storage is spread across many computers across the world.  The allocation of the CPU is done on the need basis and so is the hard disk space.  Hence the main unit of billing is the usage of CPU and hard disk space used.  These are virtually known as Computing Cycles (cc) and Storage. We will discuss about this in more details towards the end of this post.

Let's jump back to the Rackspace Cloud.  I assume the reader of this post has the basic knowledge about deployment of .NET based application on local IIS servers.  The Rackspace Cloud provides many features that a deployment engineer can make use of.  The main amongst them are Cloud Hosting, Cloud Files, Cloud Servers, Load balancers.  Let's discuss one by one.

  1. Cloud Hosting:  This feature enables us to create the instance of our website.  When we want to host our website on cloud we would like to select this option.  The selection of this option depends on the web-server you may like to use. e.g.: for .NET based applications you may like to use windows or IIS, for PHP/Java you may like to go for Apache.  The deployment engineer needs to make an appropriate choice as to which platform the application is targeted. The engineer then creates the instance of the website and creates the published copy of the website.  The published copy of the website contains binaries (dlls) and the views (.aspx) pages.  The Rackspace recommends to ftp upload the contents of the published folder into the specific folder named 'Content'.  Once the content folder is stuffed with the binaries it takes sometime for the cloud engine to reflect the changes.  Meanwhile, if you are an IIS user then you must restart the application pool by using 'Rebuild Application' option available in Rackspace Control Panel Console.  The 'Rebuild Application' option gives user the ability to force restarting of the application pool so that new binaries can be loaded in the process and changes gets reflected on the website soon.
     
  2. Cloud Files:  This feature enables the storage of the files over cloud.  The Rackspace allows logical grouping of the files which are often known as Containers (Amazon S3 call it as Buckets).  The containers are the virtualization over the physical hard drives meaning the single container can spread across multiple hard disk drives.  It also serves as the unit of isolation meaning the contents of one container cannot be overwritten/overridden by the contents of the other container.  These are independent of one another.  The cloud vendors also provides the API key to programmatically manipulate the files. The developer or a software writer can upload, download, view, delete the files programmatically using the API key. The programmatic access follows all the basic rules for cloud access including the concept of the containers (and buckets in Amazon S3).  The cloud works on the principle of CDN (Content Distribution Network). This enables the cloud engine to generate a unique path for all the files that are uploaded to the cloud.  The file can be accessed from anywhere in the world over the internet using the "cdn" path.
     
  3. Cloud Servers: This feature enables the user to create the instance of the servers in the Cloud.  Conventionally, the vendors have servers in their own premises.  This setup may need an additional efforts to maintain the server.  The organization may need to design or draft the backup plans, in case, the server gets crashed.  The Rackspace frees us from all these worries.  This facility enables the user to create the instances of the server on the cloud and use them round the clock.  The overheads are taken care by Rackspace.  Rackspace provides several options to create the instance of the server. It can create the server with any platform (all flavours and versions of Windows and Linux).  There are several pre-defined images of the servers available in Control Console that facilitates easy and faster creation of the new instance of the servers

  1. Cloud Load-balancers: This feature enables the user to create load balancers for their servers.  I need to explore this feature in more details and will update the required information in this post once I get enough competency in this section.


The metrics that are used by Rackspace for the billing is Computing Cycles, Storage, number of Server Instances. Let's discuss these terminologies in detail.  These are the basic metrics used by Rackspace to generate the invoice for its clients and users.

  1. Computing Cycles:  The cloud works entirely on the concept of Virtual Machines.  These VM's uses several CPU (Processors) that can spread across different machines. Hence, there is a need to Virtualize the concept of amount of CPU usage. This is known as Computing Cycles (cc).  It is defined as the amount of total CPU cycles used by the user in performing the administrative task from the Control Panel of Cloud.  It is the sum of all the CPU cycles from all the available CPUs.
  2. Storage:  The cloud uses the concept of Virtual Storage to identify the amount of storage the specific deployment of the  application uses.  It also includes the amount of storage used by the Cloud Files.
  3. Server Instances:  The total number of servers created by the user and platform information of each server

The above information can be accessed by the user at any point of the time and the invoice is generated based on the usage. There are several plans available with Rackspace including pay-as-you-go and unlimited usage.  The unlimited usage gives 500GB of Storage and around 19,000 Computing Cycles (cc) per month (These numbers are not final  and are likely to get change as decided by Rackspace from time to time).  The cloud vendor guarantees 99.99% uptime and zero maintenance overhead with great disaster recovery mechanism. This is quite true as per my experiences working with Rackspace.

Cloud - Manage at one place, access anywhere!

Tuesday, February 5, 2013

|| Kyuki Gyan hi aapko apna asli hak dilata hai (Because only Knowledge can enlighten you) ||

Gyan - a four-letter word - your eternal voice.  Gyan or knowledge enables us to achieve something great. Gyan - to know where we want to go. Gyan - to communicate. Gyan - to achieve the highest abode. Gyan - to make ourselves feel confident. Gyan - to ease the hurdles of life.  With the help of Knowledge even the toughest challenge seems to be very easy, however, the process or journey of gaining Knowledge may be tough in its own.

For the folks who do not know - the punch line "kyuki Gyan hi aapko apna hak dilata hai" has been taken from the biggest Indian reality show named "Kaun banega crorepati" (the remake of - Who wants to be a millionare - an american series). The show is hosted by the biggest Indian superstar from the Indian film industry - Amitabh Bachchan. If I take the privilege to give a brief about him then I would say only one statement that even if he does not speak anything in his film, the expressions in his eyes would tell the entire story. He is a maestro.  If I talk more about his show then I can say that this is the show that puts your general knowledge to a tough test and awards you a big price money if you answer the questions correctly. Everyone loves him and his show, including me.  I watch the show almost regularly except for the instances when I need to stay late in the office to talk to my client to earn my bread-butter!  I miss the show because my TV is not yet equipped with the set-top box to record his shows. We all love him

Gyan - is not the modern word. Its definition has not changed since we have grown up hearing it. I am writing this blog to promote the acquisition of Gyan in my field of Software Engineering.  Software development or writing is amongst the top field that requires innovation and lots of knowledge of computers.  A field that creates a computer program to ease your day-to-day activities.  This blog post majorly deals with the importance of achieving the knowledge in software field and putting it to the real world.  I would be happy to site my personal experiences and the methodologies that I followed during my entire career to achieve the respectable knowledge in the software industry.

Starting with my college days, The first program that I wrote in C/C++ language (I guess that was the most recent programming language during the period of 2004-05) was to find the prime numbers between 1 to 10000.  Though this program does not make any sense in the contemporary real world and doesn't contain any business value, it was the opportunity for me to put my mind into words. The program had lot of defects which I couldn't foresee before writing it.  When I wrote it, I realized what went wrong where and how.  It gave me an opportunity to fix the defects which my brother already told me when he tested it!  Naah, nah.. and yeah yeh went for a very long time.  I really wanted myself to sustain the arguments which my BigB (elder brother) wanted me to get involved into but in vain.  Yes, it was almost in vain. I cannot sustain what he was expecting from me.  A good quality prime number finder??  I then worked very hard to get the things resolved.  Finally I saw him showing me his right hand thumb as a token of the success and I took a deep breath of relaxation.  Gyan enabled me to enrich my program. The knowledge of fixing defect in my 50-line program helped me to achieve what I was expecting. I sticked to the problem and I was able to put it to closure - happy ending!.  I was given flexibility to search google and find the answer and I could do it but unfortunately the code I found on G was in VB and I did not know VB that time.  I also did not know about the freely available code converters who could convert the ready-made VB code to C++.  I wrote it from scratch and published. While working on this program, I not only learnt how to find prime numbers but I could also achieve supplementary knowledge which can be applied to other programs if I happen to write at a later point of time.  Knowledge is about putting a lot of efforts to achieve great things.  I remember the words of my grandma saying "It might be very easy to appease Lakshmi (the goddess of Wealth) but very very difficult to appease Saraswati (the goddess of Knowledge)".  It requires perseverance, diligence and focus.

The process of writing C++ code was not enough and I faced a new challenge to writing the same program in assembly language (for the 8086 microprocessor). Oh God!  The instruction code does not fit my mind and I am fed up of all JC, JE, kind-of instructions.  Gyan - again pitched in. I was engrossed in learning the new (yet old) programming language for the sake of converting my program into assembly language. I am pleased to see that modern age compilers do it for free now!

Like others, I also wanted to reap the fruits of my knowledge almost instantly but it never happened.  It might be because the knowledge that I had was superficial or inaccurate initially.  Gradually when I progressed more on the path of life, I found the knowledge which I gained initially helped me to solve many questions/puzzles of my life. The only thing that I missed was to polish it.  I found it very interesting and started acquiring it more and more.  Really we never know when we will get chance to apply our knowledge that we acquired in the past.  The best way to retain this knowledge is to keep practicing it till it gets a comfortable seat in your mind. The knowledge in any form should be welcome without analyzing the degree of success we can achieve by using it. Sometimes we tend to put lot of efforts in gaining the knowledge but we get frustrated if we are not able to reap the fruits instantly.  Never mind!  The knowledge never goes in vain. It will be used somewhere at some point of time in rest of your life and can fetch you better fruits.  We all know the stories of two woodcutters who use to earn their livings by cutting the woods in the forest. The one of them was yielding better results because he use to sharpen his axe everyday.  It was the knowledge of how the axe works and what is needed to make it work better helped the woodcutter to get better results. 

The next question that comes to my mind is "how do I keep myself interested in gaining the knowledge"? The answer to this question is to keep craving to polish your knowledge.  It is quite true that there is always a scope to polish your knowledge in whatever form you have it. Studies have proven that a person may tend to stop acquiring knowledge when he gets bored. Similarly organizations may not succeed in its goals and vision if its employees complain that they are getting bored. The best way to keep ourselves motivated is to ask ourselves a question: "what did I learn today?"  The answers to this question will surely make ourselves more active and our attitude towards the journey of acquiring knowledge will change drastically.  Sometimes we get bored from our routine life because we fail to notice the interesting aspect of it.  When I wake up and realize it is the same Monday that comes every week and the same status update calls in the evening, I tend to loose the craving of reaching the office in enthusiasm.  The situation can tend to be different when I am successful in realizing that I am going to use new technology or a new algorithm today to solve the problem at hand.  This may also be explained in terms of science.  When we are excited our body tends to discharge more adrenalin which gives us a natural thrust in doing something creative.

These were few instances of Gyan playing important role in keeping ourselves motivated and free from bad happenings.  The process of achieving the great is very lengthy and may take considerable efforts as estimated by us. The process of acquiring Gyan never ends.  It keeps on growing. The modern world has been equipped with lots of technology stuff which may seem to be growing at the very rapid pace.  Gyan is the only mechanism which can lead us to explore every aspect of our day-to-day life.

I took a very fundamental examples of my life of learning.  I feel that learning never ends and I second many great learned spiritual preachers. We know that we need knowledge to unlock the miseries and mysteries of darkness of the life.  The enlightenment of life can happen only with the proper blend of knowledge and experiences.  The purpose of life tends to give you the best when we know the importance of knowledge and oppose ignorance.  The barriers of life and society can be eradicated only with the help of true knowledge.  Coming back to KBC - I heard Amitabh Bachchan saying that "Gyan kisi ki jaagir nahi hai.. woh to sirf bhatko ko raah dikhata hai" (meaning the Knowledge is not the property of anyone but it gives the proper direction to the ones who have lost their way) - Yes, kyuki Gyan hi aapko apna hak dilata hai!

Sunday, January 6, 2013


REST-based WCF services – and the masters of the universe!

The WCF framework is around us for quite a while now. Microsoft has amended the WCF framework to expose the WCF services as the REST based service using special attributes. The REST service can be accessed as easily as accessing the URL. Let’s have a look at some practical applications of REST based services. The explanation of the basics of the REST based services is out of the scope of this post. However we can get the information about it on external websites.

Creating REST based service using Visual Studio.NET
The creation of the REST based service is very similar to WCF service. The WCF service can be made REST based WCF service by applying the attribute [WebGet] on the WCF service function. The WebGet takes the parameter with the name UriTemplate that identifies the URL format to access the function.
The REST based service uses webHttpBinding for the service endpoint.

Server:


Client:



REST Service: “I have the power of the universe!”
The REST based service can seamlessly integrate any client with the server easily. The client could be a .NET client or the smart phone application. For this post, let’s discuss how the smart phone client can integrate with the REST based endpoint of the WCF service. There are various platforms available to program the smart phone applications. The most widely amongst them are iOS, Andriod and Windows Phone. These programming platforms provide the wide range of libraries to connect to the web service endpoints.  The typical application on the phone sends the request to the service and receives the data from the server in the serialized format (JSON & XML) known as response packet. The phone application deserializes the JSON/XML packet and displays the data on the application. The entire scenario is a very good example of disconnected application that involves client and server.  
The phone application can also help to perform CRUD operations using GET/POST verbs on REST-based endpoint. The typical scenario can be discussed as follows:

1.  GET (Used to fetch the records from the database):


2.  POST (Used to insert the record into the database)


The REST based service is very easy way with which the client applications written using the different platforms can communicate with the server to receive the data from the server. This communication becomes possible using serialization of the data. It is analogous to accessing the webservice using SOAP request and response packets. The webservice uses XML serialization whereas phone application widely uses JSON serialization.  The programming of the REST based service has just gained enough space in the server programming because it is easier to integrate with phone and hand-held devices. Now it is very easy for your phone to answer your questions like "find me the thai restaurants near my area", "write few reviews of some movie from your phone which can be seen on the website".  There is lot more to come in this space!

Stay connected!