At INNOQ, our goal is to create a more sustainable world, recognizing that technology plays a crucial role in achieving this. We have already taken steps to reduce our environmental impact, such as sourcing green energy for all our German offices and implementing intelligent heating control in some of them. Additionally, a lot of us have shifted to train travel and we have increased remote work among our colleagues. However, we recognize that there is an additional lever — the products we develop for our customers. This is why the concept of Green IT, or developing environmentally sustainable software products, is something more and more colleagues at INNOQ set great value on. In this article, we will explore why we believe this is important, what steps can be taken to achieve it, and provide an overview of the topic of Green software development.

Why is ecologically sustainable software development important?

In order to develop those types of software products, we need first to understand what ecological sustainability is and how it applies to IT in general and to software development in particular. The basic principle is that people should live in such a way that the available resources are not consumed at a higher rate than they are able to regenerate. It touches on all the biogeochemical systems such as water, ecosystem services, and more. However, when it comes to the impact of Information and Communication Technology (ICT) as an industry, the greatest one is on the amount of greenhouse gas emissions.

The rapid expansion of the industry in recent decades has led to a significant increase in power consumption. It is projected to grow from 2000 TWh in 2010 to 8000 TWh by 2030. Additionally, the percentage of electricity consumed by ICT is expected to rise from around 5% in 2012 to an estimated 21% in 2030. All the software products that we are creating at INNOQ or that are created worldwide have an impact on energy consumption. Knowing the three-tier energy impact that they make can help us design them in such a way that we are able to reduce their negative impact.

The consumption patterns that led to this increase are usually categorized into three different buckets or orders of effect.

  1. first-order effects: the energy used to produce and use ICT, for example, operation of servers, network infrastructure, the energy consumption of end devices used to access the application (laptops, smartphones, etc.), but also energy consumption during application development
  2. second-order effects: the direct consequences of using ICT — for example, an application that helps to avoid car trips is better than one that helps to develop new oil deposits
  3. third order effects: the long-term adjustments and innovations caused by ICT — for example, the development of new hardware may lead to certain ML algorithms becoming feasible to use in practice, which can eventually lead to the design of more efficient wind turbines.

In this article, I will focus on the first-order effects, as it is unlikely that we will be able to significantly impact customers' product ideas and subsequently the secondary or tertiary effects.

It is informative to examine the breakdown of electricity consumption by location before discussing how to address it. Networks, including mobile, broadband, and telephone, account for approximately 1.7% of global electricity consumption. Data centers consume about 1.4% and computers consume 1.6%. Notably, networks and data centers make up the majority of energy consumption throughout the lifetime of tablets and smartphones, accounting for at least 90% of total energy use, including manufacturing and charging.

Principles of environmentally sustainable software development

The topic has started gaining momentum lately in the software industry, and there are actually some guiding principles that one can use to understand what it involves. They have been developed by Asim Hussain, Green Cloud Advocacy Lead at Microsoft. The principles of Green Software Engineering are essential skills needed to create, develop, and operate sustainable software applications that are environmentally friendly. It is crucial to note that these principles can be implemented regardless of industry, programming language, hosting strategy (cloud or self-hosted), and expertise.

The principles aim to empower readers to significantly reduce the carbon emissions produced by their software by emphasizing efficiency, intensity, demand, and awareness. They are organized into eight categories.

Maximize CO₂ Efficiency

1. Carbon Efficiency

Carbon serves as a placeholder for all greenhouse gases that trap heat in Earth’s atmosphere, leading to an increase in temperature. To measure carbon efficiency, the metric used is not just the amount of CO₂, but CO₂-equivalent (CO₂e), which takes into account the relative warming potential of different greenhouse gases. The goal is not to eliminate carbon emissions completely, but rather to minimize waste and design applications with efficiency in mind from the start.

2. Energy efficiency

