Developer Chris Jolley delves into the world of hosting and what you need to know. Load balancers, AWS, failover, high availability, redundancy, virtualisation, load testing - by the end of this article, you should know what all these phrases mean.

Over to Chris to explain......

It’s one thing to know all about your website and how it looks, feels, and everything about it that makes the people using it want to keep coming back to consume your services, purchase your products and generally have great experiences online with your brand. But in recent years (or is it decades now?) the term ‘cloud’ has become very interchangeable with the term ‘hosting’ and both terms can make even the most savvy of us shudder at the thought of some jargon and concepts that we all wish we understood a little more. Those challenges aside, making sure that those valued people can get to your site regardless of any problems, maintenance, or other unpredictable factors coming into play is of utmost importance.

It’s my party, I’ll host where I want to

Mainly due to open source software becoming more varied, better documented and easier to use, as well as distribution of know-how and skills among us 'techy' folk, the great news is that there is nearly infinite choice when it comes to how and where you can ‘host’ your prized web project.

Since literally day one of the web, a website has required a web server. This is still 99.9999% true. It’s impossible to hold a party without a venue, whether that venue is the O2 arena, a treehouse, or a Skype call - the same is true for a website.

Web server is just as annoying a term as ‘cloud’ because it is typically used interchangeably to mean two things - the actual hardware ‘machine’ or ‘host(s)’ that delivers the website, as well as the software that runs on that machine.

Software that runs as a service (i.e. it runs all the time, doing a particular thing, usually behind the scenes) can be called a server, and (probably as a direct consequence) hardware that runs such software is typically referred to as a server also. If you want to impress your pet techies, such software that ‘listens’ constantly for things to happen - e.g. a website’s homepage to be requested by someone using a web browser - can also be referred to as 'Daemons'. Isn’t that a much more fun word?

The ‘Daemons’ (services that ‘serve’ (send to your browser) your web pages), and that are run on web servers, are therefore often referred to as web servers. And so is the machine they run on. Confusing, no?

The three most popular web server software packages are Apache, Nginx (pronounced ‘engine X’) and Microsoft’s ISS. Each provide different features and configuration experiences. Apache and Nginx are very good at quite different things, and can generally be run on any server regardless of its operating system because they are open source, and have been ‘ported’ (think ‘translated’) to work in all manner of operating systems running any hardware you can imagine, including fridges, toasters, and even - famously - a coffee maker.

So, to host your website, you need essentially these things:

Service: Web server software
Environment: Somewhere for that software to run
Connection: Some means for the 2 above to connect to the internet

This is true for amazon, google and the smallest simplest websites alike, and at a fundamental level, is how the internet - and the world wide web in symbiosis with it - works.

With the explosion of understanding, and the availability of pre-packaged services, turn key solutions, software as a service (SaaS), Infrastructure as a Service (IaaS) and more typical or traditional simple shared hosting solutions, approaches, and providers, when it comes to either starting out with your first hosting arrangement, or evolving what you have currently, you are literally spoilt for choice.

Cloud 9 (billion!)

In 2012, it was estimated by CISCO that around 8.7 billion devices were online.  That’s more than just a few devices joining what is essentially one big network, or cloud. ‘Cloud’ is one of those wonderful terms that is understood readily but does not necessarily mean the same thing to all people everywhere, or in all contexts. It’s a great concept or construct and allows us to talk about the way that, in all fairness, most things work 'on the internet’ these days. But without an understanding of the bigger picture in some areas and to some extent, it’s very easy to be talking about ‘the cloud’ and be at cross purposes with somebody.

The term ‘cloud’ is fitting because of how abstract, varied, and almost insubstantial The Cloud we all talk about, can be. In UML (Unified Modelling Language - a dark art of drawing diagrams explaining ‘IT stuff’ as well as within other diagramming approaches) a network of unknown / immeasurable dimension and internal construction is typically represented by a lovely fluffy cloud icon or symbol. That’s probably the origin of the term. The whole internet, the web itself and everything linking all of the billions of devices and pages together can be represented by that one symbol. Cool, huh?

If I were to draw a network diagram showing how these words that you are reading in this article arrive in your web browser, I could simply draw you, a cloud, a box, and a couple of lines linking them together.

