Intermediate 18 min read

Serverless Concepts and AWS Lambda

By the end of this lesson, you'll be able to:

  • Explain what "serverless" actually means, correcting the common "no servers" misconception
  • Describe what AWS Lambda provides and where the operational responsibility shifts to compared with EC2
  • Explain that serverless is not automatically cheaper, faster, or simpler for every workload

Prerequisites: Module 6: "Project: Design a VPC with Public and Private Components"

"Serverless" does not mean "no servers"

This is worth correcting immediately, because the name genuinely misleads: servers still run the code in a serverless architecture — they simply aren't servers you provision, patch, or manage yourself. AWS owns and operates the underlying infrastructure, and takes on a large share of the operational burden that Module 3's EC2 instances left with the customer.

Side-by-side diagram showing a traditional architecture where a user reaches an application server the customer maintains, connected to a database, compared with a serverless architecture where an event or request reaches a managed AWS service that invokes a Lambda function connected to a data or service layer.
The servers never disappear — what shifts is who provisions, patches, and scales them.

AWS Lambda: running code without managing a server

AWS Lambda runs your code in response to events, without you provisioning or managing a server. Compare this to Module 3's EC2: with EC2, you choose an instance type, launch it, patch its operating system, and keep it running whether or not it's actively serving traffic. With Lambda, you upload code, and AWS runs it only when something invokes it — handling the underlying compute, scaling the number of concurrent executions up and down automatically as demand changes.

This is the same Shared Responsibility shift Module 3 introduced for EC2 versus a fully managed service, taken further: Lambda sits toward the "AWS manages more" end of that spectrum. What stays the developer's job: writing correct code, configuring appropriate permissions, and reasoning about how the function behaves under real traffic and failure conditions — Lambda manages where your code runs, not whether it's correct.

Diagram showing an event source such as API Gateway, S3, or EventBridge sending an event to the Lambda service, which runs the function's code, producing a result that may be returned to a caller or passed to a downstream service.
A Lambda function does nothing on its own — an event source is always what starts the invocation, a theme the rest of this module returns to repeatedly.

Not an automatic upgrade over EC2

It would be a mistake to treat serverless as strictly "better" than an EC2-based design. Serverless is not automatically cheaper, faster, or simpler — it depends on the workload. A steady, high, predictable load can sometimes be run more cost-effectively on carefully-sized EC2 capacity; a spiky, unpredictable, or infrequent workload often fits Lambda's pay-per-invocation model well. The right choice depends on the actual traffic pattern and operational trade-offs, not a blanket rule that one approach always wins — exactly the same "choose by actual requirements" discipline Module 6 taught for choosing between VPC networking patterns.

Exercise

A colleague says "serverless means AWS doesn't use any servers for our application." Using what this lesson covered, explain in 2-3 sentences what's actually true instead, and what genuinely shifts to AWS versus what stays the developer's responsibility.

Show hint

The servers still exist — think about who provisions and patches them versus who writes and configures the application logic.

Serverless Concepts and AWS Lambda Quiz

1. What does "serverless" actually mean in the AWS context?

2. Serverless architectures are always cheaper than an EC2-based design, regardless of traffic pattern.

3. The AWS service that runs functions in response to events is AWS ______.

Show hint

It's the service this entire lesson introduces as this module's central subject.

Log in to submit the quiz and save your score.

My Notes

Log in to keep private notes on this lesson.

Questions about this lesson

No questions yet — be the first to ask.

Log in to ask a question about this lesson.

Summary

"Serverless" doesn't mean servers stop existing — it means AWS manages the underlying infrastructure, provisioning, patching, and much of the scaling, so the developer's attention shifts to code, events, permissions, and configuration instead; AWS Lambda is the service this module centers on for that shift, and it is a fit for some workloads, not an automatic upgrade over every EC2-based design.