What is the current Server model?
If you have a website at the moment I can guarantee it is hosted on a web server. But what is a web server? I hear some of you ask. I’ll tell you. A server is a computer that is connected to the internet that will house your website under an IP address. Your domain name will be connected to that IP address and this will allow people to access it via their web browser.
So, let’s say a user goes to your website URL. We call this a request because the user is requesting the information from the server. When the server receives this request it processes the request and then serves the data. We call the severing of the data the response. This how a traditional server works, it has worked this way for many years with many improvements in speed and processing power. Your website is limited to the speed and processing ability of the server it is on unless it has some special setup that allows it to run on the cloud or a load balanced server network.
If your website was built by us (Gecko) then there is a very good chance that your website is running on Umbraco. This will mean that your site is always on and ready to take requests and deliver responses. There should be no time when the site is deactivated unless we have deactivated it. So, it is always on and always running. Even if no users are requesting data from the site it will still run on the server in an idle state.
Another aspect of the traditional server setup is the cost. It is normally a flat rate that you know upfront and can manage fairly easily from month to month. The cost of the server can vary depending on the different features of your site. If you expect a lot of users on your site at once and they are performing complicated tasks such as uploading videos and editing them then your costs will be higher.
What is Serverless?
Serverless is a relatively new term being used within the application development world and it is easy to see why it sounds good. Not having a server would mean no server costs and would mean you have more money. This sadly is not the case. Serverless does not mean no server. It is far more complex than you would expect but I will try to explain it in relation to hosting a simple website.
In the traditional model your site is always on and always running on your server, with serverless this is not the case. Your site is only ever run once a user requests the site or interacts with the site in some way. This is referred to as an "event-driven system." If your site has complicated functions then the developers will separate these functions out into individual little apps that are only run once they are requested. These apps are called functions within the serverless application.
So, as an example let us say a user goes to your website that has been converted to serverless. The first thing that happens is that a function is run to compile the page the user has requested. This is then served in the same way that as a traditional server would serve it. Now, let's say that this user wants to upload a video to your site so they select the video and click upload. This will trigger an event that will load the required function to deal with the video, then it will compile a response and deliver that response.
This is different from the current server model as it is not run on a single server but rather on a network of servers, commonly referred to as "the cloud." With this model, you can scale up and down the use of the server used as the demand for your website increases.
Due to the scalable nature of serverless models, the pricing structure is very different. You are charged per function run rather than a set rate each month. This means that your server costs could be very low if not many people are using your service but it also can mean that costs can increase rapidly in a short space of time.
One of the many benefits of serverless compared to traditional servers is the cost of developing the server-side services. With a serverless option, you can use a lot of off the shelf components that are built into the providers such as AWS Lambda, Google Cloud Functions, Azure Functions and many more. These functions are built for purpose and can be easily integrated into an application. There is no need to build such functions or great integrations as many already exist.
Should you use Serverless?
This is a difficult question and can really only be answered on a site-by-site basis but I am going to say for the most part the answer is no. If you are running an Umbraco website today it wouldn’t be beneficial to you. There are a number of reasons why this is the case but I am only going to layout the most relevant ones here.
To get the best price possible you would need to remove your site from Umbraco and just host the raw HTML, JS and CSS files directly on the serverless platform. This would mean that editing your content would be much more difficult and you would likely need to ask us (Gecko) to do it for you.
The cost of serverless can be good if you have a static site that does nothing. If you were to keep your site within Umbraco then the cost of your hosting would drastically increase as you will be charged for every edit to content as each saving of content would trigger many functions and you are being charged per function rather than a flat rate.
Page load speeds
If you stay with Umbraco to get around the content control issue you would likely see your site slow down fractionally. This will be due to the state of the site being an idol for most of the time and only being activated once a user requests the data. On a traditional server the content would be loaded quickly but with the serverless model the requested page will need to be generated and this could be slightly slower for the user.
If you have any further questions about serverless computing or if you need someone to host your website then please get in touch with the Gecko team.