Building a Sustainable Web: a practical exploration of Open Source tools and strategies
Tags: opensource, sustainability, envsustainability
Published: 2024-06-13 10:25:38

---
title: Building a Sustainable Web: a practical exploration of Open Source tools and strategies
published: true
date: 2024-06-13 09:00:00 UTC
tags: opensource,sustainability,envsustainability
canonical_url: https://tech.sparkfabrik.com/en/blog/building-a-sustainable-web/
series: Sustainability
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h86dj97vka4un39s8fv4.jpeg
---

## Introduction
In the past few years I've been deeply concerned about climate change. My journey on **web environmental sustainability**
started by chance when I stumbled upon the concept of "sustainable web".

I first learned how to create a better **User Experience** taking in consideration sustainability principles 
and strategies, but it wasn't enough. I wanted to go deeper and understand more about the environmental impact of the web.\
In this blog post I will share my journey, the tools and the strategies I've come across and learned and, last but not least, the 
role of Open Source and the relevance of its community aspect.

## Let's start from the beginning
For me, **the Internet has always been my happy place**: it made me discover many of my passions and hobbies, it allowed me to learn new things, connect with people, entertain myself with some tv shows or movies and *even work*.

However, the Internet has various cons, and one of them is that, sadly, **it is not very environmentally friendly**.

