Support: 1-800-961-4454
1-800-961-2888

Code to Scale in the Cloud

The coming year will likely see unprecedented growth in cloud computing, especially as people become more comfortable with the interaction of the interfaces and security becomes more stable.

One of the things that drive people to the cloud is scalability. The ability to scale up or down at a moment’s notice is one of the cloud’s greatest benefits. Scaling is vital for anyone who expects usage to increase – say a major product launch that will bring thousands of new visitors to a site. Scalability in the cloud allows users to expand or contract when they need to.

Vertical Scaling

Vertical scaling is the easiest. Essentially it resizes your server with click of the button and no change to code. The downside is that vertical scaling is limited by the fact that you can only get as big as the size of one server. If that larger size server still can’t absorb the traffic that is hitting your site, you are stuck.

I like to think of vertical scaling like a blowfish and web traffic like an aquatic predator such as a shark.  If the predator is a smaller shark, the blowfish could inflate and scare the little shark away.  However, if the shark is the size of a Great White, there is no amount of puffing up that the blowfish can do to prevent the shark from overtaking him.

Horizontal Scaling

Horizontal scaling affords the ability to scale “wider” to deal with the traffic. Essentially you could run your application on multiple servers, with the ability to add more servers that can help handle the traffic.

Keeping with the aquatic analogy, horizontal scaling would be like a little fish, such as a sardine, coming together to form a school of fish that can synchronize their movements to thwart the shark. If a shark were to attack this group, he might get a couple of them but there is no way for him to get all of the fish.

When customers hear of the differences between vertical and horizontal scaling, most of them reply, “I want to scale horizontally for sure. I want that big cluster of servers to handle the traffic.”

However, you must note that horizontal scaling can’t be done on a moment’s notice. Horizontal scaling requires some advance planning – you have to prep for it. You have to make sure that all your code is in line, that your resources are available and that your architecture can handle this type of scale. You essentially have to break down your code into different functions that scale on their own, such as webheads and databases.

Our Managed Cloud Rackers can be a strong partner to help you code to scale. While we support many of the core technologies when it comes to web hosting, our level of expertise does not extend into customized applications.

To ensure that you are coding your application to scale instead of coding to fail, you should consider the following four points:

1) Have a load balancer in front your configuration

That is the most important, easiest and beneficial thing a customer can do. Even if you are going to host a single server, host it behind a load balancer. The reason is that the support team can move the server around or add a server without ever having to change the DNS.

2) Split out different layers of your configuration

Make sure that you have the different layers of your configuration split apart so that you can “turn up” what is needed. Think of an equalizer on a stereo – it gives you the ability to turn up the treble or tone down the bass independently of each other. You want to have this same ability on your config, to be able to increase the webheads or the database independently of each other.

3) Develop for horizontal scaling from the beginning

As you develop your application or software, have the conversation with your development team to let them know that you want to scale horizontally.  An ounce of prevention is worth a pound of cure, and your application will be ready to go if you plan to scale horizontally from the onset.

4) Give your Rackspace Managed Cloud team a call

While not experts on your particular application, we are experts in most of the web technologies and infrastructure and can help provide insight on what has worked in the past. If we can understand the function of your site, we can understand what type of traffic you might encounter and can make suggestions on how to handle it.

If you consider these points as you begin creating an application for the cloud, you will be able to code to scale instead of coding to fail.

Check out Joseph’s previous video where he discussed a strategy on troubleshooting in the cloud. You can also watch the next video where he talks about how the Managed Cloud team at Rackspace supports you and your business. Learn more about how the Managed Cloud offering here at Rackspace.

About the Author

This is a post written and contributed by Joseph Palumbo.

As a founding member of Rackspace's Managed Cloud Support Team, Joseph spends half of his time teaching customers about the Cloud and the other half learning about the Cloud from them. When he's not in meetings, he can be found presiding over cultural happenings around the Rackspace office, discussing support innovation with other 'Fanatics' and wishing paper documents had a built-in search function.


More
Racker Powered
©2014 Rackspace, US Inc.