# 5 Things to Consider When Creating Green Software source: https://developer.mastercard.com/blog/creating-green-software/index.md Authors: Tarric Sookdeo. What is Green Software? When developers create software, we may not be thinking about the environmental impact of the code we write. However, a single data center can consume 200 terawatt hours annually. To put this number in perspective, this is enough energy to power 50,000 US homes for a year. These numbers don't even factor in the energy needed to power devices during - local testing and development, or the environmental impact of computer hardware. The Green Software Foundation is building a trusted ecosystem of standards and best practices to create software that is responsible for emitting fewer greenhouse gasses. Green software is focused on the reduction of global carbon emissions through everyday operations, putting sustainability at the forefront of innovation. The software development lifecycle can play a huge role on the environmental impact of developing software. On this International Day of Clean Energy, let's look at 5 factors that you can take into consideration when developing software to reduce carbon emissions. Steps to Reduce Carbon Emissions When Developing Software 1. Code and Algorithm Efficiency When developers create software, it can be under a time crunch where we simply want to get a feature working according to its specifications as quickly as possible. At its most fundamental level, every time code performs a calculation, it will consume energy. When writing green code, you should think about what techniques in software engineering will cause the calculation to consume the least amount of energy. This can be accomplished by ensuring the code is using the most efficient and appropriate algorithm to solve a specific problem. One example would be searching; If the problem your specific code solves involves searching through a large amount of data, are you ensuring to implement the most efficient search algorithm for the problem? Another consideration when creating efficient code is ensuring your code is easy to maintain. The more difficult code is to maintain, the more often the test suite would need to be run when fixing bugs and adding features. Also, the more difficult code is to maintain, the longer it will take to fix or add features. Both factors lead to increased energy consumption. Complexity in code can add up quickly which can increase energy consumption, and maintenance timelines. Always consider creating code that does the least amount of work to solve a problem within the needed specifications. Also, always consider if certain pieces of code are needed. A good rule of thumb to keep in mind for this is "the greenest code is the code that is not written." 2. Time Your Batch Processes A lot of applications have specific intervals, or times in the day when certain background processes are run. For example, a bank might batch process all their ACH transactions together at the end of the day instead of processing them as they come in, others may use batch processes for. report generation, data backup, or automatic emailing. These batch processes often run for a long time and can consume a large amount of energy and computing resources. Because of this, the timing of these processes is important to consider. Green Software Foundation suggests reaching out to your cloud providers to find out the most efficient time of the day to run your process, taking advantage of when energy demand is low. It is best to run computationally expensive, and long running tasks during these low energy demand hours, or at times when renewable energy sources are being used. This will put less strain on energy resources and can even save you money if your cloud compute provider bills based on demand in the moment. 3. Establish Methods to Measure Carbon Output and Energy Usage What gets measured gets improved -- Peter Drucker There is no way around the fact that computing consumes energy. You should establish methods and standards to measure the energy usage, and carbon output of your software production. According to the Green Software Foundation, the Greenhouse Gas Protocol (GHG) is the most widely use and internationally recognized greenhouse gas accounting standard. The GHG protocol divides emissions into three scopes: Scope 1: Direct emissions from operations owned or controlled by the reporting organization, such as on-site fuel combustion or fleet vehicles. Scope 2: Indirect emissions related to emission generation of purchased energy, such as heat and electricity. Scope 3: Other indirect emissions from all the other activities you are engaged in. Including all emissions from an organization's supply chain; business travel for employees, and the electricity customers may consume when using your product. Here's a table demonstrating the above definition: There is also a formula called the Software Carbon Intensity (SCI) equation. The SCI equation is a method for scoring any software applications carbon emissions. For more details on the GHG or the SCI equation, check out the Green Software Foundation page on measurements here. 4. Hardware Efficiency and Environmental Impact The physical hardware that we use daily to develop software has an environmental cost to create. The materials had to be mined, and the manufacturing process consumed energy. Sourcing your hardware responsibly from manufactures can lessen the impact of your development process. One of the best ways to ensure lessen the impact of your hardware is to extend its lifespan. This can be done by repurposing, reselling, or any other means that can prevent the need to acquire a newly manufactured piece of hardware. Furthermore, try to use appropriate hardware for your development like using CPUs to train a machine learning model would not be as effective or efficient as GPUs. Although the concept of the cloud is abstracted away from us, it is technically hardware. When working in the cloud (testing, deploying, monitoring, etc.) you should make sure you are using the most efficient configuration you can for your specifications. This would involve selecting the most appropriate hardware specs for your application, without over-provisioning computing resources. 5. Educating Users Educating your end users of their environmental impact from using your product can be a powerful way to reduce your software energy usage and carbon footprint. Once you have your servers configured correctly and code written in an efficient way, the final piece of the puzzle can be adjusting the way your users use your application. For example, Mastercard has the Carbon Calculator API where users can see the carbon footprint of their spending. This can lead consumers to make more environmentally conscious decisions. This also opens the possibility of gamifying the environmentally responsible way of using your application. For example, a bank can offer better cash back or points to customers who shop in a more environmentally conscious manner. Where To Go From Here? Creating greener software involves a holistic approach that considers various aspects of the SDLC. The environmental impact of software development can be substantial with its great demand on energy, and resources. Mastercard is a member of the Green Software Foundation, and we are aligned with their Software Carbon Intensity metric. Mastercard has also pledged to be Net Zero by 2040. As a result of this pledge, we are focused on educating our developers on the importance of green software, and how we can all have an impact. Mastercard is also working on restoring forests to mitigate climate change through the Priceless Planet Coalition. Mastercard is also nurturing climate-focused fintech innovation through the Climate Fintech Cards \& Payments Challenge and our Start Path startup engagement program. For more information on creating green software, check out the Green Software Foundation. Also, visit Mastercard Developers to explore out suite of APIs, and programs including our Carbon Calculator API.