> "If the Internet was a country, it would be the 4th largest polluter" - [Sustainable Web Manifesto](https://www.sustainablewebmanifesto.com/)

The sentence above is the opening sentence of the **Sustainable Web Manifesto**, and it has been the very first sentence I 
read about web sustainability.\
It broke down the idea I had of the web being a "place" with only positive aspects and made me realize that, in reality, it
has some responsibilities regarding the environment. 

In fact, **the Internet is responsible for about 4% of total CO2 emissions**, which
may seem like a small percentage, but it's actually double the emissions of the air transport sector ("only" 2%).

## UX and Web Sustainability
The "first stop" of my journey was related to User Experience: on the occasion of **UX Day 2023**,
an Italian conference that took place in Faenza, I had the opportunity to bring my contribution with a talk called “**UX and Web Sustainability**”.

You can find the recording [here](https://youtu.be/jcPiD0WG0nk?si=rK6YMqDl0akhxb8R).

![Valeria Salis speaking at UX Day 2023 in Faenza, Italy. Valeria has short hair and is wearing a black t-shirt and the coloured badge from GrUSP.](https://tech.sparkfabrik.com/images/content/sustainability/ux_day_vsalis.webp)

If you've been following this tech blog for a while, you might have encountered my previous [blog post](/en/blog/20231018_ux_and_sustainable_web/) about this specific
topic, but I will summarize the main points here:
- sustainability also means *speed*, *performance*, *usability* and *accessibility* 
- applying sustainability principles will make our websites load faster and help users navigate them more easily
- designing for the environment also means designing for everyone because when the majority of people are able to navigate our websites and applications, the energy required to run them won't be wasted.

> _Working towards a more environmentally friendly UX will make users happier_.

Great starting point, wasn't it? It wasn't enough for me, though.

![A cat with a bored expression.](https://tech.sparkfabrik.com/images/content/sustainability/meh-cat.webp)

## Cloud Native Sustainability Week
The second stop of this journey took place in October 2023 on the occasion of **Cloud Native Sustainability Week**, which
is a global event organized by the [CNCF (Cloud Native Computing Foundation)](https://www.cncf.io/).

It's a series of local meetups around the topic of **sustainability in the cloud native ecosystem**: basically
is that time of the year when the local communities involved with the CNCF dedicate time to spread awareness and share content 
(blog posts, talks, panels, etc.) about environmental sustainability.

You can find more information about the event [here](https://tag-env-sustainability.cncf.io/events/cloud-native-sustainability-week/).

I had the opportunity to attend the meetup in Milan and contribute with a lightning talk about "how bad we use the Cloud"
and the consequences of our approach.\
The main takeaway I would like to share here is that we should be more aware of the data we store because **approximately 90% of cloud data is used only one time**.

> We store data and then forget about it, but it's still there, consuming energy and resources.

## As a software developer, what else can I do?
By that time, I had learned the importance of applying sustainability principles to the user experience, and the benefits not only for the environment, but also for the users. I had also learned that **we need to be more aware of our data**, how we use it, and its impact on the environment.

But UX and cloud are just two pieces of the puzzle, and in some ways on opposite sides of our applications.\
There's a lot more between UX and the cloud, so I kept going back to fill in the gaps I had in my head.

## Green software for practitioners
One of the first resources I came across was the online course [Green software for practitioners](https://training.linuxfoundation.org/training/green-software-for-practitioners-lfc131/) created by the [Green Software Foundation (GSF)](https://greensoftware.foundation/) along with [The Linux Foundation](https://www.linuxfoundation.org/).

If you're not familiar with the GSF, their mission is to "_build a trusted ecosystem of people, standards, tools and best practices for developing
and building green software_". 

*Spoiler: later we will have a look at one of the tools they developed!*

Getting back to the subject of this paragraph, if you're a software developer or someone involved in _building, deploying, or managing a software application_ and you want to do so in a greener way, I would recommend the Green Software for Practitioners course as a starting point.

I recommend this course for several reasons, including:
1. it is an online course and entirely self-paced 
2. it gives you a complete glossary and a proper introduction to the main topics around green software development

Today I will give you a "teaser" of some of the key concepts I've learnt from the course, but I highly recommend you to fully take it.

### Main actions to reduce the carbon footprint of software
To reduce the carbon footprint of software, we must consider three main actions:
- 🍃 **Energy efficiency**, which consists of _consuming_ the least amount of electricity possible
- 💻 **Hardware efficiency**, which consists of _using_ as little embodied carbon as possible
- 🌱 **Carbon awareness**, last but not least, the purpose of this action is _doing more when the electricity is clean and less when it's dirty_ (e.g., using demand shifting and/or demand shaping methods);

### What you can't measure, you can't improve
The second topic I wanted to share in this blog post is the importance of **measuring**, which is also one of the main chapters in the course.\
Indeed, in order to improve the environmental sustainability of our software, we need to measure its impact on the environment.

#### Greenhouse Gases Protocol (GHG)
The [**Greenhouse Gases Protocol (GHG)**](https://ghgprotocol.org/) is the most widely used and internationally recognized greenhouse gas accounting standard. 
It divides emissions into three main **scopes**:
- **Scope 1**, _direct_ emissions from operations owned or controlled by our organization (or the one we're applying this protocol for)
- **Scope 2**, _indirect_ emissions related to emission generation of purchased energy (for example, electricity)
- **Scope 3**, _other indirect_ emissions from  all the activities the organization is engaged in, including the ones from the organization's supply chain

When it comes to software, knowing the scopes your emissions fall into is challenging because it depends on your specific scenario.\
However, you will find some examples in the course.

#### Software Carbon Intensity (SCI)
The [**Software Carbon Intensity (SCI)**](https://sci.greensoftware.foundation/) was developed by the GSF and aims to give a score to 
a software application in order to understand _how it behaves_ in terms of carbon emissions.\
The SCI specification has recently achieved the **ISO standard status**: you can find more information in [this](https://greensoftware.foundation/articles/sci-specification-achieves-iso-standard-status) article.

It's not a replacement for the GHG protocol, but rather an additional metric to more specifically address the characteristics of our software to make more informed decisions. The main difference between GHG and SCI is that the former categorizes emissions into scopes, while the
latter divides them into **operational emissions** and **embodied emissions** and, as its name suggests, it's an intensity rather than a total.

The SCI is calculated using the following equation:
> **SCI = ((E * I) + M) per R**

- **E** = energy consumed by a software system (in kWh)
- **I** = location-based marginal carbon emissions (carbon emitted per kWh of energy so gCO2/kWh)
- **M** = embodied emissions of a software system
- **R** = functional unit, it is the core characteristic of the SCI and the reason why it "becomes" an intensity and not a total

![Two people trying to calculate the Software Carbon Intensity of a software application.](https://tech.sparkfabrik.com/images/content/sustainability/software_carbon_intensity.webp)

## What about the community?
The final step of this exploration will be about open source and the community aspect that inevitably _contributes_ in some ways to our journey. For me, it has been a pivotal element related to environmental sustainability and tech.

### Environmental Sustainability Technical Advisory Group
The very first community I became part of was the [Environmental Sustainability Technical Advisory Group](https://tag-env-sustainability.cncf.io/) which is part of the CNCF. The TAG Env Sustainability's goal is similar to the GSF's: their mission is to "**advocate for, develop, support and help evaluate environmental sustainability initiatives in cloud native technologies.**"

At the moment, the TAG has two main working groups:
- the **Green Reviews** group (WG Green Reviews), which is more focused on technical issues, metrics and developing tools
- the **Communications** group (WG Comms), which is more focused on spreading awareness and sharing content and the work done by the Green Reviews group

In the TAG, people are involved in different ways depending on their technical skills and/or interests, but the main thing I've had the opportunity to see is that _everyone wants to do something, participate, and lend even a small helping hand to the currently active projects and discussions_.
Having a community of people with different backgrounds and approaches to rely on, ask questions of, share content with, and discuss with is an excellent way to learn and achieve a more complete result.

> This is what open source is all about: sharing, learning, contributing, and growing together.

## Conclusion
In this blog post, I've tried to give you an example of a learning path a _wannabe-greener-dev_ could follow, based on my experience and the tools and resources I've come across. 

Environmental sustainability is a broad topic, and since there isn't a defined clear and linear path, it can be challenging for someone to get started, especially when we're talking about engineering and software development, since it can be challenging to even understand that our work has an impact on the environment.

## Bonus: some other tools and resources
Here's a list of some other open source tools you might find useful in your journey towards a more sustainable web:
- [Developers page of The Green Web Foundation](https://developers.thegreenwebfoundation.org/), in this page you can find some projects and libraries to try out and contribute too, such as C02.js, Grid Intensity CLI, Greencheck API and a lot more
- [Open Sustainable Technology](https://opensustain.tech/), a website that collects a list of open source projects and tools environment related
- [kube-green](https://kube-green.dev/), a tool that helps you reduce the carbon footprint of your Kubernetes clusters
- [Ecograder](https://ecograder.com/), a tool that helps you understand how sustainable your website is and gives you some tips on how to improve it; it's based on various open source libraries. 

Along with the online tools, I would recommend you the following books:
- [Sustainable Web Design](https://abookapart.com/products/sustainable-web-design) by Tom Greenwood
- [World Wide Waste](https://www.worldwidewaste.org/) by Gerry McGovern
- [How bad are bananas?](https://www.goodreads.com/book/show/7646482-how-bad-are-bananas) by Mike Berners-Lee (yes, _Tim Berners-Lee's brother_)
- [Building Green Software - A sustainable approach to software development and operations](https://www.oreilly.com/library/view/building-green-software/9781098150617/) by Anne Currie, Sarah Hsu and Sara Bergman