Carbonless Framework

The best way to minimise carbon emissions in the cloud. A plugin for the popular serverless framework introducing carbon awareness to serverless applications.

  • 0 Raised
  • 492 Views
  • 0 Judges

Categories

  • This hackathon has categories available. Please select one if necessary.

Gallery

Description

1. The Problem

Cloud computing causes more carbon emissions than the entire airline industry. To save millions of vulnerable people across the world whose lives are threatened by climate change, software developers need to do everything we can to reduce the carbon emissions from our applications.

Serverless computing is hugely popular and has been adopted by over half of companies using cloud technology. It’s seen by many as one of the best ways to reduce emissions. Serverless applications are inherently scalable, and they only run when needed. Serverless aligns with the green software design principles, it’s hardware-efficient and energy-efficient. However, it’s missing one vital element… you guessed it, carbon awareness.

Serverless takes care of almost all server management, however it leaves one key decision to the developer; which region to deploy their application to. The carbon intensity of each region is constantly changing, and developers can't know where the best location to run their code is. The result is that most serverless applications are deployed to regions with high carbon intensities, resulting in huge amounts of carbon emissions that could have easily been saved.

To summarise, there's no clear way to minimise the carbon emissions from our applications. Serverless computing is considered the best option, but it hasn’t been optimised to minimise carbon emissions. Until now that is.


2. The Solution

Introducing the Carbonless Framework, the best way to develop green applications. Carbonless is an open-source plugin for the hugely popular Serverless Framework, which is used to deploy 90% of serverless functions in AWS.

To explain how it works, let's consider how the Carbonless Framework could reduce the emissions of the Green Software Foundation’s website.

On the home page of the Green Software Foundation’s website, users can sign up to receive the newsletter. Let’s assume that when a user enters their email and clicks ‘sign up’, a serverless function is called which adds the user to the mailing list. This serverless function was deployed using the serverless framework to the default region, US East. Regardless of the carbon intensity in US East, which may be huge, that is where the sign up function will run.

Let’s explore what would happen if the developer added ‘Carbonless’ to the list of plugins. This time the sign up function is automatically deployed to multiple regions. When the user clicks ‘sign up’, the Carbonless plugin will use the Carbon Aware API to check which region has the lowest carbon intensity, and the code will run where the carbon intensity is lowest.

The result is really exciting! The function will only run when needed, and only in the region with the lowest carbon intensity. Using the Carbonless Framework means you can minimise the carbon emissions from any application.


3. Using the Carbon Aware API

The Carbonless Framework uses the Carbon Aware API to, in real time, get the region with the lowest forecasted carbon intensity, and run the code in that region.


4. Impact

In my tests, the Carbonless Framework was able to reduce the average carbon emissions of an application by 53%. I compared the average carbon intensity in the default region, East US, over a week, with the average carbon intensity using Carbonless. This is an incredibly high reduction! Consider the potential carbon savings if Carbonless was adopted at scale. 

There are only around 1000 plugins for the serverless framework, some with 30m+ downloads, and none of them target sustainability. As the pressure to reduce the carbon footprint of applications increases, this plugin could have a very high reach, becoming one of the most popular in the serverless framework, adopted by millions of developers around the world.

Ismael Velasco discussed the impact of this idea in the latest episode of the Environment Variables podcast, have a listen here.


5. Feasibility

With 2 weeks capacity I could get the plugin to production. I have a working prototype, with further testing I would be confident enough to publish it to NPM. I recently deployed the world's first Carbonless application using the plugin, soon, developers across the world will be able to adopt the Carbonless Framework.

Adopting the Carbonless Framework is as easy as installing the plugin from NPM and adding 'Carbonless' to the list of plugins. Everything else is taken care of automatically, developers can sit back and watch their carbon emissions decrease.

More developers than ever are aware of the carbon footprint of their applications, thanks to the introduction of carbon footprint dashboards by AWS, Azure and GCP. Furthermore, there is mounting pressure for developers to reduce the carbon emissions from their applications. The International Sustainability Standards board recently required organisations to disclose scope 3 emissions in their reporting, meaning companies across the world will be reviewing the carbon emissions from their software suppliers. Software developers need an easy way to be able to reduce the carbon emissions from their applications, and the Carbonless Framework is easy to adopt and offers huge reductions. 

Developers could easily find the Carbonless plugin on the Serverless Framework plugins directory. I also intend to create marketing content and advertise this plugin within my network, and with the help of the Green Software Foundation, this could be amplified to green software engineers across the world.


6. Vision

I believe that Carbonless Framework is the best way to develop applications. The introduction of Carbonless today could be as significant for the planet as the introduction of Serverless 10 years ago. I intend to use Carbonless in all my future projects, and hope it will be adopted by millions of developers across the world, saving unimaginable amounts of carbon.

Right now the plugin is the easiest way for developers to adopt the Carbonless Framework. However, if the plugin is successful, I think it would be incredible to see this approach become a core part of the serverless framework, or better still implemented by cloud providers. Imagine if cloud providers, such as Azure, offered 'Carbonless Functions' which always ran in the region with the lowest carbon intensity. This would have an even greater reach than my serverless plugin!

As well as changing where the code runs, another huge opportunity for carbon savings would be to change when scheduled jobs run. Demand shaping is a topic that has been explored in-depth during CarbonHack22 and it would be great to introduce it to the Carbonless Framework. A carbon trigger could invoke scheduled functions when the carbon intensity is lowest. Meaning scheduled workloads run in the region with the lowest carbon intensity, when the carbon intensity is lowest.

The Carbonless Framework wouldn't have been possible without the amazing team behind the Carbon Aware API, without the incredible support and advise from Asim and Ismael at the beginning of this journey, and without the support of my colleagues, family, and friends. Carbonless is the result of many amazing people, and that's not going to stop once this hackathon ends. With the contribution of open-source developers and green software engineers across the world, who knows where Carbonless could take us. 


7. Code

https://gitlab.com/JonathanBell09/serverless-plugin-carbonless