Reliable Web Hosting Practices

Here is a strategy which will help ensure maximum uptime and minimize the time to recover from an outage:

  1.  Don’t use shared hosting for anything but the smallest, low traffic sites.  If you have any appreciable traffic, the hosting provider will suspend your site and hold you hostage until you upgrade to a more expensive plan.
  2.  Host the site on a server at digitalocean.com.  The $10/month plan is a good starting point.
  3.  Separate these three elements of a web site:  Domain registration, DNS, and hosting.  keeping these three services separate will improve reliability and enable quicker recovery.
  4.  Maintain an automatic backup using the Digitalocean backup service.  Be sure to export any databases to a file each day so that a consistent backup can be taken.
  5.  Set up a second server in a different datacenter (this can be with digitalocean or a different provider) and use rsync to automatically copy the site files and database to the secondary server.   This will ensure that you have a running, online backup of your site at all times.  It would only take a simple DNS change to switch to the backup site should that become necessary.  Keeping short TTL on the A records will minimize the time required to switch to the backup site.  Replicating the site once per week will help ensure that any corruption or hacked files on the main site are discovered before they are replicated to the backup site.