
⚡ Day 15/30: Serverless Computing — What If We Don't Manage Servers at All? ☁️
Discover how serverless computing and AWS Lambda let us run code in response to events without managing individual servers. 🚀 Follow Rahul’s college portal as we use event-driven architecture for image processing, notifications, APIs, and background tasks.
Series: Cloud Computing (25 articles)
- …
- 16⚡ Day 15/30: Serverless Computing — What If We Don't Manage Servers at All? ☁️ This article
⚡ Day 15/30: Serverless Computing — What If We Don't Manage Servers at All? ☁️
🎮 Mission 15: The Server That Doesn't Need You!
Our college examination portal has come a long way.
Let's look at where we are now.
Students connect through the internet.
🌍 CloudFront helps deliver cacheable content closer to users.
⚖️ The Load Balancer distributes application traffic.
📈 Auto Scaling adds or removes EC2 instances as demand changes.
🔐 IAM controls access.
🗄️ Amazon RDS stores important application data.
🪣 Amazon S3 stores files and documents.
Our architecture is getting powerful.
But Rahul has one more question.
“Do we really need to run a server for every little task?”
The cloud architect pauses.
“Not necessarily.”
Imagine this:
A student uploads a profile picture.
We need to resize the image.
That's it.
The task might take only a few seconds.
Do we really want to keep a dedicated server running 24/7 just waiting for someone to upload a picture?
🤔
This is where Serverless Computing enters our story.
⚡ 1. What Does “Serverless” Actually Mean?
First, let's clear up a common misunderstanding.
Serverless does NOT mean there are no servers.
Servers still exist.
Someone still has to provide compute, networking, storage, and other infrastructure.
The difference is:
The cloud provider manages much of the underlying infrastructure so developers can focus more on the application code and its execution model.
With serverless services, you typically don't have to provision and manage individual servers for every small workload.
Think about our college.
Traditional approach
The college buys and maintains a photocopy machine that stays switched on all day.
1
2
3
4
5
6
7
Student needs photocopy
|
v
Dedicated machine
|
v
PhotocopyEven when nobody is using it:
1
2
3
Machine: ON
Students: 0
Work: 0Serverless-style approach
A service performs the task when needed.
1
2
3
4
5
6
7
8
9
10
Student requests task
|
v
Event happens
|
v
Code runs
|
v
Task completesNo need for us to manage a dedicated server just for that small task.
🧠 2. Meet AWS Lambda
One of the most important AWS serverless services is AWS Lambda.
Lambda lets you run code in response to events without managing the underlying servers yourself.
Imagine we write a small function:
1
resizeImage()We don't need to build an entire application server just for this function.
Instead:
1
2
3
4
5
6
7
8
9
10
11
12
13
📸 Student uploads image
|
v
Event occurs
|
v
AWS Lambda
|
v
Resize the image
|
v
Save the resultThe code runs when needed.
When the task finishes, the execution ends.
That's a completely different way of thinking about compute.
🏫 3. Our College Portal Gets a New Feature
Let's say students can upload profile pictures.
Rahul uploads:
1
rahul-profile.jpgThe college wants three versions:
1
2
3
4
5
6
7
Original
|
+----> Large
|
+----> Medium
|
+----> ThumbnailWe could build a traditional server specifically for image processing.
But that server might spend most of its time doing nothing.
Instead, we can use an event-driven architecture.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
👨🎓 Rahul
|
v
🪣 Amazon S3
|
Image uploaded
|
v
⚡ Lambda
|
+-------+-------+
| | |
v v v
Large Medium Thumbnail
| | |
+-------+-------+
|
v
🪣 S3 StorageNow something interesting happens.
The upload triggers the processing.
The function doesn't need to sit around waiting for Rahul.
🎯 4. Event-Driven Thinking
This is one of the most important concepts of serverless architecture.
Instead of saying:
“Keep this server running and wait for something to happen.”
We can think:
“When something happens, trigger the code that needs to respond.”
For example:
1
2
3
4
5
6
7
Student uploads file
↓
Event
↓
Lambda
↓
Process fileAnother example:
1
2
3
4
5
6
7
Student submits registration
↓
Event
↓
Lambda
↓
Send confirmationAnother:
1
2
3
4
5
6
7
Payment completed
↓
Event
↓
Lambda
↓
Update application workflowThis style is called event-driven architecture.
🚪 5. Serverless Doesn't Mean “No Application”
Our main college portal can still use EC2.
Remember:
1
2
3
4
5
6
7
8
9
10
11
12
13
Students
|
v
CloudFront
|
v
Load Balancer
|
v
EC2
|
v
DatabaseWe don't have to replace everything with serverless.
Instead, we can introduce serverless where it makes sense.
For example:
1
2
3
4
5
6
7
8
9
10
11
12
College Portal
|
+----------------+----------------+
| |
v v
Main Application Background Tasks
| |
v v
EC2 Lambda
| |
v v
RDS S3This is an important architecture lesson:
Cloud architecture isn't about choosing one technology for everything.
It's about choosing the right tool for the right workload.
🧩 6. Where Does Lambda Fit?
Let's look at a simplified architecture.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
👨🎓 Student
|
v
🌍 Internet
|
v
Application
|
+------------+------------+
| |
v v
Amazon RDS Amazon S3
Student Records Student Documents
|
|
File Uploaded
|
v
⚡ Lambda
|
v
Process DocumentThe main application handles the normal user experience.
Lambda handles a specific event-driven task.
⚡ 7. Lambda Functions Are Small Units of Compute
Imagine our college needs to perform several different tasks.
Task 1
Resize uploaded images.
1
2
3
Image Upload
↓
Lambda Function ATask 2
Send a notification after registration.
1
2
3
Registration Event
↓
Lambda Function BTask 3
Generate a report.
1
2
3
Report Request
↓
Lambda Function CInstead of creating one giant application server responsible for everything, we can separate certain tasks into focused functions.
1
2
3
4
5
6
7
Events
|
+------------+------------+
| | |
v v v
Lambda A Lambda B Lambda C
Image Notification ReportsEach function can have a specific responsibility.
🧠 8. Why Is This Useful?
Let's say our image-processing function runs only when students upload images.
At 3 AM:
1
Image uploads = 0There is no need for us to keep a dedicated image-processing server running simply to wait for uploads.
When an event occurs:
1
2
3
4
5
Image uploaded
↓
Lambda executes
↓
Processing completesThis can make the operational model much simpler for suitable workloads.
However, serverless doesn't automatically mean every workload will be cheaper or better. Architecture, invocation frequency, execution duration, data transfer, dependencies, and other factors matter.
💰 9. The Cloud Billing Mindset Changes
With traditional servers, you might think:
“I need a server running continuously.”
With serverless functions, the model is different.
You generally pay based on the serverless service's usage model rather than managing a continuously running server yourself.
For Lambda, pricing is based on factors such as requests and compute duration, with other applicable charges depending on the overall architecture.
The important idea for beginners is:
1
2
3
4
5
Traditional Compute
Server
████████████████████
Running continuouslyversus:
1
2
3
4
5
Event-Driven Compute
Event → Function Runs → Done
Event → Function Runs → Done
Event → Function Runs → DoneThis can be particularly attractive for workloads that are intermittent or event-driven.
🚨 10. But Serverless Has Limits Too
This is important.
Serverless is not magic.
You shouldn't automatically replace every EC2 application with Lambda.
Some workloads may be better suited to:
- Long-running processes
- Applications requiring specialized runtime environments
- Workloads with specific networking or infrastructure requirements
- Systems where another compute model provides better control or economics
Lambda also has service-specific limits and execution characteristics that architects need to understand.
For example, a Lambda function has a maximum execution duration.
So this:
1
2
3
4
Huge 24-hour computation
|
v
Lambda?may not be the right design.
Always start with the workload.
Then choose the technology.
🎮 11. The College Portal Gets a New Requirement
The examination department introduces a new rule.
Every time a student successfully registers for an examination, the system should send a confirmation notification.
The old approach:
1
2
3
4
5
6
7
Student
|
v
Application Server
|
v
Send NotificationThis can work.
But now imagine thousands of registrations happening together.
The application server has another responsibility.
What if we separate the task?
1
2
3
4
5
6
7
8
9
10
11
12
13
Student
|
v
Registration
|
v
Registration Event
|
v
Lambda
|
v
Send NotificationNow our main application can focus on registration while a separate serverless function handles the notification task.
🔔 12. Events Can Come From Many Places
Serverless architectures become really interesting when we start connecting events.
For example:
1
2
3
4
S3 Upload
|
v
LambdaOr:
1
2
3
4
API Request
|
v
LambdaOr:
1
2
3
4
Database / Application Event
|
v
LambdaOr:
1
2
3
4
Scheduled Event
|
v
LambdaThe basic pattern remains:
1
2
3
4
5
6
7
Something happens
↓
Event
↓
Code responds
↓
Task completesThis is the heart of event-driven serverless design.
🌐 13. What About APIs?
Let's say we want to create a small service:
1
GET /exam-statusA student opens the app.
The request needs some backend code.
Instead of putting that small API behind a traditional server, we can build an API using a managed API service and invoke Lambda for the backend logic.
Conceptually:
1
2
3
4
5
6
7
8
9
10
Student
|
v
🌐 API Endpoint
|
v
⚡ Lambda
|
v
🗄️ DatabaseThis is another popular serverless architecture pattern.
The exact AWS services and configuration depend on the API design.
🏗️ 14. Our Architecture Is Becoming Hybrid
Look at our complete college portal now.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
👨🎓 Students
|
v
🌍 CloudFront
|
+---------+---------+
| |
v v
Cached Content Dynamic Requests
|
v
⚖️ Load Balancer
|
v
📈 Auto Scaling
|
+---------+---------+
| | |
v v v
EC2-1 EC2-2 EC2-3
|
v
Amazon RDS
|
|
Application Events
|
+---------------+---------------+
| |
v v
⚡ Lambda 🪣 Amazon S3
Background Tasks Documents
^ |
| |
+---------- Events -------------+This architecture combines multiple computing models.
That's completely normal.
A real cloud architecture may contain:
- Virtual machines
- Containers
- Serverless functions
- Managed databases
- Object storage
- Load balancers
- CDNs
- Queues
- APIs
The goal isn't:
“Use serverless everywhere.”
The goal is:
“Choose the right compute model for each workload.”
🧠 15. Serverless vs EC2
Let's make the difference simple.
| Feature | Amazon EC2 | AWS Lambda |
|---|---|---|
| Basic model | Virtual server | Function-based compute |
| Server management | You manage the instance | AWS manages the underlying infrastructure |
| Typical execution | Long-running applications | Event-driven tasks and APIs |
| Scaling | You configure scaling | Service manages function execution scaling within its model and limits |
| Best mental model | “My server runs my application” | “My code runs when needed” |
Neither is automatically better.
Think about the workload.
College portal main application
1
2
3
Long-running web application
↓
EC2 can be a suitable choiceResize uploaded image
1
2
3
Event-driven task
↓
Lambda can be a suitable choice🎯 16. Cloud Architect Challenge
You are designing the next version of our college portal.
Choose the most suitable starting point.
Challenge 1
Students upload profile pictures.
The system needs to create thumbnails automatically.
1
2
A. Dedicated server waiting 24/7
B. Event-driven Lambda functionAnswer: B is a strong serverless pattern for this event-driven task.
Challenge 2
The main college portal is a long-running web application with specific runtime requirements.
1
2
A. Automatically use Lambda
B. Consider a suitable compute platform such as EC2Answer: B
Always evaluate the workload before selecting the compute model.
Challenge 3
A student submits an application and we need to trigger a small background task.
1
2
3
4
5
Student Action
↓
Event
↓
Serverless FunctionAnswer:
This is a strong candidate for an event-driven serverless pattern.
🔥 17. The Big Story: From Servers to Events
Let's look at how our thinking has changed.
Old thinking
1
2
3
4
5
6
7
8
9
10
I need a task.
↓
Create a server.
↓
Keep the server running.
↓
Wait for the task.Serverless thinking
1
2
3
4
5
6
7
8
9
10
Something happens.
↓
Trigger a function.
↓
Run the code.
↓
Finish the task.That's a major shift in cloud architecture.
🏫 18. Rahul's Upload
It's now 7:30 PM.
Rahul uploads his profile picture.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
📸 rahul.jpg
|
v
🪣 Amazon S3
|
| Object created
v
⚡ Lambda
|
+----> Resize
|
+----> Create thumbnail
|
v
🪣 S3Rahul doesn't know or care which server processed the image.
He simply sees:
1
✅ Profile picture uploadedBehind the scenes, the cloud architecture handled the event.
That's the beauty of abstraction.
The user sees a simple experience.
The architecture underneath can be sophisticated.
🧩 19. Day 1 vs Day 15
Let's compare how far we've come.
Day 1
We asked:
What is cloud computing?
We learned that cloud computing provides on-demand access to computing resources over a network.
Day 15
We're now asking:
Which computing model should handle this particular workload?
That's a much deeper architectural question.
We've gone from:
1
☁️ “What is the cloud?”to:
1
🏗️ “How should I design my cloud architecture?”And that's exactly the journey this 30-day challenge is meant to create.
🏆 Mission Complete!
Today, our college portal learned a completely different way of thinking about compute.
We discovered:
⚡ AWS Lambda
Run code in response to events without managing individual servers.
🎯 Event-Driven Architecture
Something happens → code responds.
🪣 S3 + Lambda
An object upload can trigger processing.
🌐 APIs + Lambda
API requests can invoke serverless backend logic.
🧠 Hybrid Architecture
Use EC2 where long-running compute makes sense and serverless where event-driven execution fits.
Most importantly:
Serverless doesn't mean servers disappeared. It means we don't have to manage the underlying servers in the same way.
🚀 Coming Up on Day 16/30
📨 Queues & Asynchronous Processing — What Happens When Everything Doesn't Need to Happen Immediately?
Our college portal is getting smarter.
But imagine this situation:
10,000 students register for examinations at exactly the same moment.
Every registration creates several tasks:
1
2
3
4
5
6
7
8
9
Registration
|
+----> Save data
|
+----> Send notification
|
+----> Generate confirmation
|
+----> Update another systemWhat if one of those services becomes temporarily slow?
Should the entire registration process wait?
🤔
What if we could place work into a queue and let different services process it when they are ready?
That is the next mission.
📨 Day 16: Queues & Asynchronous Processing — How Do Cloud Systems Handle Sudden Bursts of Work?
Our architecture is about to become even more resilient.
☁️ Build it. Secure it. Scale it. Accelerate it. Automate it.
#CloudComputing #AWS #CloudArchitecture #Serverless #AWSLambda #EventDrivenArchitecture #30DaysOfCloud
Series: Cloud Computing (25 articles)
- …
- 16⚡ Day 15/30: Serverless Computing — What If We Don't Manage Servers at All? ☁️ This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article