Building Green Software by Anne Currie, Sarah Hsu and Sara Bergman, published by 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.
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.
“For never was a story of more woe than this of Juliet and her Romeo” - Shakespeare
How many deaths have been averted by the invention of TCP/IP?
<Sidebar>TCP/IP, or Transmission Control Protocol over Internet Protocol (in the world’s most unhelpful spelling out of an acronym) is the set of simple networking rules, or protocol, that underpins much of modern communications. One of TCP/IP’s fundamental assumptions is that it’s not a great idea to assume your intended recipient has always received your message. If Juliet had only applied the principles of reliable communication then her story would have had a very different ending. In her defense, comms using these rules is slow and often impractical if you aren’t passing your messages over wires. </Sidebar>
In the developed world, reliable communications underpin our lives. Perhaps it doesn’t matter whether they are green or not? Some might argue telecoms is humanity’s most important use of energy and must be maintained and extended at any cost.
Are they right?
As one of the first books on the subject of building green technology, we ask as many questions as we answer and that’s fine. We’re still at the stage of working out how the tech industry needs to respond to the energy transition and there are few no-brainer moves. Usually, we have to suck our teeth and say, “it depends.” Unfortunately, this chapter is yet another example of that kind of mealy-mouthed equivocation.
Nonetheless, even if we can’t easily answer the question, “Are networks green enough?” there is still a great deal we can learn about being green from networking because it is ahead of the rest of the tech sector when it comes to two techniques that are vital to the energy transition: demand shifting and demand shaping. That is because the developers of the internet have always had to handle the problem of being dependent upon a variably available resource. In their case, bandwidth.
In this chapter, we’re going to take a broad view of networks and the internet and talk about everything that plays a part in connecting one device with another, whether that device is a phone, a laptop, a VM in a Data Center or one DC to another. That means as well as fiber optic cables and other forms of ‘wire’ we will talk about services like Content Delivery Networks (CDNs), which cache internet content so it’s faster for end users to access.
There is a good reason for us to go wide in our definition. For most enterprises, there isn’t much you can do about the wires and protocols underpinning your communications because the way the internet functions is a black box to its users, particularly when it comes to routing. That’s good. It works. But it means it’s not a good plan to start messing around under the hood. However, there are still plenty of choices you can make about how, where, and when you connect to the internet. Some of those are green and some are definitely not.
<Sidebar>In chapter 3 we said not to second guess your compiler. Generally speaking, it’s not a great idea to second guess your routing either: there are risks even if you are an expert.</Sidebar>
One thing we can say for sure is that green 6G isn’t going to save us. Even if it turns out to be miraculous, we can’t wait that long. 5G isn’t well deployed yet, so 6G might still be a decade or more from mass use. We have to act today to be both greener and more resilient to climate-related infrastructure outages. The good news is we can.
When we need to, the global community of internet consumers and suppliers can respond fast to manage our resource use. The proof of that is the way the internet withstood the sudden and unprecedented increase in demand caused by the pandemic lockdowns of 2020. Then, the internet’s survival wasn’t achieved by laying new cables. There wasn’t enough time for that. Instead, it was kept alive using the same demand shifting and shaping techniques we described in chapter 5.
Before we discuss any of that we need to define what we mean by the internet and which parts are green and which not.
The standard answer to the question, “What is the internet?” is wires, compute, and storage, and the good news is that being energy efficient is fundamental to most of it.
Because electricity is a big chunk of any network's operational costs, the folk who build telecoms equipment use energy intensity or watts per bit as a key metric and focus on its continual improvement.
Despite this there are still plenty of carbon efficiency and awareness upgrades that can be made to the internet.
They just probably aren’t where you think they are.
The so-called ‘wires’ of the internet are traditionally broken down into three areas: the backbone, the metro, and the last mile. At each of these stages the level of aggregation decreases (i.e. each connection is carrying traffic for a smaller number of folk). Sometimes when we talk about ‘wires’ in the context of the internet we mean literal copper ones, but usually we’re actually describing fiber optic cables or radio waves.
The backbone is how the internet transports the packets of millions of users for long distances and includes the bulk of the world’s undersea cables. It is mostly fiber optic and it is highly efficient because it is in the best interests of the folk who build it to ensure that. You may debate whether sending streamed TV or online gaming packets across the Atlantic is a good use of energy but because it is being done on fiber optic cable it is at least efficient.
The metro is what crosses towns and city centers to carry the traffic of thousands of urban users. It is also usually fiber optic and also efficient.
The last mile describes the part that gets an individual user their personal packets in their home; while sitting in a coffee shop; or whilst standing on a train watching YouTube on their phone. In reality, the “last mile” might cover fifty miles or fifty feet depending where you live. It could be copper wires, fiber optic cables or radio waves in the form of 3G, 4G, or 5G. It might even come all the way from Low Earth Orbit (LEO) via satellite systems like Starlink, OneWeb or Amazon’s Project Kuipe.
<Sidebar>What’s the greenest wire?
That is a tricky question. It depends on what you need.
If we just look at the last mile (where all the types of wire are represented head-to-head doing somewhat comparable jobs) fiber is consistently the most efficient way of transporting network traffic. Next up is copper, followed by 5G, which is significantly better than 4G, which is a lot more efficient than 3G. Wifi is more efficient than all the mobile options but less than a wired connection.
The wifi and mobile standards cater for different scenarios. If wifi fits your comms needs - say you are using your laptop at home - use it because it will be the most carbon efficient option. However, according to our networking expert Jon Berger, “If users’ devices are outdoors, moving, or in a location with a lot of interference, they will probably need to be on mobile connections.” That rationale reflects the London Underground’s recent move from using wifi to 5G for whole-journey connectivity.
In the end, it is most efficient to choose the option that is best fitted for the job. Whether that job is worthy of the carbon cost or not is a political question rather than a technical one. This is not a political book. If you want discussions like that, Anne says read her SciFi novels.</Sidebar>
For years, compute and storage have played a significant role in reducing the load on the ‘wires’ and improving efficiency. They do this by providing data compression, clever transcoding, and caching amongst other techniques. No one knows how many CPUs are doing this work as part of the internet, but many experts reckon a plausible estimate is one hundred billion.
<Sidebar>One hundred billion is also the usual estimate for the number of neurons there are in a human brain; how many stars there are in the galaxy; and Elon Musk’s personal wealth in $$$$. That might be a universal coincidence; some kind of existential conspiracy; or suggest one hundred billion is the number humans pick when they mean, “Err… A lot?”</Sidebar>
The person in the street also adds their own compute and storage to the internet via the capabilities of their smartphones, laptops, and other devices. However, most of it resides either in data centers or in “edge” mini DCs located close to where data is generated or near to users (edge DCs are designed to improve response times and require less data to be transmitted on networks in peak times resulting in faster and cheaper services).
We now understand the components that make up the internet: wires, compute, and storage, but how do they fit together?
<Sidebar>
A question you might be asking yourself is are you always better off swapping additional compute, for instance to do compression, for less data transmission on wires? As usual the answer is, “it depends.”
As a result of networks and network devices continually becoming more efficient, less than 10% of the electricity bill of a well designed modern data center is spent on operating the wires, routers, and switches (although in an older DC that proportion can be much higher). Basically, fiber networks have become efficient vs computation. The result is that, in a modern DC, you might sometimes be better off sending data uncompressed. However, if your data is highly and easily compressible; you are sending it at a busy time; or it benefits from compression hardware like video codec chips, then you should compress it.
As always, use the most fitted compression option for the job. There are lots out there so it is worth putting in some research. Unfortunately, many compression algorithms, which are essentially green tech, have hefty patent costs. Low cost, green compression options could be the subject of an entire book and it would be nice to see one.
</Sidebar>
The internet is not a homogenous thing. It is a network of networks.
What we refer to as the internet is actually thousands of different networks all connected together. They often operate over multiple data centers and are internally controlled with their own routers and switches using a variety of networking protocols. These smaller discrete networks, which are often owned and run by private companies, are called Autonomous Systems (ASs). You may never have heard of ASs, but they are the basis of the public internet.
Although some autonomous systems exist only to route data, many also act as ordinary data centers that provide business-as-usual computing services to the companies that operate them.
If you have your own wifi router for your home network (we’ll try not to remind you of the harrowing few hours you spent getting that set up) then in almost all cases that network is part of an autonomous system belonging to your ISP. You are probably unaware of the huge AS of which your house is a tiny piece.
Whatever size they are, all these networks use electricity and have embodied carbon in their wires and physical routers and switches as well as in their servers and storage equipment. There are networks that potentially could have less embodied carbon, for example satellite systems like SpaceX’s Starlink. But are such systems part of the solution or part of the problem?
Starlink, the communications system from Elon Musk’s SpaceX, provides internet connectivity from Low Earth Orbit (LEO) via a fleet of orbiting satellites. Love it or hate it, Starlink is an ethical and green can of worms. Fortunately, we love opening those.
Putting aside whether or not we like Musk (everything’s not always about you, Elon), let’s consider the pros and cons of using satellites to extend the internet to parts of the globe that terrestrial connections cannot (or do not) reach. It’s an idea that presents an extreme case of the tradeoffs of networking, technology, energy use, and the ultimate priorities of humanity. So, you might want to grab a snack.
<Sidebar>When Sara worked in the operations department of one Telco, the company had some stations in the far, far north of Sweden. She remembers, “Wow it was a PAIN when one of those broke. It could easily be a day long drive plus a good trek for the poor service engineer to swap a faulty part. And if it included climbing there had to be two people. It was expensive as heck for something that could be a very cheap broken part.” Telcos refer to these as “truck rolls,” and they are something every ISP wants to avoid if at all possible, which is one of the reasons not everywhere has great internet connectivity.</Sidebar>
LEO
There are some significant downsides to a huge number of satellites in Low Earth Orbit and we really could be talking about a HUGE number of satellites.
<Sidebar>The trouble is, each satellite can only serve a limited set of users due to wave interference. Those annoying laws of physics.
For a full internet replacement, we wouldn’t need a hundred billion satellites but we would require a heck of a lot more than the twelve thousand initially proposed by SpaceX for Starlink, or even the 42,000 that count has since risen to. Realistically, because of the colossal numbers required, something like Starlink is not going to be a replacement for the internet and all of its embodied carbon in the near future. However, even without such lofty ambitions 42K satellites is a lot and it’s probably only the start.</Sidebar>
The negatives of high numbers of orbiting satellites include:
The embodied carbon in those sophisticated pieces of kit, which have a limited shelf/orbit life.
Risk of collisions, potentially even resulting in a situation where LEO becomes an unusable debris field of smashed satellites - a so-called Kessler syndrome. (This is not precisely a green issue, but it is a major concern).
Photobombing astronomical observations from Earth.
Energy spent on launches (even if the rocket fuel is hydrogen, that can be carbon intensive to produce).
<Sidebar>In 1978, the NASA scientist Donald Kessler raised the concern that if satellites ever began smashing into one another it could lead to a feedback loop where each crash led to more debris, making another crash with that detritus more likely until all the satellites in an orbit were smashed and there was so much trash up there you couldn’t use the orbit or perhaps even pass through it. This was dubbed a Kessler Syndrome.
A Kessler Syndrome in Low Earth Orbit would (hopefully) not be apocalyptic because there is still enough atmospheric drag up there that most of the pieces would eventually fall to Earth and burn up. In other words, it’s self-hoovering in a few decades. That is roughly the same kind of time it takes for methane to decay in the atmosphere - another of those cosmic coincidences.
You could argue LEO is therefore a relatively safe place to get the hang of the engineering required to handle collision avoidance. Safer, anyway, than risking a Kessler event in a higher orbit outside of the atmosphere from which the Earth would never naturally recover - the resulting space junk would hang around forever.
Nevertheless, the loss of LEO for twenty years would still be less than ideal (a British understatement there). On top of this, due to high speed collisions some of the debris would inevitably get kicked up into higher and more dangerously permanent orbits.</Sidebar>
On the other hand…
On the other side of the scales, LEO satellite systems could potentially provide internet connectivity to places that would be hard to hook up otherwise. This includes many parts of Africa. Satellites also require less terrestrial last mile infrastructure (thus less embodied carbon) and can be powered directly by solar panels. If we could make them work and get the costs down, they might therefore be a green tool in some situations.
Universal internet access is an important part of the UNs Sustainable Development Goals for humanity and there are moral, philosophical, and practical reasons why the benefits of connecting everyone on Earth might outweigh the risks and green issues. As well as being an ethical imperative, universal internet access is also an important element in global education which, according to Project Drawdown, is vital for the energy transition. Moving off fossil fuels will be very, very difficult and the more educated brains from every part of the globe we can get working on the problem and manning green jobs the more likely we are to succeed.
<Sidebar>Bill Gates extends this fairness and human capital argument in his book, “How to Avoid a Climate Disaster” to suggest that Sub-Saharan African countries should get a free pass on carbon emissions until they can get themselves into a reasonable state with respect to food and energy security, and education. We can see the point he is making.</Sidebar>
Unfortunately, however, even with satellites (and they are not the only option), universal connectivity isn’t a given. For example, Starlink is currently too expensive for it to become ubiquitous throughout Africa. In addition, as the Tony Blair institute has pointed out, LEO could be chock full of cheap satellites and it would still not guarantee a truly global internet because technology is not the trickiest bit of that problem. The cost of smartphones; lack of literacy and digital skills; and lack of accessibility are all greater barriers to universal internet access (nevermind Sub Saharan Africa, they are even in the UK).
So are satellites green or not?
It’s hard to guess whether internet satellites will turn out to be a green technology or not but we do know that a high scale, efficient green system would inevitably require a heck of a lot of satellites in orbit. That suggests success will rather depend on whether they all crash into one another and wipe out LEO for a generation. However, we do know that, “but we’ll connect Africa!” is not an unchallengeable response to all objections to satellites because, alone, they are not enough to achieve it.
Stepping back, this book is not about hardware, spaceware, or global politics! This is supposed to be a book about software and how that can make the internet greener. The good news is, we do have multiple options there, even if they are less SciFi and more terrestrial.
Software has a major role to play in greening networks:
It can be used to reduce the amount of traffic transmitted on wires, meaning less infrastructure is required, lowering embodied carbon and electricity use.
It can spread the traffic load, ensuring devices and cables have a higher lifetime utilization, which again reduces infrastructure requirements and delivers better ROI on embodied carbon.
It could make the wires, compute, and storage of the internet way more carbon aware (i.e. do more work when and where the electricity is low carbon and less when the carbon intensity is high - aka demand shifting).
Hurray! That sounds great!
It is. However, we need to be careful about how we tackle internet-scale carbon awareness within networks. There are dangers, rabbit holes, and distractions and there is a big difference between how risky or effective demand shifting is likely to be depending on where in the network stack it happens.
For example, are we talking about predictable, well established and well understood techniques at the application-level or low-level interventions like routing traffic differently?
The data packets of the public internet get from A to B via physical routers that choose which pipe to send each packet down next. Unfortunately, that is a genuinely difficult choice.
Even if you are doom scrolling on the International Space Station or somewhere similarly limited in its connections, there are still a staggering number of different paths a packet from Facebook or X (or whatever it’s called today) could take to get to you. The routers of the public internet attempt to pick the best one using something called the Border Gateway Protocol (BGP).
BGP routers don’t calculate end-to-end routes for packets. That would be impossible to operate at internet scale because the number of potential routes is too huge. Instead, BGP takes a simpler approach. It calculates which router your packet will travel through next on what should be the optimal route to its destination - or at least a good enough one.
A BGP router’s decisions are based on a combination of things, including:
Trying to minimize the number of ASs transited by the packet.
Taking into account policy rules and commercial arrangements between the operator of that router and the ASs it is connected to.
Crucially, BGP is only interested in the next “hop” in the route. It doesn’t know much about (and can make no guarantees of) the packet’s end-to-end journey.
So, given that BGP route calculations are already based on several factors, couldn’t greenness just become one of them? For example, if I were routing a packet between places on opposite sides of the world (e.g from London, UK to Sydney, Australia) couldn’t BGP send it on the route that was more in sunshine - and thus solar powered - even if the darker route would be faster?
That is the question we will attempt to answer next.
The risks and rewards of changing BGP
The question we’re asking isn’t really, “technically, could BGP take sustainability factors into account when routing?” because BGP is just code and, in theory, everything’s technically possible. What we mean is, “is it a good idea?” I.e. is it the best way to deliver reduced carbon emissions?
Although low level networking is highly optimized already, there is a heck of a lot of traffic out there (even if networking accounts for just 10% of the internet's gross energy usage that could still be 30 TW per year). The potential reward of routing it via networks powered by renewably generated electricity is therefore significant.
However, it is not clear that changing or replacing BGP routing is the right way to achieve this payoff. There are several problems with the approach:
BGP is amazing but its importance means it is also the weakest link in the stability of the internet. Every time a massive internet outage occurs we all think, “I bet it’s a BGP misconfiguration!” and we’re usually right (unless it’s DNS). BGP is complex, critical, and relies on trust and on ISP administrators never making a major mistake. As far as we can tell, there is little appetite amongst network experts to add further complexity to it and they have excellent reasons for that attitude. Their main priority is a stable internet and up until now, BGP in its current form has provided it. Partial outages happen but the internet as a whole stays up.
The commercial incentives for AS owners are complex and it's not straightforward to align them with our green agenda using BGP. Some ASs make their money by being a hop in the internet and may actively want traffic. Others provide their AS as a necessary contribution to the internet but would be very happy if less traffic was routed through it because that traffic is just a cost to them. If being a greener route would garner more traffic that would be an incentive for some ASs to be green but a disincentive for others. It therefore isn’t clear that routing based on greenness would be the optimal way to encourage all networks to go green. The results might be unpredictable.
Mucking around with BGP to enable data to follow the sun or route around carbon intense regions is therefore something we authors wouldn’t want to touch with a ten foot pole. Our strong suspicion is that the risks and issues with greener BGP routing would outweigh the benefits.
The reality is, although there are problems with BGP the underlying quality of the routing isn’t one of them. If I send a data packet from New York to Paris, once it leaves the data center at my end BGP will efficiently route it more or less straight to its destination. Unless something goes horribly wrong, we can feel confident it won’t end up circumnavigating the Earth 20 times and, just as importantly, it will get where it is headed. We shouldn’t take that confidence for granted. It was hard won.
We cannot be so sanguine about what our software systems might do to the data inside the data center before it leaves. It could be split apart and pass through hundreds of microservices using an energy intensive variety of service mesh. It could be unnecessarily saved in carbon-intensive storage media. It could be duplicated in multiple regions for a level of high redundancy that isn’t truly required.
There are few ways network users (i.e us software developers) can badly screw up sending a packet. We could send more data than is required, or less, or the wrong data but those are application-level problems not routing ones. Software architecture is a lot more likely to make the internet inefficient than BGP.
One day, BGP will have to be replaced because it isn’t scalable enough. However, upgrading it will be a major, decades-long undertaking and possibly the hardest challenge the internet has yet faced. As Jon Berger points out, “More of the networking behavior of the internet is emergent than we like to think. Changing as fundamental a component as BGP will not be easy or safe.”
Radically improving the sustainability of the internet is something we have to do now. Revolutionizing BGP is also necessary, but a long term project.
We authors would prefer to decouple these two very hard problems and fortunately we can. Changing BGP isn’t the low hanging fruit when it comes to greening the internet and isn’t a blocking issue. Application-level improvements are well understood, more impactful, safer, and faster to implement. They also have multiple knock-on benefits. As we are about to hear, several of these were demonstrated during the COVID pandemic…
It is tricky to tell whether society as a whole learned much from the lockdowns of 2020, but the tech industry did and we learned it right at the start - within the first few months or even weeks.
The good news is those learnings are extremely relevant to the energy transition, even if most of us didn’t realize it at the time.
At the start of the COVID lockdowns the internet had to handle a massive surge in demand as billions of people worldwide switched their face-to-face interactions to virtual conferencing. This was all done without adding any extra network infrastructure.
As John Graham-Cunning, chief technology officer of the Content Delivery Network (CDN) firm Cloudflare observed, “It's hard to imagine another utility (say electricity, water or gas) coping with a sudden and continuous increase in demand of 50%.”
As a result of this unprecedented need for bandwidth, software engineers had to learn about resource management in a hurry. Specifically, they had to rapidly get their heads around the concepts of:
Demand shifting and shaping using clever (often cloud) architectures like CDNs.
Graceful service downgrades.
Efficiency upgrades (which we covered in chapter 2).
As we discussed in chapter 5, a fundamental feature of renewable energy is that it is not always available. The sun isn’t always shining and the wind isn’t always blowing. One of the ways we can deal with such variability is by only doing work when there is clean power available for it even if that isn’t time-synchronized with the demand for the work. Achieving this is called demand shifting or time shifting and an example is provided by CDNs. CDNs handle limited bandwidth rather than limited power availability but the concepts and techniques are similar.
For decades, internet response times have been speeded up by CDNs. The earliest were marketed as ways for website customers to see images or videos faster, and they achieved that by storing copies of assets all over the world, close to requesting users. CDNs were effectively a magic trick: the asset seemed to have traveled to the user more quickly, but in reality it was already waiting nearby.
CDNs use pre-transmission, pre-processing and pre-caching of data assets, all of which are demand-shifting techniques.
<Sidebar>Note that “demand shifting” is a misnomer in some cases including that of CDNs. The demand hasn’t been shifted, the work has been shifted to a different point in time. Fundamentally, the decoupling of work from demand is what we are trying to achieve with demand shifting.</Sidebar>
The purpose of CDNs is to improve access speed and that is great for end-user experience. However, when the pandemic hit it was their resource management capabilities that proved invaluable.
The premise of a CDN is that it makes smart use of storage. One instance of a large digital asset moves the long distance from the asset’s supplier to the CDN, where it is cached. Copies of the asset (let’s say it’s an HD video) are then sent the shorter distances to their final destinations in the homes of customers who are demanding immediate access to The Barbie Movie or maybe even Oppenheimer. The result is the overall load on the internet is reduced compared to if all of those giant assets had been sent end-to-end.
In addition, the size of the asset copy sent from the CDN can be tailored to the end consumer. Someone on a phone might get a lower resolution, smaller version than someone on a 4K TV. Again this reduces internet traffic.
That is not the only win. Because the original assets are being moved into position on the CDN in advance, they can be sent when the network is quiet. That flattens peak loads and gets better utilization out of all that embodied carbon in the network. If you know which of your assets folk are going to want to access and when (and you often do, that’s what marketing is for) you can make the internet more efficient using a CDN. As we discussed earlier, reducing traffic or smoothing it out to get rid of peaks and improve utilization is green. Less electricity is required to send the data and less infrastructure needs to be built to transmit it.
Sometimes the huge asset doesn’t even get transported over a network at all. Netflix sends copies of their films to CDNs in trucks.
<Sidebar>Yes, physical trucks. As a wise man named Andrew Tanenbaum once said, “Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway.”</Sidebar>
CDNs are a real world example of the concept of demand shifting and they were one of the ways the internet survived 2020. However, they were not the only one.
One way to preserve a service is to plan for how you’re not going to preserve it.
A brownout is what happens when you drop the quality of energy-related services in an area when there is a shortage of power. They are called after a historic symptom of low grid power, which is that filament bulbs get dimmer and everything looks a little murky.
A brownout is a physical example of a so-called graceful downgrade: the maintenance of limited functionality in the face of system issues rather than total failure (in this case a full blackout). Facing COVID-related bandwidth shortages, Netflix did their own version of a brownout. As a graceful downgrade, they cut their network traffic by reducing the quality of their EU service offering by switching their video encodings from high-definition to low def. Our lockdown movies may have been a bit grainier as a result but we could still watch them. This was also an example of demand shaping.
Video Conferencing (VC) companies like Zoom used service downgrades to achieve a similar effect. VC is a textbook example of where you can perform bandwidth equivalents of brownouts. According to network industry expert Christopher Liljenstolpe, “Current mass-market VC systems are very bandwidth forgiving. That prevented the pandemic meltdown.”
VC services make heavy use of QoS (Quality of Service) techniques of monitoring and prioritization to handle bandwidth variability. For example, high-quality audio is vital to a call but relatively cheap in terms of network usage. Video is way more resource intensive, but its quality can be reduced if necessary without the call suffering too much. Audio data is therefore labeled and prioritized over video data by networks.
Video conferencing services also use cunning wheezes like kitten filters and backgrounds, which reduce the amount of video data that has to be sent.
<Sidebar>In the case of HD->SD encoding changes, demand shaping is again a slight misnomer. The demand wasn’t changed, it was the service level that was dropped in order to maintain a minimum quality. Kitten filters are definitely demand shaping though. Customers specifically choose to use a filter which, unbeknownst to them, reduces their bandwidth requirements. For the sake of convenience we’re lumping these together because the effect is similar: bandwidth requirements are reduced.</Sidebar>
It’s not just video conferencing services that can handle bandwidth variability. Most well-architected applications have some mechanism for coping with dodgy networks because (even without BGP outages) sometimes the internet is flaky.
That is why internet thinking is ahead of the rest of the tech sector on demand shifting and shaping. As software architects, we need to come up with our own cunning wheezes for handling times when energy will be nonexistent or very expensive. We provided some ideas in chapter 5.
Winter is coming
Dynamic Tariffs are a kind of electricity tariff where the costs change from half hour to half hour depending on what’s available on the local grid. Because renewable power is now cheaper than fossil fuels, dynamic tariffs often reflect how green the currently available power is.
Such tariffs have already been introduced in Spain and several other countries and regions in the EU and North America. They are inevitable for the rest of us and will require a shift in our mindsets. We have had decades to get used to designing for flaky internet connections but most of us still have an old fashioned view of electricity as 100% available. It’s time for us to start thinking about graceful service downgrade options for power in the same way we do for limited bandwidth availability.
The internet is an example of something incredibly resilient. To handle the pandemic, service offerings were gracefully downgraded in thousands of ways by engineers and product managers and by the users who accepted and worked around those degradations. In the face of a crisis, they all pulled in the same direction towards one goal: to keep things running.
The irony is that didn’t work so effectively because the internet is ordinarily a solid, reliable platform. Arguably, it worked because it isn’t, it wasn’t, and it never has been.
The internet is full of flaws. It is a kind of built-in chaos engineering platform and every application that runs on it successfully has to be capable of handling issues and outages.
The reality is, it is easier to switch from running on a 90% reliable platform to a 50% reliable one, than it is to move from 100% reliability to 95%. Few brand new “keep going internet!” levers were pulled during the COVID crisis. They were already tried and tested.
It’s amazing what humanity can achieve when we have to. However, things would have been very different if we’d had to pivot from an assumption of 100% internet reliability. When it comes to power resilience, we software engineers are going to have to learn a hard lesson very fast because we too often assume 100% power reliability.
As a rule of thumb, the lower layers of the internet are efficient but the upper layers aren’t and that is where we should be focusing our attention first. There is plenty of opportunity for improvement at the application level.
<Sidebar>Counterintuitively, the low hanging fruit is at the top of the stack.</Sidebar>
In this chapter we looked at some real world examples of internet demand shifting and shaping. We also looked at the power that a platform you know is flaky has to drive reliability and efficiency. These chaos engineering techniques are what kept the internet up during the COVID pandemic and we need to use similar ones for handling the coming transition to less predictable renewable power.
So what must we do?
Start architecting everything for dynamic tariffs.
Make sure that any platform we rely on has a plan for dynamic tariffs, power outages, demand shifting, and demand shaping.
Stop making the assumption that power is 100% available. Start thinking of it more like bandwidth or connectivity and consider demand management and graceful downgrade strategies.
The commodity tools we have available that already do demand shifting and shaping (for example CDNs and Spot Instances) will be vital to the energy transition.
The good news is that during the lockdowns our industry was able to switch to a new way of doing things fast when we had to. However, the internet had always been flaky and that meant downgrades, demand shifting, and demand shaping had been vital and familiar parts of application design since the beginning. We are not used to applying the same expectations to electricity from the grid.
We need to get used to it.