DEV Community

Cover image for Building a Sustainable Web: a practical exploration of Open Source tools and strategies
Valeria Salis for SparkFabrik

Posted on • Originally published at tech.sparkfabrik.com on

Building a Sustainable Web: a practical exploration of Open Source tools and strategies

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

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.

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.

If you've been following this tech blog for a while, you might have encountered my previous blog post 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.

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).

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.

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 created by the Green Software Foundation (GSF) along with The Linux Foundation.

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) 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) 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 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.

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 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, 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, a website that collects a list of open source projects and tools environment related
  • kube-green, a tool that helps you reduce the carbon footprint of your Kubernetes clusters
  • Ecograder, 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:

Top comments (0)