Sustainable Software Engineering
The choices made throughout the engineering process regarding cloud services, software architecture design and automation can have a big impact on the carbon footprint of a solution. Some choices are always beneficial, like turning off unused resources. Other choices require a more nuanced understanding of the business case at hand and its potential carbon impact.
Goal
One goal of this section is to provide tangible guidance for what sustainable actions you can apply in certain situations and the tools to be able to implement those recommendations. Another goal is to highlight the many resources available to learn about the wider domain of sustainable software.
Sustainable Engineering Checklist
This checklist should be used to quickly identify scenarios for which common sustainable actions exist.
Check the box if the scenario applies to your project, then go through the actions and tools you can use to build more sustainable software for those cases.
If there are important nuances to consider, they will be linked in the Disclaimers
section.
For readability some considerations are blank, indicating that the action applies to the first consideration above it.
✅ | Consideration | Action | Principle | Tools | Disclaimers |
---|---|---|---|---|---|
For any running software/services | Shutdown unused resources. | Electricity Consumption | Identify Unassociated Resources | ||
Resize physical or virtual machines to improve utilization. | Energy Proportionality | Azure Advisor Cost Recommendations | Understanding Advisor Recommendations | ||
For development and testing VMs | Configure VMs to shutdown during off-hours | Electricity Consumption | Start/Stop VMs during off-hours | ||
For VMs with attached volumes | Limit the amount of attached storage capacity to what you expect to use and expand as necessary | Electricity Consumption | Expanding storage of active VMs | Understanding the energy cost of storage | |
For systems using object storage (Azure Blob Storage, AWS S3, GCP Cloud Storage, etc) | Compress infrequently accessed data | Electricity Consumption, Embodied Carbon | Compressing and extracting files in .NET | Understanding the energy cost of storage | |
Delete data when it is no longer needed | Electricity Consumption | Configuring a lifecycle management policy | Understanding the energy cost of storage | ||
For systems running in on-premise data centers | Migrate to hyperscale cloud provider | Embodied Carbon, Electricity Consumption | Cloud Adoption Approaches | Carbon benefits of cloud computing | |
For systems migrating to a hyperscale cloud provider | Consider physically shipping data to the provider | Networking | Azure Data Box | Understanding data shipping tradeoffs | |
For time-flexible workloads | Utilize "Spot VMs" for compute | Demand Shaping | How to use Spot VMs | ||
For services with varied utilization patterns | Configure Autoscaling | Energy Proportionality | Autoscaling Documentation | ||
Use serverless functions | Energy Proportionality | Serverless Architecture Design | |||
For services with geographically co-located users (EG internal employee apps) | Select a data center region that is physically close to them | Networking | Azure products available by region | ||
Consider running edge devices to reduce excessive data transfer | Networking | Azure Stack Edge | Understanding edge tradeoffs | ||
For systems sending data over the network | Use caching policies to keep data on the local machine | Networking | HTTP caching APIs, Cache Management in .NET | Understanding caching tradeoffs | |
Consider caching data close to end users with a CDN | Networking | Benefits of a CDN | Understanding CDN tradeoffs | ||
Send only the data that will be used | Networking | ||||
Compress data to reduce the size | Networking | Compressing and extracting files in .NET | |||
When designing for the end user | Consider giving users visibility and control over their energy usage | Electricity Consumption Demand Shaping | Designing for eco-mode | ||
Design and test your application to be compatible for a wide variety of devices, especially older devices | Embodied Carbon | Extending device lifespan Compatibility Testing | |||
When selecting a programming language | Consider the energy efficiency of languages | Electricity Consumption | Reasoning about the energy consumption of programming languages, Programming Language Energy Efficiency (PDF) | Making informed programming language choices |
Resources
- Principles of Green Software Engineering
- Green Software Foundation
- Microsoft Cloud for Sustainability
- Learning Module: Sustainable Software Engineering
Tools
- Carbon-Aware SDK
- "Awesome List" of Green Software
- Emissions Impact
- Azure GreenAI Carbon-Intensity API