Why Green Software Matters
The internet consumes roughly 10% of the world's electricity. As AI models grow exponentially larger, this number is rising. Data centres are competing with cities for water and power.
As engineers, we sit at the control panel of this consumption. We decide whether to store data forever or delete it. We decide whether to run a model in a coal-powered region or a wind-powered one.
Principles of Green Software Engineering
The Green Software Foundation defines three core pillars:
- Energy Efficiency: Consuming fewer kilowatt-hours.
- Hardware Efficiency: Using hardware for longer and utilising it fully (high density).
- Carbon Awareness: Shifting workloads to times/places with low carbon intensity.
Carbon-Aware Computing
The grid isn't always green. At night, solar drops off. On windy days, wind power peaks.
Temporal Shifting
Doing the work when the carbon intensity is low.
Example: Delaying a non-urgent backup job from 6 PM (peak demand) to 2 AM (low demand).
Spatial Shifting
Doing the work where the carbon intensity is low.
Example: Routing user traffic to a data centre in Sweden (Hydro/Nuclear) instead of Virginia (Coal/Gas).
Hardware Efficiency & Embodied Carbon
Manufacturing a server or smartphone releases massive amounts of CO2 (Embodied Carbon). If you replace a device every 2 years instead of 4, you double that impact.
Extend Hardware Lifespan: Write software that runs well on older devices. Don't force users to upgrade just because your app is bloated.
Measuring Impact (SCI)
The Software Carbon Intensity (SCI) score is the standard metric.
SCI = ((E * I) + M) / R
E = Energy consumed by software (kWh)
I = Carbon Intensity of energy (gCO2/kWh)
M = Embodied Carbon of hardware (gCO2)
R = Functional Unit (e.g., per user, per API call)Lower is better. The goal is to reduce the SCI score per user.
Best Practices for Engineers
1. Static Assets
Compress images (WebP/AVIF). Minify JS/CSS. Use CDNs. Every byte transferred requires energy at the server, the network switches, and the user's device.
2. Cloud Resources
Turn it off. Development environments running 24/7 on weekends are pure waste. Use "Scale to Zero" architectures (Serverless).
3. AI Efficiency
Training large models is carbon-intensive. Use pre-trained models. Fine-tune instead of training from scratch. Use efficient inference (quantisation).
Conclusion
Green computing is not a compromise. Efficient code is faster code. Efficient infrastructure is cheaper infrastructure. By adopting sustainable engineering practices, we build better products and contribute to a habitable future.