Principle 2: Electricity

Electricity and carbon

Most people think electricity is clean; when we plug something into a wall, our hands don't become dirty, and our laptops don't need exhaust pipes. However, the truth is that most electricity is produced through the burning of fossil fuels, usually coal, and energy supply is the single most significant cause of carbon emission.

Since we can draw a direct line from electricity to carbon emissions, electricity can be considered one of the proxies for carbon.

From the applications running on your smartphone to the training of machine learning models running in data centers, all software consumes electricity in its execution. One of the best ways to reduce electricity consumption and the subsequent emissions of carbon pollution made by our software is to make our applications more energy-efficient.

This is why the second principle of Sustainable Software Engineering is to build applications that are energy-efficient.

As sustainable engineers we need to understand electricity; our journey doesn't start from the computer, it starts from how the electricity that powers our computers is made.

Energy vs. power

Energy is a measure of an amount of electricity used, the standard unit for Energy is Joules or J. However, another common way of referring to energy consumption is in Kilowatt-hours, or kWh.

Electricity is often reported as either Power or Energy, which are two different concepts:

Energy = Power ✕ Time

  • Energy is the total amount of electricity used, the standard unit for Energy is Joules or J.

  • Power is the rate of electricity consumed per unit time; the standard unit of Energy is Watt or W. A single Watt is one Joule per second.

A common way of referring to energy consumption is Power over a unit of Time, such as Watt-seconds or Kilowatt-hours. For example:

  • 20 Watt-seconds or 20 Ws is the amount of power you would get if 20 W were run for one second. Since 1 Watt is 1 Joule per second, this is 20 Joules.

  • 20 Kilowatt-hours or 20 kWh is the amount of energy you would get if 20,000 Watts were running for one hour.

    Energy = 60 ✕ 60 ✕ 20,000 = 72,000,000 Joules = 72 Megajoules (72 MJ)