How to migrate a traditional Express API to Serverless and save tons of money

One of the key tenants of Serverless is that you only pay for what you use. You pay for the bandwidth and compute that is used when your function is called and nothing more. Without serverless, applications just run all the time and, well, it's kinda wasteful.

You can think of Serverless like this faucet...

You have water faucets like this one in your house. One way for that faucet to work is for water to just come out all the time. It's always on and whenever you need a drink, you just walk over and fill up your cup. But we don't do that. Why? Because it's wasteful. Instead, we turn the water on when we need it and off when we don't. We only pay for the water we use.

Serverless uses the same concept. Whenever a request is made, the function is loaded into memory and then executed. When the function is not running, it goes dormant and you are not charged for it. This means that it's going to be far cheaper to use Serverless than a traditional application hosting solution.

In this video, I'll walk you through moving an API that's running in a traditional web server model with Express over to Serverless.