Shared Hosting vs VPS vs Dedicated vs Cloud Servers

Before comparing VPS (Virtual Private Server), Shared Hosting, Dedicated and Cloud Servers we need to first know what they are and how they work. Any one of them can be suitable for your particular web application depending on the resources needed by the application, number of visitors per day using your application, the technologies you use to build the app and the level of performance, scalability and reliability you want from your server against the cost involved in buying and managing the server. Lets have a brief look at each one of them and then lets compare them to find out the one you will need. Though this article concentrates more on why should you use a VPS server and manage it yourself, but still it can also help you to choose the right option for you.

Shared Hosting

A shared hosting service refers to a web hosting service where many websites reside on one web server connected to the Internet. Each site “sits” on its own partition, or section/place on the server, to keep it separate from other sites. This is generally the most economical option for hosting, as many people share the overall cost of server maintenance. ~ Wikipedia

There will be hundreds of other sites residing on the same machine, sharing the same resources. This is the cheaper and at the same time performance and reliability will generally be less than other options. Though most of the shared hosting service providers will offer you almost everything unlimited! They will provide cpanel for free and tons of other things pre-installed, though most of which you won’t use ever. Those extra software and features along with many other sites hosted in the same environment will only slow down the overall performance of your hosted website or web application. Most of them will advertise unlimited disk space, unlimited bandwidth, unlimited databases and so on. But what they don’t advertise is the limits in CPU usage, memory consumption and database queries at a time. As your site traffic increases, you’ll eventually find out that the invisible database query limit will make your site unavailable to many visitors and though some of your visitors will see the site’s content but some others will see an error page with saying “unable to establish a database connection”. And if your site has more traffic, then they will shut down your account saying your application is using too much CPU or memory!

So ultimately there will be no use of those so called unlimited space and bandwidth. You will have your account suspended or your web application unable to serve visitors, long before you have even used 50GB of transfer per month. But still if you are just starting up, don’t have a good amount of traffic (say less than 500 visits/day) then it’s a good deal to host your web application in a shared hosting environment as it is generally a cheaper solution.

VPS (Virtual Private Server)

A virtual private server or VPS is a partitioning of physical server computer into multiple servers such that each has the appearance and capabilities of running on its own dedicated machine. Each virtual server can run its own full-fledged operating system, has their own dedicated memory, diskspace, Bandwidth and CPU Share. Each server can be independently rebooted and can have their own set of softwares and services installed.

With a VPS you can have root access to the system using ssh remote login capability. You can choose your own operating system distribution, can have your own mail server or can use google apps for email addresses on your own domain. I prefer to have an unmanaged VPS because a managed VPS will cost much more and things are beyond your control. The next pages of this tutorial is for helping those that want to setup their own unmanaged VPS from scratch to make it a high performance web server.

There are many VPS hosting providers, but in terms of cost and reliability there are mainly two leading providers, Linode and DigitalOcean. I've used both of them and Linode seems to me is more reliable and cost effective. It also has more scaling and monitoring options compared to other hosts. Most importantly their support is awesome. I guess every linode customer will say this to you.

Dedicated Servers

A dedicated server is where you occupy the entire computer resources alone. If you have a site that needs to do heavy processing, with millions of complex database queries per day, then you need a dedicated plan. But they can be high on costs and also poorly supported. Sometimes you’ll find you are the only person that worry about the uptime of your server.

Also, poorly supported or low-budget dedicated servers are less powerful than many VPS options. As is the case between poor VPS providers and quality shared servers, there is a lot of cross-over. But for sure, if you don’t have a huge CPU requirement but do need a lot of RAM, then a VPS is an option and, particularly for unmanaged, because it’s cheaper. Have a look at this excellent article comparing dedicated and virtual servers. And atlast if you really have a site with huge amount of traffic and greater processing power is needed for your web application then I would rather suggest cloud servers instead of dedicated ones.

Cloud Servers

Cloud server is like a VPS which is dynamic (that is, it can be changed at runtime). Key attributes for this are:

  • Additional hardware resources can be added at runtime (CPU, RAM)
  • Server can be moved to other hardware while the server is running (automatically according to load in some cases)

Cloud computing provides computation, software, data access, and storage services that do not require end-user knowledge of the physical location and configuration of the system that delivers the services. Parallels to this concept can be drawn with the electricity grid, wherein end-users consume power without needing to understand the component devices or infrastructure required to provide the service. So simply imagine there are lot of power servers connected into a grid and your application will run being in a virtual standalone server where the CPU, memory and other resources will be coming from the cloud of computing devices. You’ll get your fair share of CPU, memory etc just like it would be in a dedicated server machine.

There are several leaders in the cloud hosting world. They are Amazon EC2, Google Compute Engine, Microsoft Azure etc. In Brief they are costly solutions for simple deployments which is the case for most websites but for handling really huge traffic and better processing performance they are the best service providers.