Green Software Development

Green Software Development: Technical approaches for sustainable applications

Sustainable software is more than just a trend. Find out how you can use specific technical patterns to make your applications greener and more efficient.

Did you know that software emits more CO₂ worldwide every year than the entire aviation industry?

More and more companies and developers are recognizing how crucial sustainability is in software development. In addition to performance and security, the ecological footprint of applications is also coming into focus. The targeted use of resource-saving technologies not only improves the environmental footprint, but also makes operations more efficient.

The Green Software Foundation provides the framework and best practices for developing software in a more energy-efficient and CO₂-reducing way. In this blog post, I will show you how concrete patterns - such as centralized TLS termination and automatic downscaling of Kubernetes applications - help reduce energy consumption and Software Carbon Intensity (SCI) to optimize.

Why Green Software? The role of the Foundation

The Green Software Foundation has set itself the goal of establishing uniform global standards and metrics for sustainable software development. A central element of this is the SCI, or Software Carbon Intensity - a KPI that measures energy consumption ("E") and CO2-emissions ("M") per work unit.

You can use the Foundation's recommendations:

  • Create transparency: You receive measurable information about the environmental impact of your software.
  • Recognize optimization potential: Best practices and frameworks show you how you can make your technical processes sustainable.
  • enable comparability: Standards make progress and success in the industry visible.

Understanding SCI - How to measure CO2-footprint of your software

SCI measures the ecological impact of your software. Two methods are used for this:

  • Direct measurements: Use of sensors and specialized monitoring tools (such as Prometheus, Grafana or CloudWatch) for real-time analysis of CPU, memory and network traffic.
  • Model-based approaches: System data is used here to estimate the energy consumption of individual components.

With this data, you can find the specific adjustments you need to make to save CO₂ and energy - practically and measurably.

Three levels of sustainable software: principles, patterns and practices

Principles - The guiding principles: These basic principles such as transparency, efficiency and responsibility provide you with strategic orientation. They help you to always consider the sustainability aspect when making technical decisions and to extend the focus beyond pure functionality to environmental compatibility.

Patterns - Technical Best Practices: Patterns are reusable solution approaches that address specific challenges efficiently and in a resource-saving manner. Examples such as TLS termination at the network edge or automated scaling of Kubernetes clusters show how technical processes can be designed sustainably - regardless of the infrastructure used. You can find the patterns here and there you have the opportunity to actively contribute to further development.

Practices - implementation in everyday life: Practices implement the patterns operationally. They include concrete configurations, automations or infrastructure decisions that can be directly integrated into your daily work. This brings sustainable software development from theory into practice.

Together, these three levels form a holistic concept: the Principles provide the philosophical basis that Patterns offer reusable solution approaches, and the Practices ensure concrete implementation. In this way, developers and companies can not only plan the path to sustainable software, but also implement it in practice - and thus actively contribute to reducing their ecological footprint.

Pattern 1: Terminate TLS at Border Gateway

Why is this important?

TLS secures communication, but consumes additional resources in cloud environments. This is precisely where the "Terminate TLS at Border Gateway" pattern comes in.

How does that work?

TLS traffic is centrally at the application load balancer.
Nginx or AWS ALB terminate TLS - communication takes place internally unencryptedwhich saves CPU load.

Your advantage 

Less CPU utilization = less power consumption = better SCI. You save CO₂ - without compromising on security.

Pattern 2: Scale down Kubernetes Applications When Not in Use

Many Kubernetes clusters run around the clock - even if they are hardly used outside of business hours. With Auto Scaling Groups (ASG) the number of EC2 instances on which your cluster is based can be automatically adjusted to actual requirements. This allows you to provide and release resources in a targeted manner - depending on when they are needed.

Possible applications

In Test and development environments you only start up the infrastructure when testing is active - e.g. during integration tests or overnight build processes.
For Temporary load peaksThe system can make additional capacity available at short notice for events such as product launches or campaigns.
In CI/CD pipelines build or deployment processes can be designed in such a way that they automatically start the required nodes - and switch them off again after completion.
Also in Productive environments time-based patterns - at weekends or at night, for example - can minimize resource consumption.

How does it work?

You operate your Kubernetes cluster on EC2 instances within an Auto Scaling Group. About planned actions you control when and how much the ASG scales. This allows you to determine exactly when your cluster should have more or less capacity.

Example

In the morning (6 a.m.) - Scaling to 3 nodes:
aws autoscaling put-scheduled-update-group-action \
  -auto-scaling-group-name MyK8sNodeGroup \
  -scheduled-action-name ScaleUp-BusinessHours \
  -recurrence "0 6 * * 1-5" \
  -desired-capacity 3 \
  -min-size 3 \ \ \r
  -max-size 5

Evening (8 p.m.) - Downscaling to 0: 
aws autoscaling put-scheduled-update-group-action \
  -auto-scaling-group-name MyK8sNodeGroup \
  -scheduled-action-name ScaleDown-OffHours \
  -recurrence "0 20 * * 1-5" \
  -desired-capacity 0 \ \ \r
  -min-size 0 \ \ \r
  -max-size 2

You should adjust the values for min-size and max-size to the requirements of your cluster. This ensures that your system only uses resources when they are really needed - and reduce electricity consumption, costs and CO₂ emissions at the same time.

Conclusion - Green software as a competitive advantage

Sustainability is no longer a "nice-to-have", but an integral part of future-proof IT strategies. With the approaches of the Green Software Foundation, you can not only reduce CO₂ emissions, but also save energy and reduce operating costs - in a very concrete and measurable way.

You help shape it: Every architecture decision, every deployment and every new code snippet offers you the chance to make software a little greener. So: What is your next step in the direction of sustainable IT?

Johannes Mayer

About ME

Johannes Mayer has a Bachelor of Science in Computer Science and was able to gain a great insight into machine learning through his thesis. He has been working at doubleSlash as a software developer in Java Backend and DevOps since 2020.

All contributions from Johannes Mayer

Learn more

Further information on our website and in our newsletter

Arrow up