Handling 350k Requests for $3 using Lambda
No servers to manage, no maintenance, deploy and forget. I think I found a valid use-case for Lambda.
Since its launch towards the end of 2014, Lambda has created a lot of hype, and more importantly, brought the term “serverless” into the industry. At its core, “serverless” does not mean that there are no servers or anything; there are servers, but you are not the one managing those servers. You don’t know where your code is running, you don’t SSH into a server, you don’t do anything that you’d do with regular servers or VMs. You just give a function you’d like to execute to Lambda and let it run the code for you.
As an example, let’s say you have a function that takes a list of products and calculates the price of the whole cart, including various subtotals, shipping prices, and grand totals. If this is one piece of a bigger service, then it might be fine to keep it there. However, if this is a functionality that will be shared between different use-cases, or if this is a full service on its own, then you need to consider how to deploy, manage, and scale it. This exact point is where serverless platforms like Lambda jump in:
- Build a ZIP archive of your code
- Upload it to Lambda
- Map an API Gateway to your lambda function
- Bam, you are done: you…