A Wild Lambda Appeared!
06/02/2025 - Raúl Cano
Lambda... Lambda... What is that?
Sometimes I hear about concepts I have no idea about, and I love that feeling.
It’s like “Let’s go figure out what that is!”
Today I heard about lambda while talking about backend development.
My mind was like “A wild rare Pokemon has appeared! It’s Lambda!”
A - Fight B - Run away
I pressed A. Let’s find out what this new term is
What is this pokemon Lambda?
First, let’s clarify that “Lambda” is just the name AWS gives to their “serverless functions”. Every cloud provider has their own version, Azure calls them “Azure Functions”, Vercel calls them “Serverless Functions”, Cloudflare calls them “Cloudflare Workers” and so on.
Imagine your server, the one you use when deploying your apps. It’s running constantly whether you have requests or not, which means you’re going to be charged for its consumption (resources, compute time, etc.) even when it’s chilling.
With the Lambda approach, that changes. Instead, you have a collection of functions that are only triggered on-demand.
The Lambda service runs your function only when needed and scales automatically. You only pay for the compute time that you consume—there is no charge when your code is not running.
Traditional Server (like NestJS):
// Look, this server is always running somewhere
@Controller('documents')
export class DocumentController {
@Post('process')
async processDocument() {
// Yes, this code runs only when someone hits the endpoint
// But hey, the server is still alive and kicking all the time!
}
}
The annoying part? If nobody’s using your app, you’re still paying. And if suddenly everyone wants to use it, you need to upgrade the whole machine! Now, Lambda functions are different:
There’s no server running all the time - the function is just chilling, doing nothing. It only wakes up when someone needs it (like when they make a request). The cool part? You only pay for those few milliseconds it’s actually doing something!
// This guy only exists when someone calls it
export const handler = async (event) => {
// It does its job and then... poof! Disappears completely
}
A funny analogy woulf be:
-
Having a restaurant open 24/7 with chefs just waiting around (your NestJS server)
-
Having magic chefs that appear ONLY when someone orders food (Lambda)