The reality is much more complicated of course - sadly there is no actual body of water vapour that you are connected to, that wouldn’t work. But the ‘cloud’ bit in the middle is something of a black box and it is important to understand aspects of that black box. That’s the main reason that we decided to put this article together, particularly looking at the whole area of hosting and ‘the cloud’ (which actually are in many ways, one and the same!)

Crucially, with high demands and distinct ‘peak times’ for retail and ecommerce sites, leveraging the cloud and therefore understanding it to a degree has become essential, due primarily to factors of cost and scalability.

Given that the internet itself as a whole can be considered ‘the cloud’, when terms like cloud hosting crop up or private cloud, or hybrid cloud, this typically means that you would be using somebody else’s infrastructure and hardware, and consuming that as a paid for service, rather than implementing your own servers and software running on them.

Due to their scale and expanse, both in terms of infrastructure and user base, hosting ‘on the cloud’ tends to be extremely effective, extendable, reliable, and such provisioning is typically available as a managed service. 

Perhaps due to particular security or privacy needs, existing or previous investment in hardware internally, or simply to allow data to flow more readily between your ‘website’ environment and your internal business operations, a hybrid or private cloud approach may be worth investigating. 

Some of the biggest,most well known and feature rich cloud hosting platforms include Amazon AWS, Google Cloud Compute, and Microsoft’s ‘Azure’ platform. Each is full of so many features, to suit the basic or most advanced users, and offer very competitive pricing - it would be possible to write an article like this about each! It's worth some googling and reading around though. If you are working with a more local or independent provider, asking about which ways their services are similar - or different - to these household names can be a great way to understand their own, tailored, offering.

What do I need?

This question has that eternally helpful answer ‘it really does depend!’. Your developer(s), Agency, or Systems Integrators will be best placed to answer this. But, if you are starting from the beginning, it’s the same list we came up with earlier - Software, Environment, and Connectivity.

Since those areas can be more or less anything (within reason - you probably won’t get your website being served via Microsoft Excel, or using a biscuit tin as your hardware environment for example), the most important factors to consider are capacity and budget. Identifying the former is actually a lot harder than it sounds, so it is good to employ some critical thinking around this, and to seek advice from any hosting providers that you are already working with, or are considering partnering with. Having as many measurements and metrics on hand relating to the services that you wish to host is of key importance here. The more facts and figures, the better!

Some hosting ‘top tips’

Below are three vital areas of hosting that are well worth considering, particularly for ecommerce and retail scenarios:

1. Monitoring
2. Load management
3. Using a CDN (Content Delivery Network)

Monitoring is key, because while it is one challenge to get everything set up and working smoothly, ‘anything can happen in the next half hour’. Without great monitoring in place you can’t know for sure that everything is as it should be. An embarrassing situation to be in can be finding that your website is down or that a key functional aspect such as checkout or adding to basket is not working, and hearing this from your users (often rather vocally - Twitter is a wonderful (or not so wonderful!) thing here) before you hear about it internally is never a good feeling. There are monitoring solutions and approaches for all, so choosing the right one - and ensuring that the right people know about their appropriate alerts - is critical. 

Load management encompasses load balancing, and actually sits under the banner of ‘high availability’, from a fault tolerance perspective as well as better servicing requests to your website and providing the best performance possible. There are many ways to help direct the load placed on your hosting by your visitors to direct them to the fastest possible source of your content - these include using load balancer technology, adding caching and indexing to your databases and queries (via memcache, redis, or similar), http caching (perhaps using the Nginx web server software as a reverse proxy in front of apache - as one is great at dynamic content, and the other great for static content), or the popular ‘varnish’ http cache service.

Load balancing can help with this at a server or device level too. If you have more than one ‘host’, dividing your traffic between them to reduce overall load on any one device can be very useful. It also means that should a host experience an issue, other than potentially slower performance (mitigated by adding more hosts) your website will stay up and running, and nobody should notice. Eliminating single points of failure can make a difference one day when things go wrong, or during periods of peak demand ... Black Friday being a great example.  There are various ways to do this:-

- Cluster your database servers and have more than one host provide access to your database

- Ensure that all database instances are in sync across all hosts

- Be savvy about network connections and access between servers

