Good software is green
How environmentally conscious development leads to better software
by Yvonne Marneth, BSc
Sustainability is a value that is becoming increasingly important in all areas of life, including the world of software development. Green” software development shows us strategies and ways of thinking to make our applications not only more environmentally friendly, but also cheaper and more robust at the same time.
Table of contents
- The desire for environmentally compatible software
- The 8 Principles of “Green Coding”
- The cost of green software
The desire for environmentally compatible software
Although energy consumption in the digital sector is mainly caused by the use of hardware, it is to a large extent triggered by software. Software therefore has a decisive influence on its energy efficiency. An environmentally conscious attitude when developing an application makes a significant contribution to protecting our environment. Green software development aims to minimise the environmental impact in terms of energy consumption, greenhouse gas emissions and CO₂ footprint of our software products by incorporating sustainable software development practices, architecture and hardware into the development process.
The willingness to make our work greener is often there, but what concrete steps can developers take to consciously make their applications more sustainable? What criteria make software environmentally friendly? And are these measurable at all?
The 8 Principles of “Green Coding”
Sustainability in software development is actually not a new idea. However, the focus has now expanded from the areas of economic efficiency and ease of change to the area of environmental protection as well. Often, “green software” is first thought of as software whose primary task is to improve processes in terms of environmental protection. That the architecture and development process of any software can also be sustainable is a rather new idea.
Since 2021, the Green Software Foundation, a non-profit organisation, has been working on networks, guides, design patterns and tools to make sustainable software development accessible to developers. One result of these efforts are eight fundamental principles for green software development:
1) Carbon: Build applications that are carbon efficient
Greenhouse gases contribute to a continuous increase in the earth’s temperature. The reduction of greenhouse gases is therefore necessary, even if they are caused by the development and operation of software. Software in itself only indirectly causes the release of greenhouse gases. However, it can also be used to minimise the production of greenhouse gases in other areas, for example by using software to monitor and improve other processes.
2) Electricity: Build applications that are energy efficient
There are already promising mathematical models that computationally approximate the energy efficiency of various functions in an application and already deliver quite good key figures. The use of AI-based systems has also provided good results for evaluating the energy efficiency of software – although it should be noted that neural networks themselves usually cause higher power consumption than classic calculation models. There are already various tools for developers to measure the energy efficiency of their code. However, the results of many methods vary greatly based on how, in which time periods and in which context the energy consumption is considered. This makes it difficult to compare digital products with each other, but they can still provide a good indication of where an application has potential for improvement.
3) Carbon Intensity: Consume electricity with the lowest carbon intensity
Electricity in a local grid is made up of various sources. Large parts are still generated from fossil fuels. The share that is generated by renewable energy sources depends strongly on the geographical location and the prevailing energy policy attitude there. Rarely do institutions have much influence on how the electricity they consume is generated. Most of the time it is not even clearly traceable. However, this problem can already be counteracted by avoiding server locations when operating an application where it is already known that large parts of the local network are fed by non-environmentally friendly sources.
4) Embodied Carbon: Build applications that are hardware efficient
A constant conflict of software development is the urge to stay at the cutting edge of technology. However, the environmental impact of a physical server is not only limited to the power consumption during its lifetime, but already comes into play during the production of a computer, as well as later during its disposal. The environmental impact of its manufacture and disposal can even be higher than that of the energy required during operation. It would therefore make sense to keep servers in operation as long as possible. In principle, computers do not wear out because they have no moving parts. Nevertheless, there is an expiry date: for example, when they can no longer cope with modern workloads, they need to be replaced. Software that is compatible with older equipment helps to extend the life of hardware and thereby reduce its environmental impact.
5) Energy Proportionality: Maximise the energy efficiency of hardware
At the same time, the relationship between utilisation and energy consumption is not proportional, also because a running computer always has a certain basic consumption. The better a computer is utilised, the more energy-efficiently it functions. Servers can only reduce their energy consumption to a certain extent when the load is low, so they can respond immediately to requests when they are made. Ongoing server scaling can save energy during periods of low load by running software on fewer physical machines. Serverless” architecture also helps keep power consumption to a minimum during idle periods.
6) Networking: Reduce the amount of data and distance it must travel across the network
A more invisible environmental impact is the internet itself. The internet consists of a worldwide network of devices that consume additional energy. Every request over the internet causes energy consumption. How large this is depends mainly on the distance between client and server, how many network devices have to forward the request, how they are operated, etc. – but also on the protocol used.
Resource-efficient software should therefore avoid unnecessary data transfer and choose the appropriate protocols to transfer data as efficiently as possible.
7) Demand Shaping: Build carbon-aware applications
Demand shaping deals with the practice of adjusting the service, or the quality of the service, inversely to the demand. Video conferencing software, for example, reduces video quality and prioritises audio transmission during busy periods. This methodology can be used to make applications more environmentally friendly.
For example, the user experience can be adjusted when the cost of operation becomes too high. Since there is sometimes a cost in usability here, an “eco-mode” can also be offered as a conscious decision during use.
8) Measurement & Optimisation: Focus on step-by-step optimisations that increase the overall carbon efficiency
It is not necessary to weigh up all eventualities from the outset. Individual conscious decisions can already make a big difference. Above all, it is important to observe developments and continuously introduce improvements step by step. This approach is not only in the spirit of sustainability, but also ensures adaptable software with proactive maintenance at the same time.
The cost of green software
If you want environmentally friendly software, you have to keep many parameters in mind during its development and think about possibilities and trade-offs. A big factor in these decisions is also the question of the cost of these changes. In fact, however, many of the characteristics of environmentally friendly software coincide with those of high-quality software that is very cheap to run.
By consciously saving resources and using them mindfully, operating costs can be reduced. As potentially fewer physical servers, memory and processing power are needed. The user experience does not usually have to suffer from such savings – on the contrary. Efficient software is usually faster, more reliable and puts less strain on users’ devices. Prioritising resource efficiency puts the focus back on the core functionality of a product, leading to improvements in UX design by identifying and eliminating redundant elements.
The conscious use of resources and their monitoring leads to reliable, secure, durable and adaptable software. The slightly higher costs that may be incurred during the initial development of the application can therefore be seen as an investment in software with a strong future.
RISC Software GmbH is happy to support you in the development of environmentally friendly software and to contribute its expertise.
Yvonne Marneth, BSc