Skip to main content

Digital technologies are playing a growing role in helping to tackle some of our planet’s most urgent environmental challenges. AI, in particular, is providing core solutions – from mapping the impact of dredging sand to charting emissions of greenhouse gases.

At the same time, research shows that the use of AI and its associated infrastructures is causing significant harm to the environment: not only do data centres consume huge amounts of energy and produce electronic waste, they rely on large amounts of water and critical minerals, which are often mined unsustainably.

It is hard to gauge the overall picture of the damage it is doing, given the complexities around measurement, but broad estimates suggest that delivering and using digital technologies accounts for 4% of global greenhouse gases

The chief digital officer of the United Nations Environmental Programme, Golestan (Sally) Radwan, says while there is still much we don’t know about the environmental impact of AI, the data we do have is “concerning” and we need to make sure that the effect of AI on the planet is positive before the technology is deployed at scale.

Green ethernet cables plugged into and coming out of a bank of computer servers.

Photo: Yuriy Vertikov

As part of the overall picture, it is known that developing, testing and running software consumes significant computing power. One study estimates it could account for up to 3.5% of global emissions. Almost all businesses use software and are contributing to those emissions. It is essential that we hold ourselves accountable and find ways to mitigate that – especially if we are to achieve net zero emissions by 2050.

As a B Corp certified software development company and members of the SME Climate Hub, it is something Calvium is increasingly mindful of and continually looking to improve. In this blog, we explore how green coding can support sustainable, environmentally conscious digital innovation and share some tips for best practice.

What is green coding and why is it important?

 

Green coding, also known as sustainable software development, is a computing practice which aims to minimise the energy used in processing lines of code, ultimately reducing the overall carbon footprint of technology.

It involves writing more efficient code, optimising algorithms, automating processes and improving the architecture of software. For instance, optimised code runs more efficiently and tends to use less CPU power and memory, which then reduces energy use in data centres. 

Creating software that can run on older, lower-power devices also helps to extend the life of hardware and reduce electronic waste, delaying the need for replacements.

Computer monitor with lines of green code on right, and multicoloured code on left, all on a black background.

Photo: Joan Gamell

There are business benefits too. While reduced use of cloud services helps to cut operational costs, more efficient code results in quicker load times, thus improving the user experience and overall business performance. All while saving energy.

Many companies now include digital sustainability in their ESG targets and green coding is a great way to support those goals and demonstrate environmental responsibility to stakeholders. Those that adopt green policies and practices are also generally seen as more socially responsible, which can also boost reputation and attract new customers.

What are the challenges and complexities with green coding?

 

Challenges and concerns associated with green coding generally range from upfront costs to awareness to measurement solutions. It is true there can be high initial costs to develop and implement more energy-efficient software – especially when upgrading existing legacy systems – however it is important to remember there will be long-term cost savings due to more efficient energy use.

Organisations and developers may also lack awareness and knowledge of environmentally friendly practices, so further investment may be needed in skills and training. Where budget is a barrier, peer learning can be an effective and efficient way to fill skills gaps.

User experience (UX) can also throw a few difficulties into the ring. For example, optimising code for energy efficiency can reduce performance and impact the user experience. Making the right choices to have a good equilibrium between UX and energy spent is necessary. i.e. a good caching strategy can save computation, lower response times and give a better UX, with the trade off of potentially not completely up to date responses.

Person with a laptop, with a cable connecting it to a server rack, as if monitoring the rack power use.

Photo: Sammy Ayot

Measurement is another key challenge. There is currently no standardised measurement – different hardware, cloud providers and geographic regions can produce different results – which makes it tricky to compare. While small-scale qualitative improvements can be observed, it is incredibly difficult to quantify the end-to-end impact, from supplier to client to planet. For example, we may be able to track how much energy our server is using, but the client’s server, and their other service providers may be using more. There is no way for us to measure the net impact of that.

A final crucial point for consideration here is security. Optimising code for energy efficiency should not be at the expense of the security of your system. For example, it is not good practice to use a system that uses unsecured communications in order to spend less energy, if that then endangers the product, company and users for minimal efficiency gains. Privacy and security are very important and modern technologies allow us to provide them with very little energy consumption. There are also encryption algorithms that are more energy efficient and which should be used when possible. Being ISO 27001, CyberSecurity Plus and B-Corp certified allows Calvium to implement the best security and green practices at all times.

A disk drive, removed from a computer, on a white background. On top are two lego figures dressed as engineers holding tools.

Photo: William Warby

Putting greener solutions into practice

 

The components of green coding are all things that align with good coding practice, some of which you may already be doing without realising. There are some simple ways to make software development more sustainable…

  • Focus on delivering smaller payloads so that the server is processing less and therefore using less energy.
  • Optimise front-end assets, for example using smaller video and image sizes, which can be compressed and transmit less information from the server.
  • Identify bottlenecks – where you may be doing a lot of processing, consider where other techniques could streamline it, such as another algorithm, batching and caching strategies.
  • Use modern frameworks that help to optimise code and serve the app or platform in a less energy-intensive way. NextJS, for example, can help with code splitting, image size optimisation or static site generation.
  • Choose energy-efficient hosting options that allow for the dynamic scaling of resources. Eco Web Hosting, Hyve and Wildhost are some of the providers that use renewable energy and have low carbon emissions.
  • Reduce API calls and unnecessary background refreshes in apps – alongside limiting payloads, caching is one of the most effective ways to improve API performance.
  • Ensure efficient and secure encryption algorithms are in place. It is important to have the right knowledge and practices in place to do green coding in a secure manner.  As an ISO 27001 and CyberSecurity Plus certified company, Calvium has the right knowledge and practices in place to apply green coding practices while delivering secure products and services.

At Calvium, we are currently using AWS Cloud Hosting, which allows us to scale and use resources when needed – rather than having functions running all the time. There is a double advantage to this – reduced environmental impact and lower operational costs – which highlights the overall benefit of sustainable software development.

 

Final thoughts

 

If society is to meet the UN’s Sustainable Development Goals by 2030, it is critical that we continually innovate to find more sustainable technology solutions and minimise any further harm to the planet.

When designed and used responsibly, code has a fundamental role to play in enabling positive change. But there is no silver bullet; it requires a holistic approach that includes a commitment to improving knowledge and awareness, as well as investment in operations, technology and resources.

Company culture has an integral role to play too, as it ensures the whole team is on the same journey and working towards the same goals. As a developer, it is important to be open to learning and adapting, and making the case for solutions that benefit the business and the planet.

 

Planning a new platform or legacy system refresh?  Talk to us about how green coding can cut costs, improve performance and reduce environmental impact.

hello@calvium.com

+44 (0) 117 226 2000

Subscribe to the monthly Calvium newsletter to get more insight and inspiration like this in your inbox.