Towards Greener Digital Experiences

Dipro Chakraborty
Kingfisher-Technology
8 min readJan 5, 2023
Photo by BrianAJackson on iStock

For those that are aware of climate change and its consequences, it hopefully resonates that we are in dire straits. It needs action and it needs action now. It is imperative that we do everything that we can to minimise our effects on climate change and make a real and impactful difference.

Sustainability as a goal should apply to all facets of our lives and very much applies in the field of software engineering.

While the subject itself is quite broad, our ever-growing reliance on software and the web, coupled with the acceleration of digital transformation projects relying on power-intensive data centres means that the need to manage our carbon footprint effectively takes precedence above all else.

In the digital world, architects and engineers have a massive part to play, and there are things to be done from choosing the right cloud provider to the code that we ship and how we ship it.

Go cloud native

Moving to cloud-native solutions is a great first step. Most cloud providers have expressed their commitment to move to renewable energy sources to power their data centres and operations and have begun to take action, albeit with varying degrees of progress.

Google Cloud for example, claims to be on 100% renewable energy for all of its regions, and provides a set of tools to track carbon footprint.

That being said, there is only so much green energy to go around; Moving workloads in the cloud to use more renewables just means that someone else isn’t getting a piece of the green energy pie. Our focus should still be on minimising the carbon footprint of the apps and services that we build and deploy to the cloud.

Design & build for efficiency

When architecting solutions, there are numerous patterns and principles that can be adopted to boost carbon efficiency from the get-go. Assessments need to be conducted to find an optimal balance between propositional trade-offs and the effects on the environment.

Utilising Serverless offerings and managed services, minimising network hops, demand shifting and demand shaping where the use cases fit are examples of this.

Slightly closer to the ground, the choices we make from an engineering standpoint, however, are a tad more complicated; Engineers need to learn largely through experimentation and require enough headroom to run tests to see if changes have helped their energy efficiency. Performance engineering needs to be applied through a slightly different lens, to pinpoint areas of their applications that perhaps suffer from suboptimal performance and resource efficiency.

Measure your carbon footprint

To improve on carbon footprint, engineers must first have the right set of indicators, metrics, tools and techniques to measure the carbon footprint of the apps and services that they build and operate.

It largely falls to them to trial, assess, and adopt new tools, techniques, libraries, etc that effectively serve in measuring carbon emissions. Baking in observability and reporting around those metrics is key.

Measurements might need to be relational rather than absolute in practice for certain metrics. Many factors contribute to the carbon footprint of software and hardware, and sometimes they can be hard to measure or even identify accurately. In these cases, indirect correlations or proxy metrics such as vCPU minutes for a workload to run, GB provisioned for storage and size of packets transferred over a network can be good starting points.

The go-to metric especially for cloud services tends to be cost. Cost, however, is not a reliable indirect correlation for energy as cloud companies charge on a variety of factors such as storage, compute resources, etc.

Bake in optimisations

With standardised approaches established for measuring carbon footprint across the digital estate, engineers then have a good foundation to work on carbon efficiency and energy proportionality improvements. As there’s no one size fits all solution, engineers will need to run through a constant and meticulous iterative process of measuring metrics for carbon efficiency and emissions overall, comparative analysis against previously captured metrics and finally, implementation and deployment of optimisations.

Make DevOps work for sustainability

Illustrative Model — DevOps for Sustainable Software Engineering

Our steps to becoming greener fit quite nicely into standard DevOps practices. Adopting DevOps into an organisation is in itself a step towards sustainability, as many aspects of the DevOps model lend themselves to better energy efficiency, with some of the key tenets focusing on minimising waste of resources, automation, “failing fast” and optimising for speed. Incorporating the steps discussed above for improved energy efficiency is a great way to deliver change that matters at a steady pace.

Our Sustainable Engineering Guidance Framework

Photo by Sakorn Sukkasemsakorn on iStock

Here at Kingfisher, we’ve established a checklist to guide our architects and engineers towards building more sustainable tech.

While it is widely understood that the most impactful changes in the technology space come from an overall reduction in carbon emissions from our digital estates, we have nevertheless incorporated some elements that address the social and economic pillars of sustainability as well in the form of accessible design, reduced TCO, and potential contributions to the open source community, among others.

The list isn’t really groundbreaking and shouldn’t be news to a lot of people; We have indeed borrowed from well-known pioneers in the space such as AWS and the Green Software Foundation. Others have been borne out of conversations and knowledge sharing sessions with partners and other businesses passionate about bringing convergence between sustainability and technology but mostly, a lot of what follows just made sense to us logically.

So without further ado, here’s some of the guiding principles and practices that we encourage and indeed, in some cases mandate within our engineering community. Bear in mind that being a retail business, some of these apply to digital commerce architectures only.

