Moving your application to the cloud isn’t as simple as porting your code over and configurations to someone else’s infrastructure – nor should it be. Cloud computing represents a shift in the world of application architecture from vertical scalability to horizontal scalability. This new paradigm offers organizations the opportunity to build highly scalable and dynamic applications. However, if you’re not careful or purposeful in how you prepare for the cloud, your application could suffer.
Horizontal vs. Vertical Scalability
The biggest fundamental difference between the cloud and your data center is the cloud is typically run on commodity hardware, rather than the powerful machines in your data center. This means having to write an application that’s horizontally scalable instead of vertically scalable. Google probably best described what this means for your application architecture in their blog on highscalability.com:
A 1,000-fold computer power increase can be had for a 33 times lower cost if you use a failure-prone infrastructure rather than an infrastructure built on highly reliable components. You must build reliability on top of unreliability for this strategy to work.
In other words, it can be cost effective to run an application on cheaper, less reliable commodity servers instead of more expensive and powerful machines. But in order to be successful, the software component needs to be highly scalable – even infinitely scalable – and resistant to failure. These two requirements guide many of the architectural decisions of cloud pioneers like Netflix, and give a good indicator of what’s required to be successful in the cloud from a performance standpoint.
Architecting for the Cloud
Very few organizations have the same requirements from their applications that Netflix does. With tens of thousands of nodes in the Amazon EC2, Netflix is undoubtedly a pioneer in cloud architecture. Even though most organizations will never need the scale that Netflix does, these architectural practices and strategies are relevant to anyone building in or migrating to the cloud.
Here are a few of the ways Netflix takes advantage of the cloud, from a presentation by Netflix’s Director of Cloud Solutions, Ariel Tseitlin.
Service Oriented Architecture
The easiest way to accomplish horizontal scalability is with a service-oriented architecture. This is already pretty commonplace, but it’s especially important in the cloud, where you pay for the resources you consume – as your application scales, you can scale out only the services you need, which is more efficient (and cheaper) than scaling everything across the board. In addition, service-oriented architectures help manage concurrency. The following two diagrams demonstrate this point.
Fig. 1: The environment under normal load
Fig. 2: The environment after load changes
In the data center, scaling your application is expensive and time-consuming. In the cloud, it’s easy and (relatively) cheap. Netflix takes advantage of this, scaling their application up during the evenings when load increases and back down when peak viewing hours are over. Anyone with very dynamic load can take advantage of auto-scaling, which allows you to be cost-effective in the cloud without sacrificing performance.
Planning for Failure
One of the techniques Netflix is most famous for is simulating failure with its Simian Army. While this might not be a feasible approach for everyone, planning for failure is important for any cloud-based application – this is what Google is referring to when it talks about building “reliability on top of unreliability.” Your application needs to be able to survive failure at multiple levels – an individual node, a cluster, or perhaps even more.
Server instances can come and go at the drop of a hat, so they cannot store any state. Instead, Netflix groups server instances together into “clusters” and considers the behavior of the cluster as a whole.
These are just a few of the best practices for building a highly scalable cloud application. In order to take advantage of what the cloud has to offer, you need to rethink the architecture of your entire application. This also means you need to rethink your approach to managing the performance of your application in order to ensure the availability and performance of your application in the cloud.
Take five minutes to get complete visibility into the performance of your production applications with AppDynamics Pro today.