“I want to learn about scalability”
How to scale your web platform beyond shared hosting
The problem: As the number of websites you manage increases, or as the popularity of your sites sky-rocket, you need a reliable, scalable platform. What technology do you use?
Shared hosting gives you limited resources (the last thing you want if your website is taking off) since you are inherently sharing the server with other people. Also, you can’t always install your own software on shared hosting. The other option, managing your own web servers, is costly, complicated, and fraught with the dangers of data loss and downtime affecting the life-blood of your business. Furthermore, hiring technical people to set up and manage these servers can be time-consuming and costly.
Hybrid Web Cluster offers a third way, giving you effortless scalability and data safety guarantees in a system which is both incredibly simple to set up and flexible, allowing your developers to quickly deploy websites and/or custom applications with enterprise level scalability.
Whether your growth is gradual or sudden, Hybrid Web Cluster will automatically scale your deployment horizontally and vertically as appropriate to accommodate your changing requirements. Here we examine exactly what horizontal and vertical scaling mean.
The simplest way of dealing with growth is to buy a bigger, better server when your existing one runs out of capacity. But what happens when that one runs out of capacity? You replace it with an even bigger, better one. But you’d better buy two of them so you’ve got a hot spare if the first one fails.
The problem with scaling vertically is that on its own, it’s exponentially expensive.
This graph (from Cal Henderson’s excellent book Building Scalable Websites) shows how if you stick to just one server, the price of increasing the power of your server increases a lot faster than if you buy multiple servers and run them together. Which brings us nicely on to…
Scaling horizontally involves having lots of servers and using them simultaneously. As you can see from the graph above, you get more bang for your buck with this approach. However, the downside is that you get a lot of added complexity from having to manage many servers:
- You have to decide how to split up the workload, which can be complicated, or impossible, depending on your existing applications.
- As you get more servers, the probability that one of them will fail tends towards one. When you’re using just one or two servers, it’s very unlikely that one will fail every day, but when you get to Google or Facebook scale, server(or even whole data-centre) failures have to be a normal day-to-day activity for you, otherwise you’ll end up running around fighting fires endlessly.
Next, we’ll look at the first source of complexity…
Splitting up the workload
The bad news is that the majority of web software won’t support horizontal scaling by default. Take a WordPress blog for example: if you upload a photo to your WordPress blog, it gets uploaded to just one server. Suppose you have a bank of ten servers and a load-balancer to split the work across them — your request to upload a photo might go to server 3, but when you visit your blog that request goes to server 7, which doesn’t have a copy of your photo. Bad news. So, you need some form of shared storage, such as an expensive NAS device — but this creates a single point of failure, and takes you straight back to the vertical scaling problem (for the NAS device).
If you’re hosting lots of websites, instead of just one big one, then your job is a little bit easier. Suppose you’ve got a hundred websites, then you can put ten on each server, and for a while, it looks like you’ve solved the problem. Then one of two things will happen:
- Three of the sites on one of the servers will get loads of traffic around the same time, bringing that server to its knees — the websites get dead slow, or the server fails completely. You will need to manually migrate some of those websites onto a different server, so that the load on the first server will go back to an acceptable level. This is a load balancing problem.
- A hard disk, motherboard, or RAM module will fail, and those websites will drop off the face of the web. You’d better have a very recent backup of those sites, and be ready to manually bring them up on a different server as quickly as possible. This is a redundancy problem.
So with “simple” horizontal scaling, there’s a lot of manual intervention needed.
It’s also worth mentioning that when you have to update the software on your servers, it will take ten times as long as if you just had a single server. You need a way of automating all this stuff.
The good news is that Hybrid Cluster solves the load-balancing and redundancy (data safety) problems automatically.
A “hybrid” approach
So from the above, we can see that scaling vertically is great for a single increasingly-busy site because it means you can use your off-the-shelf software such as WordPress without any tricky custom modifications. But it’s expensive. On the other hand, horizontal scaling is great from a cost point of view, but adds a whole load of unwanted complexity.
We give you the best of both worlds by allowing your web cluster to scale horizontally and vertically, providing load-balancing and redundancy automatically.
Because we can host your cluster in a cloud computing environment, the software can decide to automatically “spin-up” new servers — from the underlying cloud provider’s infrastructure — if it sees that a particular website needs to scale. The cluster will reconfigure itself — within seconds of a spike in traffic — so that two big servers (one web, one database) are dedicated to hosting your popular WordPress blog, and the other servers carry on sharing all your other sites between them.
What if one of the “dedicated” servers goes down? With Hybrid Web Cluster failures are handled automatically and immediately: your website gets reinstated from a copy of that site which is less than 10 seconds old.
What if I need more than two really big servers for one site?
If one of your sites needs to scale beyond two large servers, it may need some minor changes to the application code — in particular making it only store state in the database. We can help you make these changes and deploy a massively scalable version of your own website or application, quickly and easily, thanks to the integrated multi-master MySQL-compatible database from our friends at GenieDB. We can get your application ready to scale to millions of users and beyond.
If you are any company looking for an upgrade from shared hosting or running your own servers, Hybrid Web Cluster is the hosting platform which will take the headache out of your hosting infrastructure. Your servers will be self-managing — load-balancing and handling failures automatically, and our powerful cluster management tools give you new and fascinating insight into your hosting environment. You can run Hybrid Web Cluster on your own hardware, on a cloud provider’s hardware, or a mixture of the two.