Polar Bears, Serverless and Sustainability
Back in 2017, a video of a starving, emaciated polar bear rummaging through garbage trying to find food went viral. A friend showed it to me. After watching it together, she looked at me with very sad eyes, on the verge of tears, and said “Let’s save the polar bears!”
I said, “Of course, we will.”
Since then, that vow has affected many small choices in my life. For example, even as a coffee lover, I have had to stick to either instant or using a normal drip coffeemaker. When I was thinking about using coffee pods instead, like Nespresso, for their great mix of speed, convenience and taste, my friend shot down the idea pretty quickly due to the amount of waste they produce. “We need to save the polar bears,” she reminded me.
Nespresso was a no go. I need to help save the polar bears, after all.
At last year’s re:Invent (2021), AWS announced a significant change in the 5 Pillars of the Well-Architected Framework. There’s now a new, 6th pillar: Sustainability.
That’s right. Just by being well-architected, we can now help save the polar bears!
Like the shared responsibility model for security, there’s a shared responsibility model for cloud sustainability:
- AWS is responsible for sustainability of the cloud. This includes delivering efficient, shared infrastructure, water stewardship, and sourcing renewable power.
- The customer is responsible for sustainability in the cloud. This includes optimizing workloads and resource utilization, and minimizing the total resources required for workloads.
Sustainability of the cloud
Cloud providers like AWS are in a unique position to offer services at a much lower carbon footprint than typical non-Cloud alternatives like your local data center or colocation. AWS invests in efficient power and cooling technologies, and prioritizes energy efficiency in their server population.
(With each availability zone (AZ) typically being an entire building or multiple buildings, you can see why they would. Energy costs are a huge expense at that scale, and getting more utility out of every watt results in better business, aside from being more environmentally-friendly.)
Aside from using more energy-efficient technologies, Cloud providers simply achieve higher server utilization and infra reuse rates than the equivalent on-prem installations. 100 big customers, if they all had to individually deploy to their own on-prem sites, would end up using more infrastructure (and a much higher carbon footprint) than if the same 100 customers were to use the Cloud instead, because workloads in the Cloud take advantage of shared resources (networking, power, cooling, etc).
Sustainability in the cloud
Cloud sustainability from the perspective of the customer (that’s you and me) is a continuous effort focused on energy efficiency. How do we minimize the energy we use for our workloads, without compromising performance and reliability?
This is a wide-ranging effort which spans everything from algorithm selection (slow algorithms mean more wasted CPU time compared to faster algorithms available) to programming language (which impacts not just raw performance but availability of tools and libraries, all of which matter a great deal in being able to efficiently solve complex problems), efficient data storage techniques (not wasting storage through appropriate lifecycle policies), optimizing infrastructure sizing (a good business goal in any case, even if you weren’t interested in saving the polar bears), and using advanced cloud services (serverless = higher sustainability; more on this later)
I’d like to give a bit more focus on two things here: Region selection, and serverless.
Sustainability move #1: Region selection
Amazon has renewable energy projects across the globe. You can find out which AWS Regions use renewable energy, and this can help you decide where to deploy your workloads. If two or more AWS Regions offer pretty much the same latency for your customers, you might as well choose the region which uses renewable energy.
Just this simple act of choosing an equivalent AWS Region powered by renewable energy, whenever possible, goes a long way to being more sustainable — no rearchitecting required.
You can use this map to find Amazon’s global renewable energy projects near potential AWS Regions you are considering. It’s a bit more involved right now than it could be to just find AWS Regions that use renewable energy (or even down to the AZ level), but they aim to be 100% renewable energy for their data centers by 2025, so this should shortly be a minor issue.
Sustainability move #2: Explore serverless
Remember earlier when we were talking about how Cloud providers like AWS have higher resource utilization through shared resources at scale, and this allows them far higher total efficiencies than typical on-prem deployments?
Well, serverless is the ultimate expression of that. Serverless services allow AWS to be much more efficient compared to non-serverless offerings. For example, running Lambda-based workloads will be far more efficient and sustainable than running EC2-based workloads.
From the AWS perspective, they are more able to tune and operate efficiently at scale when serverless services are used.
From the customer perspective, serverless offloads a lot of architectural concerns for operational efficiency. To take Lambda again as an example, we stop having to worry about creating an auto-scaling group, minimum always-on instances, sizing of the instances themselves, and tuning when to scale in, like we would if we were using EC2-based workloads. Instead, if we were using Lambda, we’d be in a massive shared resources pool managed by AWS themselves. So us doing less work actually helps create more sustainable deployments.
That’s a massive win in my book. Serverless all the way!
And it’s not just Lambda. Take databases, too. If you had an RDS cluster, you’re essentially hogging a fixed amount of compute time for your workload. It’ll likely be a huge one given the demands of databases, and likely overprovisioned to some degree due to the need to handle spikes. In contrast, a serverless database like DynamoDB would be far more efficient. Just like Lambda, it’s running on a massive pool of shared resources, and you pay per capacity used (read and write capacity units), instead of metering a running server that’s on 24/7. AWS is able to make more efficient operations and infrastructure using DynamoDB compared to RDS.
When it comes to analytics, Athena vs a dedicated Redshift cluster is the same way. If you have relatively simple needs that can be solved through Athena instead of a dedicated Redshift cluster, Athena is a far-more efficient service c/o being fully serverless, running on a massive pool of shared resources that AWS tunes and manages at scale. You don’t instantiate a cluster and worry about utilization. Instead, you just get charged for what you actually use, which drastically cuts down on your operational responsibility to be more efficient and sustainable. (Your responsibility still isn’t zero, though. You need to make sure your Athena queries are properly partitioned and targeted so you don’t end up wasting compute time reading through irrelevant data — but you’d be doing that optimization anyway, even if you weren’t interested in being environment-friendly, because that affects your cloud bill!)
We’ve only got one planet, and although this planet will live on despite our worst efforts, it would increasingly become less and less hospitable to us — and our children — if we don’t take sustainability seriously.
I hope you’ve taken a few things from this article that will help with the global sustainability effort through your Cloud journey. You can help in significant ways, even with just little effort, and they all mostly make sense even from just the perspective of your bottom line. Good for your bank account, good for the environment.
Put more workloads into the Cloud. Choose Regions that use renewable energy. Go serverless whenever you can.
Update: Want to learn more about getting started with serverless? Here are some relevant articles I’ve previously written that can help: