AWS Lambda
WHAT IS IT? [Azure Serverless/ Google Functions]
AWS Lambda lets you run code on a tiny piece of compute called an “execution environment”, even more abstracted than an EC2 instance or virtual machine. This is why Lambda-based systems are often called “serverless”: there are still servers somewhere in the works, but they’re so far away that it’s beyond our worries.
You can trigger Lambda functions with events, such as a click of a button on your website or by uploading a photo. Perhaps I’ll integrate some Lambda functions of my own into the Marcoverse. For example, when you talk to Alexa voice assistant, your question might not be querying a specific relational database to check for the response. Instead it may be passing a request through AWS API Gateway to a Lambda Function. Those in turn can trigger another lambda function, and so on. Once again, in very classic AWS fashion, it’s Lambda daisy-chaining all the way down the rabbithole.
To be clear, this kind of scaling is very different from auto-scaling if you have users spread across multiple servers. A million users hitting your site may just trigger a million unique Lambda events. The difference between 1 user and a million calling that action is a fraction of the cost, not speed. You only pay for whenever and whatever code your application executes.
WHAT’S THE FUSS?
It’s a whole different paradigm! Lambda functions have short runtime limits, capped at 15 mins, and usually that’s pushing it. lambda functions are designed for short runtime limits for a lot of good reasons, relying heavily on event-driven programming. Many people refer to serverless artchitectures as the future of applicaions. From a business perspective - especially if you’re team GoGoGadgetCorporate - the primary reason serverless architectures can are useful is in their extraordinary cost saving compared to traditional machines. Lambda calls are free up to 1 million requests, and only 20p per million requests after that.
Consider sites like GoCompare, or TrainLine, who charge you a commission of 99p or so per booking - the profit margins are absolutely outrageous.
To put this into perspective, by using serverless and lambda to work the back-end of your application, compute costs to serve millions of users becomes a rounding error. If you see an opportunity to offload some operations down the Lambda drain, there’s a good chance that you should.