/ notes
← all notes
engineering 2 min read

Understanding Serverless using a Restaurant Server Analogy

A simple explanation of the serverless cloud model using the analogy of two different types of restaurants: traditional busy restaurants versus futuristic clone-based service.

I will try to explain the serverless cloud model using the analogy of two kinds of restaurants.

Busy restaurant with a typical server

Imagine you walk into a busy restaurant and notice that there are more orders than servers. Requests are handled first come, first served, and when demand spikes, wait times increase.

That is similar to a traditional server-based model in the cloud. One server attends to several workloads, and even when load balancing spreads the traffic, the system still depends on pre-provisioned servers.

Restaurant of the future: serverless

Now imagine a restaurant that employs a human clone outsourcing company. Every time a new order arrives, a fresh server-clone is created, assigned to that order, and destroyed as soon as the work is done.

That is the shape of serverless. A function or container image exists, and the cloud platform spins up a new execution environment for each request or event trigger.

Cloud platforms that offer serverless services let you write code in your preferred language without worrying about where to host it or how to scale it. The platform handles that operational layer for you.

What are the benefits of serverless?

  1. It is one of the cheapest models in the cloud because you only pay when your code executes.
  2. You do not have to worry about scaling, because each invocation gets the compute it needs.
  3. You do not have to manage server tuning, configuration, or maintenance.

What kinds of use cases benefit from serverless?

  1. Event-based notification work, such as sending emails or SMS messages after user registration, or generating PDFs from reports.
  2. Time-based triggers, such as scheduled tasks that send birthday messages or generate monthly reports.

Popular serverless platforms include:

  1. AWS Lambda
  2. Google Cloud Functions
  3. Azure Functions
  4. IBM Cloud Functions

The main value of serverless is not novelty. It is the removal of infrastructure work that does not need to sit in the developer's head.

comments