December 10, 2019
AWS Serverless Architecture Economic Advantages and Benefits
First, you finally moved your compute load off those servers you bought and maintained for years to servers someone else bought and maintains. You pay them for the space, but it’s easier than ever now to size up or size down your footprint. You’ve reduced your hardware costs, and now a lot of things have become someone else’s problem.
That’s why we all love the cloud (even if some of us were a little reluctant to make the migration.
So the next frontier? AWS Lambda. No servers to provision or manage. Why? Because AWS Lambda charges you for compute time not server space. It’s sometimes called serverless computing, but there are (of course) actual servers running your code. It’s just a different way of charging you and a different way for you to think about your infrastructure needs.
Let’s cut through the hype and dig in to what Lambda really is and what else you should be thinking about if you’re considering switching over.
This comes mostly from calling Lambda serverless computing. It’s catchy, attention-grabbing, and memorable — and who wouldn’t love to get rid of servers? But it’s hugely misleading.
What AWS Lambda really allows you to do is “run code without provisioning or managing servers.” That doesn’t mean there aren’t servers, but it’s also nothing to sneeze at. No longer having to worry about provisioning or managing servers sounds great, doesn’t it?
But Lambda doesn’t remove the need to develop the code or load it into Lambda. You still need your team to do that, and you still need your team to make code changes as your software environment evolves. What it does mean is that your team isn’t spending time on relatively low-value tasks like managing servers. With AWS Lambda, your team can focus squarely on code development. And that’s a real boon.
Yeah, if only, right?
One important thing to remember is that most applications require some resources from the operating system in order to run correctly. Because Lambda has no underlying operating system, you can’t just lift-and-shift from your current architecture (cloud or not) to Lambda.
That transition takes some serious thinking, with some real heavy lifting, both mentally and technically. Is it worth it? It depends. If your application is web-based and request-driven (like most are nowadays), Lambda may not be a good fit. But if you’re running simple, short compute jobs? Lambda may offer substantial savings over the alternatives.
The real goal of something like Lambda is to help you avoid paying for resources you’re not using. Every web-based application has peaks and valleys in its traffic load pattern, and sometimes the delta between peak and valley is enormous.
Provision for peak time, and you’re wasting a lot of money on underutilized capacity. Provision for valleys, and you’re going to end up with poor quality of service and frustrated users who won’t stay your users for long. Autoscaling provides an answer to that.
Let’s say you have a server built with loads of dependencies compiled and installed to get your app up and functional. Directly from the AWS console, you can create an AMI of that server and create a launch configuration with an autoscaling group. The more difficult part of the setup is determining what triggers cause the system to scale up and down, and the process of automating the autoscaling group. Will the scaling be driven by SQS, EC2, or ELB?
These are technical details to figure out, but once you’ve built that system, you get a lot of the same cost benefits that so-called serverless computing gets you. Autoscaling can trigger and create the exact number of servers you need precisely when your app needs them (including going to NO running servers). The result? Lower AWS spends each month. Cost optimization without the big transition to serverless architecture.
Serverless architecture is definitely an option to consider for a lot of systems. And while it seems like it’s the next cool shiny new thing, it’s not the right answer for every application migrating to the cloud (or already in the cloud). Before you assume AWS Lambda or another serverless system is right for you, take the time to deeply assess your infrastructure. Autoscaling may get you to the same or similar place financially with fewer technical hurdles and a more robust technical environment with lower mean time to recover performance.