Which is Better, a Shared Hosting Account or a VPS Server?
related tags: shared hosting, vps server, web hosting,
Through my years of being a web developer, both professionally and personally, I have used many different web hosts. Some have been extraordinary while others were ho-hum. Being a tech geek at heart I have always preferred managing my own server and all the configuration that goes along with it. But while that may be fine for me, that is not necessarily ideal for Joe Blow who wants to set up a new website for some awesome idea he has. Not only might Joe not have any idea how to setup an apache daemon, but if he did, he may not have the time for it!
While I might tend to advocate a VPS more than a shared hosting account, both certainly have their places. I want to help you figure out which is best for you and help you understand what each is so you will be better prepared when you start down the road to web hosting!
First, let's explain what each one is.Shared Hosting Account
Many of the larger web hosting companies, such as DreamHost, GoDaddy, HostGator, or BlueHost have basic web hosting accounts for only a few dollars a month. Typically you get X number of email addresses per domain, X GBs of storage, X GBs of bandwidth, and the better hosting companies will give you multiple MySQL Databases per domain. Once you purchase a domain and sign up for the hosting account the web host company will assign you a user id which you can use to log into the server and upload your web pages.
When you are starting a new business this can be ideal. Most things, such as email and databases, can be configured with a few clicks of a button on an easy to manage web page, allowing you to quickly be setup sending and receiving email. If funds are low and you want to get started now, this is the way to go.
As with all things, there are some drawbacks. You never know how many other users are "sharing" your server with you. All the bandwidth that you have (though it may seem like a lot) is actually shared with all those other users. So if Bob's baseball card website gets a lot of traffic that will potentially slow your site down. Or if Sally's gardening website has a database that is not very well optimized it could consume so much processing power to deliver her content that your site will seem sluggish!
Of course, this is only partially true, and the web hosting companies do a lot of work to make sure your website gets as much "shared" processing power as Bob or Sally's. They do this by throttling everyone's bandwidth and processing power equally. For a basic website you may never even notice. Want to use a Drupal content management system? What about WordPress? You may find your website takes several seconds to load, even with no content and only the basic installation! Imagine what will happen once you have real content on your site and some pictures!
Pros: Quick and Easy Setup, Easy on the Pocket Book
Cons: Not ideal for websites with a lot of traffic, heavy database usage, or content management systems. ** Dreamhost and possibly others do offer some CMS optimizations, but I have found them lacking.
I have used many "VPS" systems via my own servers that I manage and through Digital Ocean. My personal servers run a variant of CentOS or Red Hat Enterprise Linux with KVM installed which allows my single server to act like multiple servers. Each virtual server is configured to have dedicated resources at its disposal. Managing my own servers allows me the benefit of assigning a different amount of ram and processing power to each virtual server, so servers which have more traffic and more needs get more resources. Servers with lower needs get less resources.
If you manage your own server, whether in a data center or in a SOHO environment, I would highly recommend a KVM configuration using multiple VPS machines. Why is this preferred over a single machine with all the resources available?
- If your environment was hacked, a single machine being pwned means your game is over! While there are some flaws undoubtedly in today's KVM technology allowing privilege escalation, the benefits greatly outway the risks. If something or someone manages to get past your defenses and breaks inside a virtual host the most you will likely lose or have to restore will be that single virtual host.
- If you need to verify your code will run on a hosted account elsewhere with limited resources you can easily emulate that hosted accounts resources within your virtual host. If you are running all your code on real steel you cannot "throttle" down your resources, so to speak.
- If you have multiple clients that you develop for you can easily emulate the clients environment each in their own virtual host. This is a real boon when one of your clients insists on running Windows with Apache or IIS, or maybe a client who runs BSD with apache, and that other client who does not want to run Apache on Linux and instead uses nginx. All of this is easily configured on one server with several virtual hosts configured.
So what if you do not run your own server, but instead rely on the awesome capabilities of Digital Ocean? All of those same benefits apply. The drawbacks of a VPS system on your own server is you must have the physical resources necessary to run multiple virtual hosts, but with Digital Ocean you don't need to worry about that.
I'm sure there are numerous other reasons why a VPS might be advantageous to a web developer, but these are the biggest for me, which I also think are fairly universal to others. So let's talk the downsides of a VPS vs a shared hosting account...
If you do not have the time to configure a VPS don't sweat it! If you don't have the expertise to quickly get setup that does not have to be a downside either! You could hire a LAMP administrator like me to help you quickly get up and running. However, if you do have the ability to setup and manage a VPS on your own, then you are already familiar with the disadvantages. A shared hosting account will make setting up domains, mysql databases, and email addresses point-and-click simple, but a virtual host will typically require all configuration to be completed via the command line and editing configuration files. I do not personally consider this to be a negative thing or a downside, but I would not be completely honest if I said it was not time consuming. A shared hosting account may be up and running (not counting domain propogation) in 15 minutes whereas a virtual host may require 2 hours or more to configure (again, not counting domain propogation).
Price can also be a set back for a new business. Many top-tier hosting companies provide affordable VPS services, but typically they cost at least twice as much per month. A shared hosting account can cost anywhere from $4.95 USD to $12.95 USD per month and a good VPS might cost double that at minimum per month. Digital Ocean provides basic VPS services for $5.00 USD per month.
All of this means that a new business, without expertise, will likely have to pay someone like me to setup their virtual systems along with a higher monthly cost. Unless you choose Digital Ocean, of course, then you only have to pay for me!
Pros: Dedicated resources, Better security against other users on the same machine, Better handles most of today's off-the-shelf content management systems.
Cons: Takes longer to configure, possibly requiring outside expertise, Can cost considerably more per month.