Carbon efficiency and energy efficiency are closely linked, and energy efficiency can be used as an indicator of carbon efficiency. As a significant portion (over 49%) of carbon emissions come from producing energy from fossil fuels, it is crucial to building software that consumes as little energy as possible. However, energy efficiency is also important if your software runs completely on renewable energy because building renewable energy power plants cannot be done without emissions either.

Use electricity with the lowest possible CO₂ intensity.

3. Carbon intensity

Nevertheless, renewable energy power plants enable us to decrease our carbon intensity. Carbon intensity is a measure of the grams of carbon emitted per kilowatt-hour or gCO₂eq/kWh. If we are using 100% renewable energy, the carbon intensity is close to zero, while in other cases it will vary according to the energy mix. If we achieve an over-supply of energy through renewable sources, it will increase the chances of carbon-emitting power plants being shut down temporarily. If this happens, the carbon intensity of the local grid will decrease.

If you want full control over your carbon intensity, you need to be independent of the local grid. There are a couple of real-world examples where servers are operated in a self-sufficient way with 100% green energy. An example at scale is a data center in Nevada that is powered by solar panels with a capacity of 555 MW and Tesla Megapacks providing 800 MWh of battery storage. This is necessary to ensure that the data center provides high availability even when the sun doesn’t shine. In general, if you want to use 100% green energy, you need to dramatically oversize both your power sources and your battery storage. However, this is hardly sustainable and can sometimes even cause more emissions than you are trying to avoid, depending on the carbon intensity of your local grid. In stark contrast to this, the low-impact version of the Low Tech Magazine is hosted on a server in the owner’s apartment in Barcelona, and the server is powered by a single solar panel and a small battery. While this setup is not as efficient as a big data center because it cannot benefit from scaling effects, Low Tech Magazine recognizes that the high availability we have come to expect from almost all server applications these days cannot align with the goal of ecological sustainability. This is why the website goes offline if there is no solar power and the battery is empty. Nevertheless, the website has an average availability of more than 95 percent, which is probably more than you may have expected from such a radical approach.

4. Demand Shifting

Currently, there is not enough green energy in all places and at all times to run your servers completely on green energy in a sustainable way with the availability demands we have grown used to. One way to minimize the carbon intensity of your software is to run energy-intensive tasks during times of high green energy availability. This technique is called demand shifting. This can decrease carbon emissions by 45–99%, as per a study.

One example where this really pays off is training a deep-learning model for natural language processing, which can emit the equivalent of 284 tons of CO₂, according to a MIT study. Since this is not a time-sensitive task, it can be done when there is enough green energy on the local grid or in a location where green energy is more readily available.

Companies like Google are using tools like Electricity Map or other carbon intensity APIs to align compute tasks with times of high low-carbon energy availability. Typically, these APIs can provide you with data on current carbon intensity, historical data, and forecasted carbon intensity in multiple regions.

Maximize hardware efficiency

5. Hardware efficiency

The carbon emissions associated with the production and disposal of a product, known as embodied carbon, can also be significant. In some cases, this is measured in terms of carbon emissions per year, based on the lifetime of the device. For example, a 2019 Dell R640 server has an embodied carbon cost of 320 kg CO₂eq per year, which is equivalent to 40% of the device’s yearly emissions based on the average carbon intensity in the EU in 2019. In some cases, such as smartphones, the embodied carbon cost can be even higher than the device’s lifetime emissions created from using it, e.g. from charging it (not taking into account emissions from servers and network infrastructure that are utilized while using the device).

One strategy for increasing hardware efficiency is to extend the lifespan of hardware, which reduces the yearly embodied carbon cost. As software engineers, we can design software that is resource-efficient and can run smoothly on older devices. Also, by designing software that is energy efficient, we can do our part in reducing the number of charge cycles required in a given time span for laptops, tablets, and smartphones. That way, we contribute to a longer lifetime and hence a smaller embodied carbon cost for these devices.

