Coding for the “Cloud”

Overview:

These day’s everyone is talking about the scalability of the cloud, and its abundance of uses, however few of them are talking about how to properly utilize the technology. Cloud Infrastructures are designed to be able to scale in a linear fashion rather than a “vertical” like that of dedicated hardware. When scaling with dedicated hardware the first step is to build up what you have. Typically people start off with a smaller server which is cheaper and add ram / disk as needed. Once the hardware can no longer be upgraded, they then start to expand linear.

The cloud also gives us the ability to do this to some extent, however its value is not in building your environment to match that of a dedicated environment. There are technologies which allow you to scale your application and infrastructure in a linear fashion from the start. One of these opportunities is database infrastructure. Its a well known fact that database servers are I/O, CPU, and Memory intensive and require lots of hardware, and money to maintain. Usually this is done on a single high end server which can cost several hundred even thousands of dollars a month, and is pretty limited in its scalability.

The current standard database implementation for linux based servers is MySQL, which provides a very good base for tons and tons of applications, however is not really designed to scale or be utilized within a cloud environment. Now if you stop looking down the old and crusty path of using whats proven and start looking in other directions to see what software exists to take full advantage of the cloud technologies you will find lots of other options. Some of these include Cassandra and Hadoop. Cassandra, and Hadoop were designed from the ground up as “Distributed databases“, and are ideal for a cloud environment as they split up the work load across many nodes rather than a single server. Clearly this has advantages and disadvantages, however if you are planning your new application around this from the start you can design for a scalable solution rather than trying to make something scalable once its already in production.

Features:

So what are these features that the cloud can offer? Here are a few of the most common features, but also the most utilized:

- On demand servers. Virtualization allows us to create new servers with the click of a button.

- Public API’s. Most current cloud providers allow public API access which allows developers to deploy new servers on demand as their application requires. Additionally these API’s can perform other functions like backups, resizes, rebuilds, and deleting of servers on the fly.

- Scalability. This has already been briefly mentioned, but the possibilities are nearly endless.

- Cost. Most cloud offerings at the time of this writing allow either utility based billing or low cost solutions. This in itself can be very powerful to a company as it allows you to build out a much larger infrastructure at a portion of the cost of having dedicated hardware

Cons:

As with any technology there are also drawbacks to utilizing the cloud. Some of these are as follows..

- PCI compliance. Due to the nature of most cloud offerings being a multi-tenant environment PCI compliance can become an issue. This can sometimes be mitigated by passing off CC processing to dedicated hardware which is PCI compliant, while your main website remains in the cloud.

- Not disk I/O Friendly. Generally speaking cloud technologies which provide persistent storage may not be the best solution when it comes to applications that utilize lots of disk reads and writes. This is a limitation of cloud infrastructures being a multi-tenant environment and the good old “noisy neighbour” issue.

- Not a fit for everything. There are still many many applications that simply put are not cloud friendly, and must stay in dedicated environments. There are still portions of your infrastructure which you could bring to the cloud, but in many cases good portions of it must stay in dedicated hardware.

Conclusion:

It all boils down to designing your application and infrastructure for what it will end up being, not for what it is right now. If you design it with the idea that its going to expand and become much larger in the future you will have a much easier time trying to scale it. Additionally you will not have as many road blocks, and overall your application is going to perform as expected for a much longer period of time. This can also reduce cost in the long run as well since you will not have to go back and start doing all of this from the ground up. For more information about how to scale in the cloud talk to your provider. They are a great source of information and should be able to help assist you from a consulting perspective, any maybe even with implementation depending on your support agreement.

Comments
One Response to “Coding for the “Cloud””
Trackbacks
Check out what others are saying...
  1. [...] fit? by Tim on Aug.10, 2010, under Tech This article is a follow up to my original called “Coding for the Cloud” which focused on a broad range of topics and provided a high level overview of how to use [...]



Leave A Comment