The carbon-aware pattern makes software sensitive to electricity carbon intensity, so computation can move to cleaner times or regions instead of running whenever and wherever resources are available. section 8.4.7
Use three complementary adjustments:
- Time shifting schedules energy-intensive work when the grid is cleaner, such as during periods with more wind, solar, hydro, or nuclear power. section 8.4.7
- Location shifting runs heavy computation in a lower-carbon region when deployment spans multiple data centers. section 8.4.7
- Workload scaling reduces resource usage when electricity is more carbon-intensive. section 8.6
Delay a daily report
Before launching a heavy daily business report, query the WattTime forecast endpoint for predicted carbon intensity over the next several hours. Select the lowest-emission window, while enforcing a maximum delay so the report still runs at least once per day. section 8.4.7
Table 8.1 The seven green design patterns
|
Pattern
|
Problem
|
Solution
|
|---|---|---|
|
Frugality
|
Unused features and overengineered architectures waste CPU, memory, and development effort.
|
Build only what provides real value and keep features and technical choices minimal.
|
|
Lean packaging
|
Packages become bloated with unused dependencies and dead code.
|
Remove unnecessary libraries and code to produce smaller, lighter artifacts.
|
|
Lean storage
|
Systems accumulate too much data and operational waste.
|
Store only the data needed, use efficient formats, and delete accumulated waste regularly.
|
|
Lean communication
|
Systems perform excessive network calls with large payloads.
|
Reduce request frequency, use caching, and minimize payload size.
|
|
Efficient execution
|
Inefficient or careless logic forces the system to perform unnecessary computation.
|
Use better algorithms and smooth workloads.
|
|
Memory efficiency
|
Applications retain more data in memory than required.
|
Hold only the data the system actively needs, release resources promptly, and use lightweight structures.
|
|
Carbon aware
|
Tasks run when or where electricity is most carbon-intensive.
|
Shift work to cleaner times or regions and adjust capability based on grid intensity.
|
Compare carbon-aware execution with the other green design patterns, including frugality, lean storage, lean communication, efficient execution, and memory efficiency. section 8.4.7