Web & UX Design

It is expected that engineering and design work closely together and collaborate on sustainability strategies.

  • Design for accessibility first — Simpler and easily navigable websites are faster to view and often translate to a better end-user experience with maximised energy efficiency across a wide array of devices. They are also inclusive by design to allow access to everyone regardless of socio-economic background.
  • Build “Dark mode” capability on websites — this allows for the end user’s device to utilise less energy whilst accessing the same content. For OLED screens. black pixels are not activated, leading to energy savings.
  • Build a strategy around image optimisation — it might be that pre-optimisation is only needed for frequently accessed images.
  • Use a Content Delivery Network such as Amazon’s CloudFront
  • Build for mobile first — Progressively enhance for larger devices with larger screens.
  • Consider appropriate use of BFFs (Back End for Front Ends) to minimise latency and prevent over-fetching.
  • Leverage edge-caching.
  • Consider a “shortest journey to get to where the customer needs to go” approach.

Findability & Content

  • Strive to make content findable easily. The quicker users find what they are looking for, the less likely they are to run expensive sort and filter algorithms on search listing pages.
  • SEO optimisation is key. A direct product page link from a search engine saves compute resources and network traffic.
  • Ensure that all content that a user might need is readily available without too many barriers or page jumps.
  • Segment and paginate search results and lister pages.

Storage

  • Avoid duplicating data. Where required for ephemeral workloads, clean up duplicates promptly.
  • Transfer only what is needed.
  • Prefer columnar data formats such as Parquet over CSV.
  • Create retention policies around all your data. If you won’t need it, don’t keep it.
  • Prefer Serverless data storage options such as AWS Aurora and AWS DynamoDB. Choose retention and backup policies appropriately.
  • Optimise database queries, indexes and partitioning strategies for efficient data operations.
  • Store region-specific data in regions where it is consumed.

Network

  • Set time-to-first-byte goals on frontends.
  • Reduce the size of data packets being sent over the network.
  • Minimise network hops.
  • Prefer async events over synchronous API calls.
  • Consider file compression before transferring over a network.

Compute

  • Prefer serverless options where appropriate. Don’t forget to adjust cloud functions for memory. eg. see AWS Compute Optimizer.
  • Build for scalability. Not just for higher scale, but also scale-down-to-zero.
  • Where possible, schedule jobs at times of the day when carbon intensity on the grid is at its lowest.
  • Optimise areas of code that are the least energy efficient or least performant. Deal with the quick wins first.
  • Encourage transparency with your cloud providers on data centre location, energy usage etc.
  • Utilise shared instances where appropriate. This allows for under-utilised cloud capacity to be shared and is particularly useful for intensive, yet non-time-critical operations. eg. See Amazon EC2 Spot Instances.
  • Consider demand-shifting or demand-shaping strategies for workloads on Kubernetes or EKS. See A Low Carbon Kubernetes Scheduler.

Choice of programming languages

  • Choose a language that along with the usual qualifiers of readability, ease of adoption, community support etc, is energy efficient.

Performance

It can be easy to justify in our minds that if we build low-latency apps and services that are “quick” to respond, the app or service in question is optimised for carbon efficiency as well.

This is a fallacy that engineers needs to be aware of. Oftentimes, being quicker translates to higher CPU utilisation, and that implies higher carbon intensity. A different lens needs to be applied at every run of the performance optimisation loop to identify energy-utilisation inefficiencies and then address them.

  • Left-shift performance testing, so that any issues can be caught and handled early on.
  • Create performance loops to continually monitor, measure, and optimise code and hardware utilisation for energy proportionality, energy utilisation etc.

Where do we go from here?

Photo by NicoElNino on iStock

We are currently refining a list of “Yes checks” at various stages to ensure that these principles are being appropriately employed. More on this soon.

Kingfisher’s architects and engineers are embarking upon a journey of awareness-building and appreciation for the need to be more sustainable and how to get there. As with all things, it will take time, but we are on our way.

In closing

When it comes to digital engineering, more often than not it’s all about performance along with resource and operational efficiency and a minimalist approach to technology. We all want to be 100% carbon-free, but it just isn’t practical; Unless we shut down our websites and data centres completely.

The goal is always to find the right balance between business needs and our impact on the environment whilst being fully cognizant of the fact that ultimately, the sense of urgency around the impacts of climate change leaves no room for indifference or complacency. This in turn, may very well mean that organisations’ business processes themselves and not just the underlying tech will need to change as they move towards net-zero carbon emissions.

The race is on.

If you are interested in joining us on our journey, please do check out our careers page.

Thanks for reading!

--

--