Internet & Networking

AWS Lambda

Also known as: AWS Lambda function, serverless function, FaaS

Lambda is AWS's serverless compute service.

You write a function (in Python, Node.js, Java, or other languages), upload it to Lambda, and it runs whenever triggered -- by an HTTP request, a file upload to S3, a database change, or a scheduled timer. You pay only for the milliseconds your code runs.

AWS Lambda, explained at three levels

At home

Imagine you only need to run some code when a user uploads a photo -- not constantly, just then. Lambda lets you do that. You write the code, and AWS runs it exactly when needed. You're not charged when nothing is happening.

At work

Lambda eliminates the need to manage servers for tasks that don't run continuously. Instead of keeping a server running 24/7 to resize images, you write a Lambda function that fires whenever a new image arrives and terminates when done.

Real-world examples

At home

Fatima built a Lambda function that runs every night at midnight (triggered by EventBridge Scheduler) to fetch the day's weather data from a free API and save it to S3. Zero servers, zero idle cost.

At work

Marcus's team uses Lambda with API Gateway to power their REST API. Each endpoint is a separate Lambda function written in Python. During a product launch with 50x normal traffic, Lambda scaled automatically -- they noticed nothing in the logs except increased invocation counts.

Common confusions

  • Serverless means there are no servers — There are still servers -- you just don't manage them. AWS provisions, patches, and scales the underlying infrastructure. 'Serverless' means server-free for you, not server-free in reality.
  • Lambda is always cheaper than EC2 — Lambda is cheaper for intermittent, low-volume workloads. For continuous high-throughput processing, EC2 or containers are often more cost-effective because Lambda's per-invocation billing adds up.

For analysts

BAs can use Lambda to automate data pipelines -- a Lambda triggered by an S3 upload can clean and transform a CSV, load it into a database, and send a Slack notification, all without IT involvement once set up.

History & origin

AWS launched Lambda in 2014, coining the term 'serverless' as a category. The idea -- code that runs on demand without servers you manage -- was radical at the time. Lambda popularized event-driven architectures and spawned a wave of serverless services. Today all major cloud providers offer equivalent services (Azure Functions, Google Cloud Functions), and serverless is a mainstream architectural pattern.