Additionally, hardware manufacturers and software developers can make decisions on whether to continue supporting older devices, such as Apple deciding not to support certain older Macbooks with its latest operating system version. Often, developers decide to rely on the latest APIs provided by new operating system versions, as it is convenient for them. By doing so, they can force people to buy new hardware in order to use the applications they need, even though their old devices would be perfectly capable of running these applications. The same principle applies to the use of the latest web features. If you rely on the latest CSS features and JavaScript browser APIs, you exclude people who are forced to use older browser versions because later ones are not supported on their devices. Here, the principle of progressive enhancement should be used for features that are not widely supported yet. The website Can I use helps to gauge whether a web feature is so widely supported that you can forego progressive enhancement.

Minimize data transfers

6. Network efficiency

Data transfers are a major contributor to energy consumption in the industry, and their associated carbon emissions are influenced by factors such as the size of the data, the distance it needs to travel, the number of network devices it passes through, the energy efficiency of those devices, and the carbon intensity of the local grids that power them. Based on current research, it can be assumed that transmitting 1 GB of data requires 0.81 kWh. With a global carbon intensity of 442 gCO₂eq/kWh, this means that transmitting 1 GB of data leads to emissions of 358 gCO₂eq (see Calculating Digital Emissions).

Network infrastructure is getting more and more energy efficient. Nevertheless, the amount of data transferred continues to increase so rapidly that emissions rise as well. Currently, videos account for a large portion of internet traffic (80–90%), and this trend is expected to continue. Web applications have also become more data-intensive in recent years, further contributing to the carbon emissions from data transfers. According to the HTTP Archive, the transfer size of a single web page has more than doubled on desktop browsers from 2013 to 2023. On mobile phones, it’s even worse. Here, the transfer size is almost four times the size it was ten years ago. If you look at this per content type, you will see similar increases for almost all content types, from images to CSS, fonts, and JavaScript.

There is significant potential to improve the network efficiency and reduce associated carbon emissions, through the use of established techniques such as HTTP caching, Content Delivery Networks (CDNs), reducing the use of JavaScript (JS), minimizing and compressing JS and CSS, optimizing and compressing images and videos, using SVG and WebP instead of other image formats, and only using images and videos that bring added value. For example, using grayscale or monochrome images instead of color images can significantly reduce image size. Additionally, focusing on the main subject with a shallow depth of field in photos can reduce image size by almost 50%. While some of the techniques are about avoiding data transfers or reducing the distance of the transfers, others are about reducing the size of the data transferred. Some of the techniques, like minimizing the use of JavaScript, can have the additional benefit of reducing energy consumption on the end user device, potentially contributing to the reduction of the yearly embodied carbon cost of those devices.

Sometimes, avoiding just a small amount of data to be transferred can have a huge impact. One example of this is a WordPress plugin created by Danny van Kooten. He removed a 20KB JS dependency. Since the plugin was used on 2 million websites, this resulted in an estimated saving of almost 3 tons of CO₂eq per month. According to van Kooten, those three tons of CO₂eq are what you would emit by driving more than 18,000 km with his Toyota Yaris.

Build CO₂-adaptive applications

7. Carbon-awareness

Demand shaping is a technique that adapts the energy demand of an application to the current supply of green energy. To do demand shaping, the application needs to be carbon-aware, for example by using one of the available carbon intensity APIs mentioned above. Demand shaping can happen automatically or by giving the users a choice, such as an “eco-mode” option. This is similar to a form of progressive enhancement where the system adjusts its energy consumption based on the current energy supply.

If the carbon intensity is too high, or the user activates an eco-mode, you can choose to deliver images in lower resolution or quality or omit certain images or video content altogether. Some websites like Organic Basics or Branch Magazine have implemented this feature. In the former, there is an explicit eco or low-impact version that you can choose to use instead of the regular storefront. The low-impact version automatically adapts to the current carbon intensity by using vector graphics instead of high-resolution product photos, for example. The latter adapts to the current carbon intensity automatically, for example by reducing the image quality or even omitting images completely until they are explicitly requested by the user. In addition, visitors can choose to browse the website in low, medium, and high grid intensity mode, effectively overriding the automatic adaptation.