Using a CDN comes under the banner of caching. But can also be helpful if problems occur.
A CDN, such as CloudFlare or Akamai, is essentially a huge network of extremely high capacity servers, that can keep a local copy of your website. Each CDN provider has servers all over the world, and visitors (after you have your CDN account set up and have made appropriate changes to DNS) will be sent to the servers that are geographically closest - or on the fastest route - for them. You still need your traditional hosting as we’ve described above, and this is referred to as your ‘origin’ server. Content held by the CDN will be refreshed periodically, or based on headers that your website can set within the code. You can also generally request a refresh of content in the CDN's cache too, manually on demand - perhaps to coincide with a launch, sale, or other big update, ensuring that your users are not seeing old website content. CDN's work best for caching ‘static assets’ - images, CSS files, and the actual html pages that make up the static areas of your site - for example your ‘About’ or ‘Contact’ page. 

Some other top tips include:

Keep it secure, stupid

We know you’re not stupid - far from it (you’re reading our newsletter article for a start!) - but much like the old KISS adage (‘Keep it simple, stupid’), you can, and should, swap out the word simple for ‘secure’. When changes are made to hosting and infrastructure, it’s easy to introduce vulnerabilities or remove elements of security that may have been in place quietly fulfilling their role for a long time. Whether consulting with a specialist, talking with your partner service providers, performing regular penetration testing exercises, asking questions like ‘how secure is everything?’, ‘has anything changed with our security?’ and ‘what more can be done?’, this will all help you to stay up to speed. One thing I can say with confidence is that you would be amazed, and possibly appalled by just how many threats are mitigated every hour, or day, through great security implementations. 

There are also aspects such as using SSL (which provides encryption between your website and your end users) which is extremely important for customer confidence, as well as even affecting your ranking in search engines like Google, which now include the presence of an SSL certificate as an SEO ranking factor.

Draw a diagram, and keep it up to date

Where possible, get to know your hosting provider, and find out everything you can about the services that you have and how they fit together. A picture can speak a thousand words, and having a ‘map’ of the various servers and systems that all work together to make your website function can be really useful when having technical conversations - it’s a great way to make sure that everybody is on the same page.

Make friends, make friends…

Without getting too far into the realms of sending flowers and treats (as much as sys-admins and developers do enjoy chocolate like the rest of us) having a great working relationship with your hosting provider, and establishing early on the correct communication pathways with them can be worth its weight in gold, particularly in a high pressure or emergency situation. A means to communicate in real time rather than only by ticket and email systems can be very helpful.

Questions, questions…

No matter how your website is hosted and delivered, it’s always OK to ask questions about that implementation and delivery, and well worth researching the terms that you hear often but that don’t necessarily make so much sense. The knowledge gained here can be very valuable, and with understanding, often comes the opportunity to improve. Finding out that you can use a technology that you’ve researched yourself or enquired about after hearing it mentioned is always rewarding. Also, most, if not all, hosting providers will take great pride in their platform and infrastructure. Typically people will be only too happy to ‘show it off’ and tell you all about it and why it is great. The potential for learnings here is huge.

Backups, backups and backups of backups

Make sure that you know what is backed up, how often, and where to. This is vital. ‘Off site’ or remote backups to infrastructure outside of where your services run in production is good practice. This can be as simple as keeping an external archive of your day to day backups, for example, or running an entirely independent fault tolerant replica of your environment with entirely separately provided infrastructure.
 
It is also very important to not only know about and check that backups exist, but to also verify your backups, and any corresponding restore procedures. A backup can be more of a problem than a solution if it takes you days to restore your data and services from it. While worst case, that can and does happen and at least having a documented restore process and know who you are going to call, and what they will need to do is crucial.

Final thoughts

The reason we wrote this ‘brief’ article, as you will hopefully have seen, is that hosting is a very broad area and there is always more detail than can be drilled down into here. 

Understanding your hosting is very much a challenge of understanding a lot of different ‘layers’, and how they work together. From DNS, to caching, to servers, load balancing, traffic shaping, redundancy, and layer upon layer of services and software; to understand all of it can be very difficult and is definitely a job for those who need to specialise in knowing these things. 

However, despite there being so much to know, it’s hopefully not such a scary topic. It definitely seems to be seen that way sometimes, but with some reading around and by asking questions - and there is no such thing as a daft question when it comes to technology, particularly if that technology is what keeps your services up and available - it’s very possible to know more about how things work and how they can be improved.

At Blueleaf, we’re always on hand to talk about any of the layers that make up the delicious cake that is website hosting, its implementation and ongoing support or maintenance, so do get in touch if anything shared here has made you raise an eyebrow or wonder what on earth we are on about. 

Comment