DEV Community

lizziekardon for Pagely

Posted on • Originally published at northstack.com

What’s the Difference Between Cloud Computing and Serverless?

Just when you thought you understood cloud computing, a new concept appears: Serverless.

The layman's understanding of “the cloud” is close enough to the definition of Serverless it can leave you scratching your head and wondering, “Wait, how exactly are they different?”

Never fear, by the time you get to the end of this page you’ll understand what Serverless is, how Serverless computing differs from “normal” cloud computing, and how they’re related to each other.

We'll start by nailing down what “cloud computing” means so we can understand Serverless in relation to it.

What is cloud computing?

Cloud computing is a buzzword that’s been used and abused to the point where it might mean very different things to different people. To find some consensus, let’s see what the authorities on the matter have to say about it.

From Amazon:

“Cloud computing is the on-demand delivery of compute power, database storage, applications, and other IT resources through a cloud services platform via the internet with pay-as-you-go pricing.” Source

And here’s a definition from Microsoft:

“Simply put, cloud computing is the delivery of computing services—servers, storage, databases, networking, software, analytics, intelligence and more—over the Internet (“the cloud”) to offer faster innovation, flexible resources, and economies of scale. You typically pay only for cloud services you use, helping lower your operating costs, run your infrastructure more efficiently, and scale as your business needs change.” Source

To boil it down to the essentials: computer services are delivered over the internet and you pay for what you use. It’s efficient and it scales. Simple enough.

Here’s where things become more tricky…

There are four types of Cloud Computing

According to Microsoft, there are 4 major types of cloud computing:

  1. Infrastructure as a Service (IaaS)
  2. Platform as a Service (PaaS)
  3. Software as a Service (SaaS)
  4. Serverless

To stay focused on the question at hand, we won’t bother getting into the definitions of these categories of cloud computing. But, to further your understanding of what Serverless is and how it relates to other forms of cloud computing, it’s worth noting that these four cloud computing categories build on top of each other, so they’re commonly referred to as the “cloud computing stack.”

What is Serverless computing?

“Serverless” is a bit of a misnomer or, at least, a somewhat misleading label, because somewhere in the world in enormous warehouses, there are definitely actual servers powering “Serverless” computing.

But, the term points to what ultimately makes Serverless so innovative and valuable: with Serverless you don’t have to think about the server at all. So, in effect, it’s “serverless,” though not technically or literally, and that’s where the term comes from. “The setup, capacity planning, and server management are invisible to you because they’re handled by the cloud provider,” according to Microsoft, and, “Serverless applications don't require you to provision, scale, and manage any servers,” according to Amazon.

The server disappears (from your list of concerns)

Traditionally, if you were a developer you’d need to do quite a bit of work to set up and maintain a server for a new app or website. This process can be frustrating and time-consuming if you’re not a sysadmin by trade. Worse, if you make a mistake and configure something incorrectly it can lead to serious consequences — like a security breach, downtime, or an inefficient use of resources (you end up paying more than you have to for hosting).

And, that’s exactly why Serverless is so appealing — it’s all taken care of. The chore of provisioning a server is done for you and you’re relieved of the ongoing burden of making sure everything is secure, up-to-date, and optimized. All server-related concerns are taken off your plate and handled by the Serverless cloud architecture.

Hosting resources are supplied on demand

To get into the more technical side of what is happening under the hood, the functions of the site/app are split out into separate containers and resources are applied to specific functions as needed. Whatever your site/app needs to run itself is served up on a silver platter. When your application needs more memory, it gets more memory allocated in real-time. When your application receives a thousand web requests, it gives you the compute cycles and bandwidth to deliver those requests. Your application has a need for computer resources, and the Serverless architecture ensures it has exactly what it needs when it needs it. And, this is another defining characteristic of Serverless...

Precision allocation of resources

Serverless delivers exact units of resources in response to a demand from the application. Contrast that with traditional cloud computing where chunks of resources need to be allocated in advance so that they’re available when they’re needed.

With traditional cloud hosting, you might add 2GB or 4GB of RAM so that your application has sufficient memory available for peaks in usage. With Serverless, your application might request and be allocated exactly 3.76GB of RAM to complete some task. The allocation is exactly what is needed to meet the demand of the app/site.

With traditional cloud computing, the computer resources are dedicated to you whether you’re using them or not while with Serverless, you’re dynamically pulling only what you need from a vast ocean of resources.

Pay only for what you use

While the common definition of cloud computing speaks about “only paying for what you use,” Serverless delivers on that promise more literally. Sure, when you use Infrastructure as a Service you’re only paying for the server resources you asked for, but you’re still paying for 8GB of memory whether your application is using all 8GB at this moment or not.

With Serverless, you pay only for the exact amount of resources it takes to perform a function. If your website is only consuming 3.39 GB of memory at this moment, that’s all you’ll pay for. For most websites there will be a constant flux in resource usage as a result of fluctuating demand. Serverless automatically adapts to those fluctuations (a term called elasticity) so that you literally only pay for what your application uses moment to moment.

This means that your Serverless hosting bill will vary month to month depending on what your website uses. If you have a slow month, your bill might be very low. If next month your traffic explodes, your bill will be much higher. In this way, Serverless computing is quite efficient. There is very little waste because your hosting plan automatically adjusts up and down. The downside is that this fluctuation can make billing unpredictable which can make it difficult to forecast a budget. Organizations that place a lot of value on predictable budgets may be better suited to more traditional hosting options, like VPS plans.  

Summary

Serverless hosting offers some unique benefits over common cloud computing that make it an attractive option for many businesses:

  • No need to manage or interact with a server
  • Computing resources are supplied as needed to scale a site automatically
  • Resources are allocated precisely rather than in chunks
  • You pay only for the resources that are consumed

For more information on Serverless hosting, see our post, "What is Serverless? The 60-second answer."

Top comments (0)