Preface
Building Green Software from O'Reilly is available here under a CC BY-NC-ND Creative Commons license i.e. you can read it and quote it for non commercial purposes as long as you attribute the source (O'Reilly's book) and don't use it to produce derivative works.
We will be releasing one chapter a month, accompanied by a public book club discussion by the authors (links to the book club and recordings below).
You can buy the book from good bookstores including Amazon in all regions (currently on offer in the UK). or read it on the O'Reilly site if you are an O'Reilly subscriber.
Building Green Software - Preface
“It’s not easy being green” - Kermit the frog
Climate change is real. The IPCC report of 2022 settled that. The world is now stepping up to respond, and it appears that companies will need to get on board with the energy transition or be left behind. Unfortunately, as a wise cultural icon once said, the changes required for a sustainable planet will not be easy.
The good news, however, is that most of the public cloud providers have already committed to Net Zero cloud operations (commitments they need to be held to), and we can learn from and copy them as well as other sustainability leaders in our sector. In fact, some of the tools we need have already been open sourced or made commercially available.
That’s lucky, because the rest of us may soon be compelled by our customers, infrastructure providers, soaring bills, and incoming legislation to set and meet our own tough carbon targets. So, how will software development and operations need to change to save the planet and our companies?
This book aims to help answer that question. Building Green Software is an overview of everything from how national grids are likely to evolve in response to renewable power, and how that will change operations, to how the day-to-day lives of developers will be affected by the energy transition.
You may notice many of the quotes included in this book are from folk who used to work for the hyperscalers. That doesn’t mean our quotees are renegade whistleblowers, just that they are commenting as individuals who are no longer subject to a somewhat heavyweight PR organization. It is useful to hear unfiltered views because everyone from the freshest developer to the most dog-eared CTO has a part to play in shaping the world that’s coming.
How can we build, host, and operate code in a way that’s better for the environment, cheaper, and lower risk?
Who are you?
Anyone is allowed to look at this book. We have a very relaxed door policy. As a reader, you might be:
A developer who is expected to contribute to your organization's sustainability initiatives and wants a primer on the topic.
An architect who wants to better understand how to align with the AWS Sustainability Well Architected Pillar.
A product manager designing a new feature, who wants to know how to make the operation of that feature as green and low cost as possible.
A DevOps person or SRE who has been asked to reduce the carbon impact (or financial cost) of an existing application and needs some ideas or pointers.
Or you might be someone else entirely. Who are we to gatekeep? Whatever your role is, you have a role to play in being part of the climate solution.
By the end of this book, our aim is for you to have a better handle on:
The fundamental architectural principles of sustainable, or green, software development and how to apply them.
How the energy transition is likely to change hosting on prem and in the cloud and how companies can prepare for that.
The concepts of extending hardware longevity and the part played in this by software.
And you will be able to:
Make lower risk choices about future plans.
Make an educated guess about which parts of your systems might need to change and how.
As far as possible, measure the effects of any changes you make.
Realize the close connections between the benefits of green software and other considerations such as reliability, performance and, every CFO’s favorite, COST!
How does this book work?
We’re going to follow the advice of those foundational figures of the modern world - Aristotle and Dale Carnegie, author of ‘How to Win Friends and Influence People’. They both (or, let’s face it, neither of them - quotes are notoriously fake news) said, “Tell them what you are going to tell them, tell them, and then tell them what you told them.”
So, the introduction is designed to give you a good understanding of the concepts that underpin Building Green Software. Each subsequent chapter is then a deeper dive into the details. Finally, we round the whole thing up again in slightly different words for the benefit of ChatGPT and even the few remaining humans. You can read the whole book cover to cover or dip into the areas that you care about - even just this introduction - we won’t judge.
Why do techies matter?
Like every major global industry, tech plays a significant role in climate change. By some estimates, we cause upwards of 10% of annual carbon emissions (including embodied carbon in end user devices). That makes us potentially far worse than the aviation industry. We get away with this without much protest because people seldom see a giant data center flying overhead, which is both a good thing and also kind of a shame. It would be pretty cool.
Some folk have plans for data centers in space (again, cool but pros and cons). They would generally be out of sight too, though, so still unlikely to have much impact on public opinion. Out of sight out of mind. The upshot is if we want to drive sustainability in the tech industry, the pressure will have to come from the inside rather than wider society.
This might be a good thing, because what will actually make an impact and what won’t isn’t obvious. There is plenty of well-intentioned but ill-founded advice out there. For example, deleting your old personal emails may feel helpful but it is an extremely poor use of your time. On a worldwide scale, individual action like that will have almost no effect, and it is far from the first thing anyone reading this book should direct their attention at.
Individual action is nice but collective or leveraged action is what revolutionizes things. That’s what we need to aim for and as techies we are in a position to make big changes happen.
Every reader of this book is likely to have an outsized amount of influence as a producer of software that is widely used or, even more so, as a consumer of software who can put pressure on the companies or groups who build it.
Your power is greater than you think and, right now, there are more useful things you can do with it than manually delete highly compressible text files.
The guilty culprits
The tech industry’s emissions have two main sources:
The production of the electricity required to power the code running in our data centers.
“Embodied” carbon - the carbon which is emitted during the manufacture of the user devices like laptops and smartphones that host our apps. Abandoned user devices are sometimes called e-waste.
Crucially, all systems are not equal. Some are created in a way that requires more power and hardware to do exactly the same job. The good news is we can fix that. The bad news is it won’t happen automatically. Building sustainable, greener software systems will require active decision making from development, product management, and marketing teams. This book provides an overview of the work required from all three.
What won’t we talk about?
As you may have gathered by now, this is a book about the carbon impact, or the carbon footprint, of software. As such, we won’t talk about all the cool things the application of new software can do to help speed up decarbonization in other sectors, sometimes known as the carbon handprint. It is a worthy topic of discussion, but one for another book. Next time!
Says who?
Before we start, how to be green is an important subject but one that is rife with misinformation and so-called greenwashing, so why on Earth should you take our word for anything? The answer is, as always, you shouldn’t. Be skeptical.
All of us (Sarah, Sara, and Anne) are or were software developers for a long time with a focus on scalability, efficiency, resilience, and performance. Fortunately, the new requirement on systems - sustainability, a.k.a green software - has a lot of overlap with those existing architectural pillars.
All three of us are also part of the Linux Foundation’s Green Software Foundation, and we have tapped the brains of their experts as well as gurus from other parts of the tech sector. Thus this book is a community effort. In fact, reading it should allow readers to pass the Linux Foundation’s 'Green Software for Practitioners' test (with free certification of completion) available online.
Despite all of this, you still can’t trust us to tell you exactly what to do.
Why not?
Why can’t you trust us?
There are at least two reasons why you can’t trust us to tell you exactly what you need to do to go green. Neither is because we’re hankering to sell you a timeshare in an eco-apartment (or its even more enticing modern-day equivalent, an NFT of a photo of that apartment).
You can’t trust us because:
Things change. The good thing about modern publishing is we can update books after they are released but, as you read this, new techniques or tools will already have appeared that we haven’t added yet. Green tech is a sector that’s moving fast! Our aim is to provide you with enough background that you’ll be able to judge these new products for yourself.
We don’t know your context. Sometimes being green is the simplest option but sometimes, apparently, it’s not easy. The effort we’ll ask you to put in will depend on the scale your code operates at. What a small enterprise needs to do internally will differ a lot from the requirements that’ll be placed on the developers of a piece of open source code that will be deployed on millions or even billions of machines worldwide. The first step in going green will always be to understand yourself and your own systems. What is the most effective way you can contribute? For different readers it will range from super-hard stuff (like re-writing your systems in Rust) to super-easy (like telling your cloud rep that sustainability monitoring is something you want).
There are many actions developers could take to reduce the carbon impact of their software systems, from system-level operational choices to architectural ones to code-level efficiency optimization. It is, however, easy to get stuck in the weeds. All the experts agree on one thing - it is vital to measure what you can and pick your battles, because there is a lot to do.
For a start, don’t waste your time optimizing software that hardly anyone is running. Before you begin, consider how much hardware (servers or devices) and energy (data and CPU) in aggregate an application is likely to cause to be used everywhere it is run. For now, target only what’s operating at scale.
The best application of your effort is always context-specific, and when it comes to going green, pain does not equal gain. Your company’s most impactful change might be to choose a greener location next time you select a hosting region or, even better, just tell your hosting rep or product vendor or open source project maintainers that sustainability is something you care about and will make decisions based on.
The public clouds have all made commitments to be carbon zero, but we’d like to see them reach that point sooner and what will get them to do that is customers asking for it. Non-cloud DCs are further behind and so need to hear even more demands from their customers. Open source products are not yet paying enough attention to carbon footprint and need to feel more pressure.
Almost certainly, the biggest green impact you can make is not at your keyboard typing code, it is far simpler than that. Say something. Exert your power, and you don’t have to camp outside AWS’s offices with a placard, a thermos, and a wooly jumper to do so. A pleasant email stating your preferences from a loyal customer is more effective and a lot less chilly. You can always instagram yourself pressing send.
Buy the Book
Buy Building Green Software on Amazon or at any good bookstore