In this post we’ll take a look at one of the key benefits of Cloud Computing – Scalability. We’ll explore the different scaling options available for your cloud based workloads, and then we’ll take a look at specific services in AWS which can help you to achieve scalability for your AWS hosted applications.
Whether you’re starting out with a single instance and hoping to grow, or you have a globally distributed application, you always need to be factoring scalability into your application architecture. Most businesses are looking to grow, so you need to make sure that your application infrastructure can grow in line with customer demand. But not only grow – you may want to be able to shrink resources again during quieter periods to keep infrastructure costs in line with your usage patterns.
Cloud Computing Scalability
Favorites Scalability is one of the key benefits of Cloud Computing. Having access to seemingly limitless resources to some extent takes away the headache of how to scale your application infrastructure in line with demand, but you need to ensure that your application is designed to leverage the cloud infrastructure in the most efficient way possible, to ensure that your infrastructure can grow and shrink with your business requirements.
Let’s firstly take a look at the different ways in which a cloud hosted application can scale – Vertically, Horizontally or Diagonally.
Vertical scaling, also known as ‘Scaling Up’, is simply adding resources to your server to cope with increased demand. This could be CPU cores, additional RAM, extending disk volumes etc. No changes are made to the application code, and no additional servers are added, you are just making the server you have more powerful, or indeed less powerful if you want to scale back down again. This is a very commonly used scaling method but it does of course have very finite limits to how far you scan scale – the limit being the largest cloud instance you can use. Nowadays you can get some pretty huge instances with lots of cores and terabytes of RAM, but you are of course using a single instance which is a single point of failure for your application. You will also require downtime (usually just a reboot) to scale up or scale down.
Horizontal scaling, also known as ‘Scaling Out’, is adding infrastructure to the application. Horizontal scaling requires your application to be broken into ‘tiers’ or ‘microservices‘ and is therefore more complex and costly than vertical scaling, but with the benefit of almost limitless scaling. Consider a simple 3 tier web application, with web, application logic and database tiers. As the load on the site increases, the first part of the application to take the load will be the web tier. This can therefore be scaled independently of the app logic and database tiers, by simply adding additional web servers and load balancing the traffic across them.
Diagonal scaling is a combination of using both Vertical and Horizontal scaling in the same application. Take again the example of our 3 tier web application. Whilst it may be simple to add web servers to cope with additional web traffic, it may not be possible to split the application logic over multiple servers. In that scenario, you could apply vertical scaling to the application logic tier, whilst still utilizing horizontal scaling for the web tier.
So now we understand a little more about the different types of cloud computing scalability, let’s look at what services AWS has available to facilitate scaling in the AWS cloud.
Vertical Scaling in AWS
EBS Volumes are the hard disk drive volumes which can be attached to EC2 instances. A single General Purpose (GP2) EBS volume can scale to 16TB and 10,000 IOPS. A Provisioned IOPS EBS volume can scale to 16TB and 64,000 IOPS. Crazy performance for a single volume.
EFS or Elastic File System is a shared storage volume that can be mounted via NFS to a Linux operating system, enabling multiple instances to see the same disk volume. With EFS Storage you only pay for what you consume, but an EFS volume is virtually infinitely scalable. In fact in our monitoring system our customer EFS volumes show as having 8 Exabytes of storage available! I have not checked to see what it would actually cost to store 8 exabytes in EFS – although I think you would probably want to put some of that data elsewhere, such as S3!
S3 Object Storage
Horizontal Scaling in AWS
Application Load Balancer
Application Load Balancers operate at layer 7 of the OSI model – the application layer. They are application aware and can load balance HTTP and HTTPS traffic. You can create advanced request routing to distribute load to specific EC2 instances. Application Load Balancers do have some default limits set, some of which can be raised on request. The default limits include 1000 Targets per ALB, 50 listeners per ALB, 50 ALBs per region and 3,000 targets per region. So although they are limits, they are pretty generous.
Network Load Balancer
Network Load Balancers operate at layer 4 of the OSI model, the transport layer. They can load balance 10s of millions of requests per second at very low latency. Again you can have 50 NLBs per region and 3000 target groups per region by default.