DEV Community

Cover image for I fired my server manager: Running Python on AWS Lambda (Serverless)
Eric Rodríguez
Eric Rodríguez

Posted on

I fired my server manager: Running Python on AWS Lambda (Serverless)

Day 5 of going All-in on AWS.

Yesterday, I launched an EC2 server. It was powerful, but it required maintenance. I had to worry about updates, security groups, and keeping the OS running. Today, I decided to go Serverless.

I used AWS Lambda. This is where my background in Python (thanks Harvard CS50P! 🐍) really meets the Cloud.

The Shift: EC2 vs. Lambda

EC2 (Yesterday): I rented a virtual computer. I paid for the time it was running, even if it was doing nothing.

Lambda (Today): I just uploaded a Python function. I didn't pick an OS. I didn't configure a network. AWS runs the code only when triggered.

The Experiment

I wrote a simple Python handler. Instead of an Apache web server running 24/7, this is event-driven compute.

The "Aha!" Moment: Check the screenshot below. Look at the "Billed Duration". It says XX ms (milliseconds).

I ran code in an Amazon data center, and I was only billed for a fraction of a second. This is the ultimate efficiency. For a developer who loves code but hates managing patches and updates, Serverless feels like a superpower.

Tomorrow? We tackle the final boss: AI.

Top comments (0)