Towards greener coding at Lloyds Banking Group
Every component of an app can be optimised for energy efficiency
Software leads at Lloyds tell the audience at the Women and Diversity in Tech and Channel Festival how they are making sustainability a key factor in the bank’s software design.
With the environmental impact of ICT close to that of aviation and rising fast, the carbon emissions associated with software are coming under increasing scrutiny.
"Every single component emits carbon," said Vinutha Kabburahalli (pictured right), solutions architect lead at Lloyds Banking Group, during a presentation on sustainable software at Computing and CRN's Women and Diversity in Tech and Channel Festival on Tuesday.
Take a banking app. Even the simplest web application has a front end, a back-end web server and a database, and each of these uses energy.
"The mobile app will need to go through internet. It needs to make number of calls to the back-end server. Every call has a carbon emission figure associated, and the more calls we make the more emissions we generate,” said Kabburahalli.
Similarly, the more data stored in the database, the higher the environmental impact. As a solution architect, it's important to have an overall picture of where energy is being used, so that it can be minimised while still retaining the functionality, she said.
The first thing to do is to work out where the demand is. In the case of a banking app, the most common customer journey by far is logging in to check the account balance and logging off again. Less frequently customers will login, check the balance and arrange a payment. Obviously, there are many other journeys too from the more common the very unusual.
This is where microservices can help to make sure the app is optimised.
"Not every part of the application is being consumed at the same capacity, or the same bandwidth. The microservice architecture enables us to break the monolith into smaller chunks," Kabburahalli explained.
"I will make the balance check microservice more available compared to a payments microservice. I don't have to make that one as available, because not so many customers use it."
The choice of programming languages can also make a big difference. Higher level languages like Python certainly have their place, but for some use cases a simpler more performance-optimised languages like Go may perform the same function in a more energy efficient way, particularly in the back end.
And when it comes to data, the architect should ensure that only the necessary data is stored in the database, and that it is deleted when no longer needed.
That's fine for a single application, but to generalise sustainability as an approach requires leadership and cooperation. And that starts with measurement said Thenmozhi Paramasivam, quality engineering chapter lead at Lloyds (pictured left), who recommended setting up objectives and key results (OKRs) to track interventions and metrics.
"We would recommend setting up a carbon footprint a measuring table, which helps in identifying your carbon emissions which is the first step,” she said. “Then find a champion to create a community to work closely on this."
This community can then organise hackathons to develop new practices and draw up new OKRs around sustainable coding which can be shared more widely.
"Make sure there are some metrics developed for them, because when we make these global we can start to gain control of our carbon emissions."