I'm wondering how you're supposed to manage a failure from your web hosting provider (server breakdown, ddos attack, server maintenance...) For instance, is it possible to host your website on multiple servers? I'm currently using shared hosting with OVH, but it has already been down multiple times, and since I'm quite dependant on my website, I'd like to know what the good practices are to avoid a "single point a failure".
-
1Use a CDN (Content Delivery Network) is one solution. Another is to consider that if you are "quite dependant" on your site, perhaps you should move to a more reliable host.– SteveCommented Nov 26, 2017 at 10:52
-
1I agree with @Steve. I used to be a web host and it was damned easy to have 100% up times for just $10 a month if you cared for your customer and know what you are doing. Of course it did not hurt being a core network engineer consultant for BT and have more connectivity than any Telecom on the planet! It is all about CYA and making sure your customers benefit from it. It should be easy to find a host that gives you better up time than what you are getting now. Cheers!!– closetnocCommented Nov 26, 2017 at 19:21
-
Back a few years ago, not sure about today, rackspace was the best around and priced well for any scale including anything you can imagine. They have a global reach too if you need it. You may want to consider them.– closetnocCommented Nov 26, 2017 at 19:24
1 Answer
Load balancers
Most large sites run on a set of servers behind a load balancer. This allows some of the servers to go down (or be taken down for maintenance) without taking the whole site down.
The load balancer is still a single point of failure, but load balancers generally have 99.99% uptime. They are single purpose machines tested against very high loads.
Failover DNS
Failover DNS monitors your primary server (or cluster behind a load balancer). When it detects a failure it points DNS to a separate backup site running in a different location.
Content delivery networks
CDNs act as distributed caching proxy servers for your website. They handle requests to your website via "edge nodes" located around the world. Each node will have to request the resource from your "origin" server on the first request and again periodically to pick up changes. CDNs help buffer against some types of DDOS attacks as well as reduce load on your origin server.
Monitoring
Whatever solutions you have in place, you need to get alerts when your website does go down. This will allow you to jump in and fix issues.
Staging servers
Releasing new versions of your website can occasionally be problematic. It helps to maintain a staging environment where new versions can run for a while before a live release. You would typically want to do both manual and automated tests against your staging environment.
Database synchronization
Sites that use a database will typically want to have a live database and a second backup database ready to go at each hosting location. This is usually accomplished by synchronizing databases by serializing all database transactions and replaying them to each database.
Sharding
Sharding is a technique of having different data live on different servers based on a hash of data key. In a robust sharding environment, data typically gets written to at least two locations for redundancy. Unlike database synchronization, not all servers have to have a copy of all of the data which allows sharding to more easily handle large data sets (terrabytes) that don't fit well in traditional relational databases.
Cloud hosting
Cloud hosting providers such as Amazon AWS typically offer all of these services. AWS even has Elastic Beanstalk technology that will add and remove servers automatically based on server load.