In this article we will talk about what “server” hosting is, what “serverless” hosting is, and some of the benefits and drawbacks of both approaches.
In the case of a website, we can simplify the process down to two computers and a connection between. The “client” computer, the “host” computer and the internet connection
The “client” is the computer that is requesting information. When loading this web page, your computer would be the client.
The “host” is the computer which is receiving the request and responding with the page data. I.e. the words in this article, the styles that make up the page and the images on the page.
In the case of a website we would most often be using the internet as the connection between the client and host.
When we talk about different hosting paradigms, we are exclusively talking about the way in which a host computer is set up to handle requests.
At a simple level, we can think of server hosting as a computer (server) that is always turned on, with a piece of software running that is handling any requests that are made to the computer.
This server could be physically within your company premises (on-prem), or rented monthly from a cloud service provider such as AWS or Google.
If your website receives a significant increase in traffic, you would need either a second server, or a more powerful server (this is referred to as scaling horizontally or vertically and will be discussed in a future article).
The key concept to remember with server hosting is that the server is always there. In the cloud, during periods of low traffic it may be running at a reduced scale, but it is still there.
Server hosting is still the most common solution for hosting a website and its component services.
If server hosting is the idea of a server always being online, serverless is the idea of only being online when a request needs handling.
In serverless hosted applications, the software is split up into smaller chunks (called functions) and the functions are only active when they are called on.
The key concept here is that the application is only running when a request is received.
Serverless hosted applications have much less concern over traffic, as they are run in-parallel and on-demand. Rather than requesting an extra server, or a large server, the serverless host will just call another instance of the relevant function into service.
From a cost perspective, serverless is the clear winner. Most cloud service providers offer a significant number of free function invocations each month (1,000,000+), and even proceeding this period, the standard rates for serverless functions are far cheaper than their server counterpart.
In conclusion, where possible we would almost invariably recommend at least entertaining the idea of a serverless solution. However, as always in software, it’s not a one size fits all solution and compromises have to be made. A full discovery and analysis of the problem that is trying to be solved should be the primary influence on which hosting paradigm is better suited.
To keep this article from becoming a 300 page book, some concepts have been simplified. If you’d like to have a more in-depth conversation about the intricacies of server/serverless computing, feel free to get in touch.