What is a serverless website and why, as a small business owner or community organisation manager, should you care? In this article we take a look at serverless computing and web design, and how a serverless architecture can reduce your IT spend while improving the security and reliability of your website or web application.
Traditional websites are deployed on servers provisioned and managed by your web developer or web hosting provider. Regardless of whether your website sits on a shared server or has its own dedicated server, there are a number of issues with the traditional server hosting model. These issues all contribute to your IT spend, whether directly or indirectly:
- Keeping servers running 24/7/365, whether serving any requests or not, is relatively expensive.
- Servers must be maintained. Hardware fails, backups must be made, log files managed, and operating systems updated.
- Servers are vulnerable to attack, so must be continually monitored and patched as new security updates are released.
- As web traffic scales up, server capacity must scale up as well. Rebuilding servers is a time consuming and error-prone exercise.
- For small websites hosted on a single server, that server is a single point of failure.
The expenses involved in keeping a website online are of course ultimately passed on to the website owner, while a server failure or security compromise could involve a long stretch of downtime.
Serverless computing is a new hosting model made possible by the growth of public cloud computing (eg Amazon Web Services). Serverless websites are no longer hosted on web and database servers: instead, all static files are served out of an object storage service (eg S3), and all computation is handled by individual functions executed on-demand and billed (in the case of the AWS Lambda service) in 100 millisecond increments. In other words, you only pay for the time the code actually runs. Functions can be written in most popular programming languages (eg Python) and are uploaded to the cloud provider for execution. Serverless is also sometimes referred to as "Functions as a Service" or "FaaS".
Of course, even with "serverless" computing there is an actual server involved at some level. But the provisioning and management of that server is entirely the responsibility of the cloud provider: from the point of view of the web developer or web host, there is no server. Developers can upload static files and deploy code without worrying about the underlying infrastructure. Costs are based on the resources used (storage and computation), without the need to reserve and pay for a fixed amount of bandwidth or number of servers, as the service scales automatically to match requirements. The benefits of a serverless website include:
- cost minimisation as you only pay for the resources you use (storage space and function execution time)
- no server infrastructure to provision and maintain
- no server security issues to monitor and manage
- cloud provider's infrastructure guarantees high level of reliability and availability
- easily and automatically scale up and down as traffic demands
Not all websites and use cases may be suitable for a serverless solution, but the majority of smaller sites certainly are. Many small business or community organisation websites consist of just a handful of pages, but are built using a bloated content management system (CMS) such as Wordpress which requires a traditional web server.
In many cases the expense and operational overheads of running a Wordpress website just don't make sense to a smaller organisation. The traditional rationale for such a website is that it allows end users to update their content themselves, but the reality today is that these kinds of day-to-day updates are most likely to be made in a social media context.