Course contentsShow
← Software Engineering
Lesson 1519 of 1,93344. Cloud Architecture PatternsFree lesson

What is Serverless and Function as a Service

Define serverless computing, FaaS model, and how serverless abstracts infrastructure management from developers.

What is Serverless and Function as a Service

What you'll learn: How serverless computing abstracts infrastructure away, letting you run code without managing servers at all.

The Core Idea

Serverless computing is a cloud execution model where you write and deploy code without provisioning, configuring, or managing servers. Despite the name, servers still exist—you just don't see or manage them. The cloud provider handles all infrastructure concerns: scaling, patching, capacity planning, and availability.

Function as a Service (FaaS) is the most common serverless model. You write small, focused functions that execute in response to events (HTTP requests, file uploads, database changes, scheduled timers). The cloud provider runs your function only when triggered, automatically scaling from zero to thousands of concurrent executions.

How It Abstracts Infrastructure

Think of serverless like riding a taxi versus owning a car. With traditional infrastructure (even containers), you "own the car"—you maintain it, park it, pay for it whether you drive or not. With serverless, you "call a taxi"—you only pay when you're actually riding, and someone else handles all the maintenance.

With FaaS, you deploy a single function (like a JavaScript function or Python handler). When an event arrives, the provider:

  • Spins up an execution environment instantly
  • Runs your function
  • Returns the result
  • Tears down the environment

You pay only for actual execution time, measured in milliseconds. No traffic? No cost (or minimal cost). Sudden spike? Automatic scaling.

Key Characteristics

  • No server management: No OS patches, no capacity planning, no infrastructure configuration
  • Event-driven execution: Functions respond to triggers, not long-running processes
  • Automatic scaling: From zero to thousands without configuration
  • Pay-per-execution: Billing based on actual usage, not reserved capacity

Key Takeaway: Serverless and FaaS represent the ultimate abstraction of infrastructure—you write pure business logic while the cloud provider handles everything else, charging you only for actual compute time used.