Rocketmakers Logo
Rocketmakers Logo

Share this blog post

Four ways to reduce your code’s carbon footprint

By Ned Vaught
4th May 2022
4 min read

Public awareness of our carbon footprints is growing, from the flights we take on holidays, to the lightbulbs we use in our homes. Most people have never stopped to consider their digital carbon footprints, however. The truth is that every app use, zoom call, or website visit requires energy, and keeping the environmental impact of that energy consumption to a minimum is important.

At Rocketmakers, we are always looking for opportunities to make the world a better place, and we take the environmental impact of the code we write and run very seriously. 

Here are four factors we consider when we are looking to reduce the digital carbon footprint of our software.

#1 Use a major cloud provider

Running code on a computer requires energy, so the efficiently of that computer makes a big difference to your code’s carbon footprint.  

Running software on the cloud is almost always more energy efficient than maintaining servers yourself. There are lots of other reasons for moving software to the cloud, of course, but knowing that it helps the planet is just one more!

Even among cloud providers, there is a surprising amount of variation in efficiency and energy usage. As a general rule, major providers tend to be the most planet-friendly. They have larger data centres, have more efficient cooling systems, and use fewer computational resources per server. This results in less waste, and a lower carbon footprint per machine.

When possible, always be on the lookout for cloud providers which use green electricity. Not only is that better for the environment, but it is a good sign that this provider working hard to minimise its carbon footprint in other areas. 

#2 Consider your data architecture

One key way we reduce our carbon footprint offline is to make sure we only buy what we need. From the supermarket to the high street, avoiding wasteful purchases is good for the environment, and of course good for keeping costs low.

The exact same principles apply to data architecture. Each time data is retrieved from a database it requires energy, and until recently, it was quite common for data retrievals to be much larger than were actually needed. 

Recent innovations, specifically GraphQL, allow developers to be much more specific about the data that is needed. For example, a user profile could have a hundred data points stored on a database. Instead of retrieving the entire profile every time information is needed, GraphQL allows network calls to specify exactly which data points are needed. 

The energy savings per datacall is very small, but after hundreds of datacalls across thousands of devices, the positive impact of more efficient data architecture can be significant.

#3 Optimisation 

Another way to reduce the energy required to run software is optimisation. 

For example, developers regularly need to isolate applications, and until recently the standard way to do this was through “virtual machines.” This wasn’t that efficient, as often only part of the virtual machine would be used.

Developers are now increasingly running virtual containers, which provide them with only the functions they need. These have lower computational requirements, and need less energy to run.  

At Rocketmakers we regularly use a virtual container technology called Docker, which dynamically allocates memory space as it’s required. We also combine Docker with Kubernetes, which allows us to deploy, scale, and manage Docker containers on cloud servers, reducing the carbon footprint of our software even more.

#4 Write more efficient code

It may sound like a no-brainer, but the more efficient your code, the less energy is required to run it. Efficient code also has other benefits, including faster running times and better security. 

When you’re just creating an application for testing, or trying to launch a product quickly, it’s tempting to take shortcuts. These shortcuts usually create inefficiencies, though, so they’re best avoided if at all possible. Writing efficient code from the start is always best when you are creating something built to last. It’s not only better for the environment - it’s better for your company’s bottom line.

Why choosing the right agency partner is important

It’s completely natural to focus on the up-front cost of a new software development when selecting an agency partner, but it’s important to also consider the long term running costs of the software you end up with  - both in terms of financial costs, and costs to the environment. 

At Rocketmakers, we’re experts at designing, developing, and deploying software which solves the right problems, is efficient to run, and is robust enough to scale from a hundred users to millions.

Interested in learning more about how your next software development can minimise its carbon footprint? Get in touch today!

This blog was co-written by Ned Vaught and Harry Hartley.

Founded in 2007, Rocketmakers designs and develops innovative, well-engineered, and beautifully designed software to help make a positive impact on the world. We love to develop software for clients of all sizes and from a wide range of industries - from some of the biggest names in industry (including O2, the BBC, Nectar, UK Sport) to early stage startup businesses. Get in touch if you’d like to learn more.