The Branch Magazine adjusts its design based on fossil fuel levels to maintain a carbon budget. There are four browsing options available from “Low” to “High” plus the “Live” mode that resolves to one of the other three automatically.

Examples when Intensity of Grid usage is:

High

Example with setting Low

Moderate

Example with setting Moderate

Low

Example with setting High

Source: https://branch.climateaction.tech/issues/issue-4/open-climate-then-and-now/

Measurement & Optimization

You can’t improve what you can’t measure. To make software more sustainable, a metric-driven approach is recommended. Operating costs can be a starting point, as a very rough indicator for carbon emissions. Performance budgets or page weight can also serve as carbon budgets. The smaller the amount of data that needs to be transferred, the smaller the carbon emissions. Tools like Google Cloud Carbon Footprint and AWS Customer Carbon Footprint Tool can be used to measure and track emissions. Additionally, websites like Website Carbon Calculator or JavaScript libraries like CO₂.js can be used to get an estimate of the carbon footprint of a website based on its transfer size and the data center. We have used the Website Carbon Calculator to test some of our pages and were happy to see that they are cleaner than many other pages.

Example calculation for a blog post
Example calculation for a blog post

Source: https://www.websitecarbon.com/website/tilkov-com-post-2021–03–01-ddd-is-overrated/

It’s important to understand, though, that all these metrics never tell you the whole story. Getting a precise measurement of all the carbon emissions caused by your software is almost impossible, since a lot of components, like the network infrastructure and the end-user devices, are usually a black boxes. Some measures you take in order to reduce emissions in one part of the system can actually increase emissions elsewhere. For example, moving computations from your server to the end user devices could reduce the emissions on the server side, while increasing them on the end user devices, possibly leading to an overall increase in the emissions caused by your application.

Ecological sustainability in practice — a pipe dream?

Considering all the metrics, principles, and examples reviewed until now, the normal question that arises is if this is actually possible to integrate in everyday work. The starting point to reflect on it would be the fact that there are very few stakeholders in the business space that do have environmental sustainability as their main or primary goal. It might be the case that they are not even aware of how much of an impact IT in general and website and software products have on greenhouse gas emissions. This is one of the main reasons why carbon efficiency as a quality goal of software architecture will probably remain an exception for the moment. One of the exceptions we assume will adopt carbon efficiency soon is when software is developed for the public sector. Here, we already have much stronger requirements regarding accessibility than in the private sector. It’s not far-fetched to expect them to act as trailblazers when it comes to adding carbon efficiency as a strict requirement as well.

For now, though, it is recommended to start by aiming for carbon emissions reduction through secondary goals that align with business objectives. These goals could include cost efficiency by reducing servers and traffic, accessibility by designing web applications to be less data-intensive, and performance by minimizing data transfer. However, it’s important to note that carbon efficiency does not always align 100% with these other quality goals. For instance, while many performance measures also improve carbon efficiency, some definitely don’t, and may even increase emissions. For example, querying a document from multiple nodes in a distributed database in parallel and using the fastest response may improve performance, but is not CO₂-efficient at all. It is essential to introduce stakeholders to environmental sustainability through other goals, and sensibly focus on carbon efficiency as a desirable goal. Once carbon efficiency is established as an explicit goal of its own, such trade-offs between other quality goals and carbon efficiency can and need to be made explicit.

Getting started with reducing the environmental impact of software can be challenging, but it is important to view all work through a sustainability lens. Utilizing tools and principles to assess, measure, and minimize the impact of software is crucial. Raising awareness about the impact of software on the environment and making it a priority among stakeholders is essential for success.

Bibliography

  1. C.Kelly; E. Mangina; A. Ruzelli Putting a CO₂ figure on a piece of computation, IEEE 2011
  2. R. Hischier, V.C. Coroama, D. Schien, et al., Grey energy and environmental impacts of ICT hardware, ICT Innovations for Sustainability, Springer, 2015, pp. 171–189
Group of people in the background. Text: Web Sustainability Assessment - Reduce the CO2 footprint of your corporate website.

We support you and your team