Ctg sit23 hub banner.jpg

Coding for a sustainable future

Green coding is part of the effort to build more sustainable tech

Image:
Green coding is part of the effort to build more sustainable tech

Dean Clark from GFT discusses the principles and rewards of green coding.

Many organisations have begun 2023 with a renewed focus on the sustainability of their tech infrastructure. Awareness of datacentre impact is growing and some CSPs are making progress in increasing the proportion of renewable energy powering their datacentres, as well as coming up with increasingly innovative cooling systems.

But the problem goes much deeper than the energy mix, and PUE. How efficient is the hardware itself? And what about the applications? Can software be written or rearchitected to requite less compute and less energy? And can it be done within the confines of shortening software cycles and attention spans as well as the expectation that cloud infrastructure can be spun up in a few clicks?

Green coding is relatively young, sustainable computing practice which seeks to minimise the energy required to process lines of code. It is usually employed as part of a wider program to reduce the environmental impact of technology. Green software is software which has been developed according to these principles.

Dean Clark is CTO of digital transformation specialist GFT which works predominantly with financial services businesses. The company has committed to training all of its staff in green coding, and 90% of its UK team are already certified green coders. He explains the first principles of green coding.

"There are three key pillars. It's the logic, the methodology and the platform used to write, develop and run the code. If you look at logic, for example, we need to implement things like zero waste of code, and low footprint resources which would mean choosing simpler file formats, efficient APIs and optimised image packing for instance."

"It also involves frequency of use. Content delivery networks (CDNs) can reduce the physical distance between the server and the user. That's going to use fewer CPU cycles because it won't hit the server, it will hit the CDN. Reducing the amount of CPU cycles reduces the amount of energy used."

Image
Dean Clark
Description
Dean Clark

The second pillar is methodology.

"Adopting Agile or Lean methods can make it easier to adapt software for efficiency. The continuous integration / continuous deployment (CI/CD) approach makes it possible to visualise each development decision's impact at each stage. That can reduce the amount of rollouts, the number of bad releases, the amount of bug fixes, and again, that reduces the amount of CPU cycles and memory utilisation."

"Platform refers to the infrastructure the code runs on, so this is the architecture piece everybody seems to be focusing on at the moment, including the cloud service providers (CSPs). For example, if you're going to spin up a virtual machine, only spin it up for a few seconds, or as long as you need to complete whatever computation you need, and then spin it back down again. If you're configuring a web server, make sure that you've done things like turn on GZIP compression. It's about reducing the amount of data that you process and send over the wire and reducing that footprint further."

These three steps constitute the green coding framework practiced by GFT, and these are embedded into every piece of work that their developers do.

Are the demands of financial regulation & sustainability mutually exclusive?

Finance is one of the most heavily regulated industries in existence. Can the objectives of regulation and greater sustainability sit comfortably alongside one another given the pressure to retain, analyse and monetise ever increasing quantities of data?

"There are regulations that kick in this year around identifying the ESG and sustainability levels against all of your products," [Clark is referring here to EU Benchmark Regulation.]

"What we've done with a large asset manager, is help them to build up an ESG portal where they can identify the different carbon or ESG levels for all of the products that they sell. When they create funds they can put specific badges on it, and report that back to the regulators. In advance of the regulation coming into play they've been able to give the regulator a very good understanding that they are meeting those criteria."

Does the picture look different in retail banking where complying with regulations such as GDPR create additional challenges around data retention?

"This comes back to increasing storage and then the compute needed to then keep that storage running. Green coding principles facilitate the identification of specific archiving routines. We can strip specific data that isn't required to meet specific regulations. We can look at how you move between different tiers of disks and the cloud. Cloud does some of this anyway. In S3 you can tier disks and in Azure you can create lifetime policies against different types of data, so data will get deleted after a defined point."

Appealing to employees & customers

One of the benefits of pursuing a policy of sustainable development is that it appeals to employees who care about the ethics and values of the company they work for. In an era of intense competition for skills, particularly in software engineering, it is likely to help an employer stand out in the arguably overheated marketplace for skills. Clark acknowledges it's had an impact.

"I think it's probably engaged some of the younger developers, because it's something that's a bit different from what a lot of the other organisations are doing. It's something where they can feel like they're having a positive impact on the environment. For the younger generation in particular that seems to resonate a lot. They tend to care a lot more about what they're doing in all walks of life and coding is included in that."

The company made green coding the central part of their theme at AWS Reinvent at the end of last year, and Clark says the reaction was enormously positive.

"We've got a huge number of people coming and talking to us about green coding, what it means, how we applied it, what the framework means, what benefits we see from it for both our own staff and for clients. It seemed to strike a chord with a lot of the techies there."

Clark acknowledges that green coding principles will take time to become integrated into mainstream development. Nonetheless, the direction of travel is clear.

"Is green coding going to be the thing that every investment bank or asset manager is going to jump on right now? No. But as time goes by financial organisations must start taking this more seriously, particularly as the generation with more of a focus on the environment enters the workforce in greater numbers.

"Having said that we are getting some traction with our customers and people are starting to take notice and talk to us about it. I think in a few years' time it will be a lot more current in the market and be a core part of the messaging of financial organisations than it is today."

You may also like

National Grid is turning analogue to digital - Ctrl Alt Lead podcast
/podcasts/4333508/national-grid-analogue-digital-ctrl-alt-lead-podcast

Public Sector

National Grid is turning analogue to digital - Ctrl Alt Lead podcast

'We can't do what we've always done, just more efficiently'

Peter Cochrane: Energy and resources are no longer free
/opinion/4332800/peter-cochrane-energy-resources-free

Green

Peter Cochrane: Energy and resources are no longer free

We need new thinking

AI to blame for Google's rocketing greenhouse gas emissions
/news/4331149/ai-blame-googles-rocketing-greenhouse-gas-emissions

Green

AI to blame for Google's rocketing greenhouse gas emissions

Casts doubt on search giant's 'Net Zero by 2030' goal