Hosting a website on a server can be like buying a crate for your new puppy. Sure, your puppy might fit now. But in a few months, you’ll be back at the pet store looking for the next size up. Depending on how fast your puppy grows, you might have to repeat this trip again. And again.
You might face similar issues with the server hosting your site. As your site grows, you’ll have to spend more and more time provisioning, managing, or upgrading your server to ensure your site keeps running smoothly. This will leave you less time to spend actually developing code.
What if, instead, you could focus solely on writing code and get someone else to handle the operational infrastructure of your site?
That’s the idea behind serverless functions.
In this post, we'll walk through what a serverless function is, how it differs from Functions-as-a-Service (FaaS), and some of the biggest names in the serverless architecture market.
What is a serverless function?
A serverless function is a programmatic function written by a software developer for a single purpose. It's then hosted and maintained on infrastructure by cloud computing companies. These companies take care of code maintenance and execution so that developers can deploy new code faster and easier.
Because these companies automatically add server capacity when you need it and then take it away when you don’t, you don’t have to worry about maintaining and scaling servers to fit the evolving needs of your website or application. Instead, you can concentrate on creating newer and better products in less time.
Going serverless can also be cost-effective since most platforms have a pay-as-you-go model. That means you only pay for the server resources you use, rather than having to eat the cost of unused resources at the end of your billing cycle.
Before we take a look at the major cloud providers in the serverless architecture market, let’s take a closer look at how you might already be benefitting from serverless functions.
Benefits of Serverless Functions
Many platforms have begun extrapolating smaller pieces of their back-end code and moving it to serverless functions. This marks a huge shift in the software development community.
Historically, platforms have been monolithic. Meaning, they had large, unified codebases. That meant any time you added a new feature, or even fixed a bug in a single line of code, you had to deploy the entire platform to ship the new code.
With serverless functions, you can develop any new functionality or security patch as a completely isolated, single-purpose piece of code. All you have to do is upload your code and tell the platform how to provision it.
This not only makes the deployment of new code quicker, simpler, and easy to automate — it also significantly decreases the possibility of downtime during a deploy. In short, serverless functions improve the performance of your application and the experience of your developers and customers.
Recognizing the value not only to themselves but to their customers, platforms like the CMS Hub Enterprise have begun offering serverless functions. This allows you to add interactive elements, like event registrations and dynamic calculators, to your HubSpot-hosted content without needing to configure an external server.
Imagine you’re a CMS Hub Enterprise user and run a fitness site. Using serverless functions, you can allow visitors to view upcoming classes and register for them (or sign up for a waitlist) directly on your site. You don’t have to manually keep track of sign-ups or set a class to full capacity or anything — just write the back-end code and set it up to be triggered when a visitor fills out a registration form. HubSpot will do the rest.
Before we take a look at other popular vendors, let's clarify the difference between serverless functions and Functions-as-a-Service.
Although serverless functions and FaaS are sometimes used interchangeably, FaaS is actually a subset of serverless functions.
Serverless functions can fall into to any service category where the configuration and management of servers are invisible to the end user. That includes storage, database, messaging, computing, API gateways, and more. FaaS, on the other hand, refers exclusively to event-driven computing wherein the code only runs in response to specific events or requests.
So, if you set a function to be automatically triggered by an event such as in-app activity, website clicks, or image uploads , you're using FaaS.
Now that we understand what a serverless function is, and FaaS specifically, let’s look at some public cloud hosting companies that have serverless platforms.
The global serverless architecture market is expected to be worth $19.84 billion by 2025, according to data from Grand View Research. Below we’ll take a look at the serverless portfolios of some of the biggest vendors in the market.
Introduced in 2014, Lambda from Amazon Web Services is an event-driven, serverless computing platform that allows users to run code without provisioning or managing servers.
Users can run code for virtually any type of application or backend service with zero administration. Once they upload their code and set it up to automatically trigger from either other AWS services or directly from their website or mobile app, AWS Lambda takes care of everything required to run and scale the code with high availability.
Released in 2018, Google Cloud Functions is a serverless function environment on the Google Cloud Platform. As with AWS Lambda, users simply have to write their code and set it up to trigger from other Google Cloud Services or from their application. Google will handle the rest from there. This platform is ideal for setting up functions for data processing, like retrieving relevant data from images and videos.
Introduced in 2016, Azure Functions is the serverless computing service hosted on the Microsoft Azure public cloud. What sets Azure apart from the other platforms is that it provides an easy-to-use web interface where users can write code. Azure Functions is ideal for tasks like image processing, order processing, and file maintenance.