SlideShare ist ein Scribd-Unternehmen logo
1 von 50
Downloaden Sie, um offline zu lesen
Cloud-Native & Sustainability: How and
Why to Build Sustainable Workloads 🌱
Software Craft Community @ DATEV, June 2023
Nico Meisenzahl
(Head of DevOps Consulting & Operations,
Cloud Solution Architect)
+49 8031 230159-0
nico.meisenzahl@whiteduck.de
@nmeisenzahl
www.linkedin.com/in/nicomeisenzahl
Who am I?
• Doing Cloud Native, Kubernetes & Azure
• Microsoft MVP
• Microsoft Azure
• Developer Technologies
• GitLab Hero
Agenda
• What is sustainability?
• Cloud-native & sustainable workloads
• Patterns & best-practice for cloud-native apps
• Real-world examples
• Current state & how to get started
4
What is sustainability? 🌱
5
6
Sustainability means creating and maintaining software systems
with minimal negative impact on the environment, society, and the
economy.
In software development, the overall goal is to develop and operate
carbon-efficient applications. 🌱
Principles to be carbon efficient
• Energy Efficiency
• Carbon Awareness
• Hardware Efficiency
• Measurement
• Climate Commitments
7
Energy Efficiency
“Use the least amount of energy possible”
• most electricity is still generated by burning fossil fuels and is responsible
for 49%* of carbon emissions into the atmosphere
• already a common pattern for mobile apps
• needs to be expanded to all workloads
• waste as little as possible within the whole developer lifecycle
• also think about the end-user
• aim for a high utilization of compute resources
• the relationship between power consumption and utilization is not linear
8
* https://ourworldindata.org/co2-and-greenhouse-gas-emissions#co2-emissions-by-sector
Carbon Awareness
“Do more when the electricity is cleaner and do less when the
electricity is dirtier”
• carbon intensity varies depending on the time and place it is consumed
• prefer green energy over brown even if it comes with downsides
• we need to push/invest into green energy
• WattTime or Electricity Maps can help gaining insights by providing real-time
data and forecasts of the current carbon intensity on a specific location
• https://www.watttime.org
• https://www.electricitymaps.com
9
Hardware Efficiency
“Use the least amount of embodied carbon possible”
• longer backward compatibility for end-user devices (e.g., web apps)
• better utilize cloud compute resources
10
https://learn.greensoftware.foundation/assets/images/18_amortization-6471768431ab2f6432bee01b1c22d538.png
Measurement
“What you can't measure, you can't improve”
• Software Carbon Intensity (SCI) specification
• energy/hardware efficient and carbon awareness will decrease your SCI score
11
https://learn.greensoftware.foundation/assets/images/23_SCI-9b0c1ccc27826ea65f8ff754c8cc0fbd.png
Climate Commitments
“Understand the exact mechanism of carbon reduction”
• carbon neutral – must cover direct emissions (indirect is optional)
• no need reduce carbon emissions
• compensation to reduce emissions outside of their value chain
• net zero – the actual amount of carbon in the atmosphere remains constant
• through carbon removals (neutralizations)
• requires emissions reductions in line with a 1.5°C pathway
• carbon negative – remove more CO2 from the atmosphere than emitting
• 100% renewable – either “direct powered by” or via certificates
12
Cloud-native & sustainable workloads 💚
13
Sustainable workloads are…
• developed and operated while being aware of the environmental impact
• optimized for environmental impact
• maximize utilization while minimizing waste
• ultimately reducing the footprint on the environment
• carbon efficiency, i.e., emitting as few carbon emissions as possible
14
Isn’t cloud-native enough?
• it's a first step into the right direction, but you can do more
• you benefit from advantages through cloud native design patterns
• you rely on the commitment and work from Microsoft Azure
• but it’s still a shared responsibility
• “Azure services are up to 98 percent more carbon efficient and up to 93%
more energy efficient than a traditional enterprise datacenter”*
15
* https://datacenters.microsoft.com/globe/powering-sustainable-transformation
Microsoft commitments*
• $1 billion Climate Innovation Fund
• Commitment to protecting more land than we use by 2025
• Zero-waste certification by 2030
• Water positive by 2030 – replenish more water than we consume
• Diesel-free backup power by 2030
• 100 percent of our electricity consumption, 100 percent of the time, matched
by zero carbon energy purchases by 2030
16
* https://datacenters.microsoft.com/globe/powering-sustainable-transformation
Azure as we know it
17
A different view of Azure
18
An example: Sweden Region datacenter*
• launched in November 2021
• 30 percent reduction in energy costs and 90 percent less water usage
• free cooling – allows the warm air in the building to be mixed with cool outside air to
maintain the correct temperature
• rainwater harvesting – rain is captured and stored to be mainly to produce
humidification for cooling
• recycle and repurposing hardware using Microsoft’s Circular Center
• not yet needed in Sweden (hardware lifetime is about 6 years)
• Amsterdam Circular Center has resulted in 83 percent of hardware being reused
19
* https://news.microsoft.com/europe/features/how-microsofts-new-datacenter-region-in-sweden-incorporates-the-companys-sustainability-commitments
An example: Sweden Region datacenter*
• 100 percent renewable energy
• this can be ensured with near real-time monitoring and partnering with Vattenfall
• every megawatt hour consumed is matched with a MWh of renewable energy
generated during the same hour of consumption
• 45% lower net carbon dioxide emissions for backup power
• by using less carbon-intensive fuel (containing 50% renewable diesel)
20
* https://news.microsoft.com/europe/features/how-microsofts-new-datacenter-region-in-sweden-incorporates-the-companys-sustainability-commitments
Current status (Azure’s and yours)
• “2022 Environmental Sustainability Report”
• https://www.microsoft.com/corporate-responsibility/sustainability/report
• Emissions Impact Dashboard for Azure
• https://appsource.microsoft.com/product/power-bi/coi-
sustainability.emissions_impact_dashboard
• Power BI Pro license required
• Cloud for Sustainability API (Preview)
• https://learn.microsoft.com/industry/sustainability/api-overview
• currently no support for CSP and PAYG
21
Patterns & best practice for
cloud-native apps
22
Decide on the right location
• not the easiest one!
• you should choose a region
• near to your users
• relying on green energy
• even if there are downsides you should still prefer green energy over brown
• we need to invest in green energy to develop it further
• there might not be just one…
23
Demand shifting
• moving your energy consumption to different locations or times of days
where the carbon intensity is lower
• spatial shifting vs. temporal shifting
• less energy demand results in lower carbon intensity (demand can be met
by renewable energy)
24
https://learn.greensoftware.foundation/assets/images/14_spatial_shifting-4949d342f2ff430edea67874a9eaad52.png
Demand shaping
• adapting your energy consumption around carbon intensity variability when
required
• scaling down and/or limit scaling
• eco-mode opt-in for end-users
25
https://learn.greensoftware.foundation/assets/images/16_demand_shaping-4d2d1021da9740ea3cd15a383874f4ed.png
Networking
• the goal is to further eliminate unnecessary traffic
• implement a CDN (Content Delivery Network) for static assets
• follow caching best practices to reduce requests
• enable network compression
• implement DDoS protection
• opt-in for TLS termination where possible
26
Optimize for efficiency
• think about your overall hardware utilization
• the energy does not increase linearly with consumption
• utilize auto-scaling, bursting capabilities (B-Series VMs) & Spot VMs
• latter utilize the otherwise wasted capacity
• rely on Platform as a Service (PaaS)
• managed services are highly optimized and operate on more efficient hardware
• better overall utilization
• build your application based on serverless (Azure Functions)
• delete zombie workloads
• and implement a process to clean them up 27
Microservices
• think about moving to a microservice architecture
• but: they come with an overhead
• monoliths can still be the best choice for smaller applications
• also, don’t build micro-monoliths (not only because of the network overhead)!
• extra overhead on the CI/CD parts
• they allow to scale parts of the application independent form each other
• opt-in for containerization for smaller footprint
28
Think about your data
• Data is gold – but think about how to store it!
• store less frequent requested data to cold or archive storage
• only store what is relevant
• no data is the most sustainable data 😉
• revise your backup and retention policies
• optimize the collection of your metrics & logs
• again, think about what you really need
• also optimize your application logging to not create data you don’t need
29
Real-world examples
30
Rethink your UI/UX
• reduce the components to load and render
• use optimized assets
• don’t render full-size images as thumbnails (network traffic, local CPU usage)
• decide to use lower resolutions in general
• rely on system fonts
• provide an optional eco-mode (opt-in)
• enabled dark-mode
• shifting async jobs to times where green energy is available
• reduced UI
31
Optimize your database (access)
• invest in reducing your database load
• optimize your database queries & indexes
• implement caching where possible
• validate & rework your data design
• this can save a lot of compute & energy
• positive side effect: your applications performance will increase
32
Optimize your code
• implement circuit breaker patterns
• repeated failures can lead to overhead and unnecessary processing
• optimize your code for efficient resource usage
• use optimized and efficient algorithms and design patterns
• rely the “don't repeat yourself” (DRY) principle
• rely on asynchronous access patterns
• queue and buffer requests, then process in batch
• actively decide when and where to process them
• invest into your legacy code
• identify inefficient code and start modernizing it
33
ARM-based compute resources
• “Ampere Altra VMs outperform equivalently sized Intel and AMD instances
from the same generation by 39% and 47%, respectively. In addition to being
the high-performance choice, Ampere Altra processors are extremely power
efficient, directly reducing users’ overall carbon footprint”*
• if you don’t care, move your workload to ARM-based resources
• otherwise, invest time to migrate
• make use of ARM-based resources in runtime and build time (CI/CD)
34
* https://amperecomputing.com/en/blogs/ampere-altra-now-available-on-microsoft-azure-cloud-platform
server-side vs. client-side rendering
• again, this isn’t an easy one
• do you know your end-users?
• server-side pros
• you can opt-in for green energy and better utilization
• less chatty (browser-to-server round-trips) and centralized caching
• lower requirements on the client-side
• client-side pros
• no need for a server, as you can rely on static storage
• it’s more efficient only to render what's needed
• less network traffic
35
Improve API efficiency
• GraphQL can help with chatty I/O antipattern
• “GraphQL is a query language for APIs and a runtime for fulfilling those queries with
your existing data”
• reduce unnecessary load with rate limits and throttling
• implement caching to reduce workload on your backends
• e.g., implement caching via API Management
36
Think about your CI/CD
• rely on shared resources like managed agents
• implement scaling to zero with VM scale sets or containerization
• e.g., run your CI/CD jobs in a shared Kubernetes Cluster
• optimize your pipeline for caching
• don’t build identical things multiple times
• split large code repos (to be able to build just parts of your code)
• reduce your GitOps sync interval
37
Testing is energy intensive
• rely on demand shifting for your integration, performance, load, or any
other intense testing
• move them to a different time or region to reduce carbon intense
• implement chaos engineering
• introduction of chaos engineering can significantly help improve reliability and
resilience and how the applications react to failures
• allows you optimizing your workload to handle failures gracefully with less wasted
resources
38
Don’t use AI for everything! Sorry…
• AI can help to be more sustainable
• e.g., Microsoft uses AI in there Sweden datacenters to manage green energy
consumption
• but AI requires extensive resources for training and hosting models*
• rely on it, but only for use-cases where AI really shines
• do not build the next chat bot
• use it selectively in particular use cases or parts of it
39
* https://sustainabilitymag.com/sustainability/sustainability-applications-for-artificial-intelligence
Kubernetes Event-driven Autoscaling (KEDA)
• allows scaling workload on Kubernetes based on events
• cron scaler allows to stop workload outside of business hours
• “Carbon Aware KEDA Operator” also allows carbon-aware scheduling
40
https://user-images.githubusercontent.com/966110/232321762-bb114716-f719-4e1f-9dc0-20680c94ab52.png
Carbon Aware KEDA Operator
• use carbon intensity data from third party sources such as WattTime,
Electricity Map or any other provider, to dynamically adjust the scaling
• integrates with any KEDA scaler
• allows scaling to zero (as it relies on KEDA)
• more details and current status
• https://github.com/Azure/carbon-aware-keda-operator
• https://www.tfir.io/carbon-aware-kubernetes-scaling-a-step-towards-greener-cloud-
computing
• https://github.com/kedacore/keda/issues/3467
41
Kubernetes Carbon Intensity Exporter
• retrieves the 24-hour carbon intensity forecast data every 12 hours and
stores it into a ConfigMap to be consumed
• therefore, can be used with any application
• currently supports Watttime only
• also used by KEDA Operator
• https://github.com/Azure/kubernetes-carbon-intensity-exporter
42
eBPF & Sustainability
• dynamically program the kernel for efficient networking, observability,
tracing, and security
• https://ebpf.io
• Cilium for scaling Kubernetes networking
• Tetragon for efficient Kubernetes security
• Kubernetes-based Efficient Power Level Exporter (Kepler)
43
https://ebpf.io/static/diagram-b6b32006ea52570dc6773f5dbf9ef8dc.svg
Kubernetes Efficient Power Level Exporter (Kepler)
• leverages eBPF to probe per-container energy consumption and exports
them as metrics
• these metrics allowing users to monitor their containers and nodes energy
consumption
• https://github.com/sustainable-computing-io/kepler
44
https://github.com/sustainable-computing-io/kepler/blob/main/doc/dashboard.png
Carbon-Aware SDK
• at its core the Carbon Aware SDK provides an API, CLI, and C# Library to
assist in building carbon aware software
• https://github.com/Green-Software-Foundation/carbon-aware-sdk
• supports Watttime and Electricity Maps
• is also used by Kepler
45
https://github.com/Green-Software-Foundation/carbon-aware-sdk/blob/dev/images/screenshot_web_api.png
Distributed Application Runtime (Dapr)
• helps building APIs for portable and reliable microservices
• assists implementing patterns like async communications, retries and circuit
breaker
• first-class implementations (clean and optimized code)
• based on Golang*
46
* https://greenlab.di.uminho.pt/wp-content/uploads/2017/10/sleFinal.pdf https://dapr.io/images/banner-image.png
Current state & how to get started
47
Awareness is rising
• “Gartner Says Three Emerging Environmental Sustainability Technologies
Will See Early Mainstream Adoption by 2025”
• https://www.gartner.com/en/newsroom/press-releases/2022-04-21-gartner-says-
three-emerging-environmental-sustainability-technologies-will-see-early-
mainstream-adoption-by-2025
• the tooling ecosystem and projects are still in early stages
• in development, the current focus is on carbon and energy reduction
• not yet about water consumption and waste
48
Get started
• Basics
• https://greensoftware.foundation
• https://principles.green
• https://learn.microsoft.com/en-us/azure/well-architected/sustainability
• https://github.com/Green-Software-Foundation/awesome-green-software
• Container & Kubernetes focus
• https://github.com/cncf/tag-env-sustainability
• German sustainability meetup
• https://www.greenmanifesto.de
49
Thank you!

Weitere ähnliche Inhalte

Was ist angesagt?

SQL Analytics Powering Telemetry Analysis at Comcast
SQL Analytics Powering Telemetry Analysis at ComcastSQL Analytics Powering Telemetry Analysis at Comcast
SQL Analytics Powering Telemetry Analysis at Comcast
Databricks
 

Was ist angesagt? (15)

Cisco Digital Network Architecture – Deeper Dive, “From the Gates to the GUI
Cisco Digital Network Architecture – Deeper Dive, “From the Gates to the GUICisco Digital Network Architecture – Deeper Dive, “From the Gates to the GUI
Cisco Digital Network Architecture – Deeper Dive, “From the Gates to the GUI
 
Mobile cloud computing
Mobile cloud computingMobile cloud computing
Mobile cloud computing
 
Confidential Computing in Azure - SlideShare Ed Dec 2022.pptx
Confidential Computing in Azure - SlideShare Ed Dec 2022.pptxConfidential Computing in Azure - SlideShare Ed Dec 2022.pptx
Confidential Computing in Azure - SlideShare Ed Dec 2022.pptx
 
Credit Agricole: Powering banking apps with the Elastic Stack
Credit Agricole: Powering banking apps with the Elastic StackCredit Agricole: Powering banking apps with the Elastic Stack
Credit Agricole: Powering banking apps with the Elastic Stack
 
Lecture26 cc-security1
Lecture26 cc-security1Lecture26 cc-security1
Lecture26 cc-security1
 
SQL Analytics Powering Telemetry Analysis at Comcast
SQL Analytics Powering Telemetry Analysis at ComcastSQL Analytics Powering Telemetry Analysis at Comcast
SQL Analytics Powering Telemetry Analysis at Comcast
 
Basics of Cloud Computing
Basics of Cloud ComputingBasics of Cloud Computing
Basics of Cloud Computing
 
Cloud agnostic - an approach you might want to avoid
Cloud agnostic - an approach you might want to avoidCloud agnostic - an approach you might want to avoid
Cloud agnostic - an approach you might want to avoid
 
Lecture01: Introduction to Security and Privacy in Cloud Computing
Lecture01: Introduction to Security and Privacy in Cloud ComputingLecture01: Introduction to Security and Privacy in Cloud Computing
Lecture01: Introduction to Security and Privacy in Cloud Computing
 
infrastructure as code
infrastructure as codeinfrastructure as code
infrastructure as code
 
How Redlock Automates Security on AWS
How Redlock Automates Security on AWSHow Redlock Automates Security on AWS
How Redlock Automates Security on AWS
 
Industrial Data Space
Industrial Data SpaceIndustrial Data Space
Industrial Data Space
 
Hybrid integration reference architecture
Hybrid integration reference architectureHybrid integration reference architecture
Hybrid integration reference architecture
 
Intro to Delta Lake
Intro to Delta LakeIntro to Delta Lake
Intro to Delta Lake
 
Cloud migration
Cloud migrationCloud migration
Cloud migration
 

Ähnlich wie Cloud-Native & Sustainability: How and Why to Build Sustainable Workloads

Ähnlich wie Cloud-Native & Sustainability: How and Why to Build Sustainable Workloads (20)

What Makes Software Green?
What Makes Software Green?What Makes Software Green?
What Makes Software Green?
 
Green cloud computing
Green cloud computingGreen cloud computing
Green cloud computing
 
green cloud computing.pdf
green cloud computing.pdfgreen cloud computing.pdf
green cloud computing.pdf
 
Green Computing
Green ComputingGreen Computing
Green Computing
 
Green cloud
Green cloudGreen cloud
Green cloud
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
CloudLighting - A Brief Overview
CloudLighting - A Brief OverviewCloudLighting - A Brief Overview
CloudLighting - A Brief Overview
 
Overview of CloudLightning
Overview of CloudLightningOverview of CloudLightning
Overview of CloudLightning
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Mod05lec24(resource mgmt i)
Mod05lec24(resource mgmt i)Mod05lec24(resource mgmt i)
Mod05lec24(resource mgmt i)
 
GREEN CLOUD COMPUTING
GREEN CLOUD COMPUTINGGREEN CLOUD COMPUTING
GREEN CLOUD COMPUTING
 
Enterprise Trends for MongoDB as a Service
Enterprise Trends for MongoDB as a ServiceEnterprise Trends for MongoDB as a Service
Enterprise Trends for MongoDB as a Service
 
RECAP Project Overview
RECAP Project OverviewRECAP Project Overview
RECAP Project Overview
 
Energy efficient resource allocation in cloud computing
Energy efficient resource allocation in cloud computingEnergy efficient resource allocation in cloud computing
Energy efficient resource allocation in cloud computing
 
BIS Research conducted a webinar on Carbon Neutral Data Center Practices
BIS Research conducted a webinar on Carbon Neutral Data Center PracticesBIS Research conducted a webinar on Carbon Neutral Data Center Practices
BIS Research conducted a webinar on Carbon Neutral Data Center Practices
 
Groth data of-cloud
Groth data of-cloudGroth data of-cloud
Groth data of-cloud
 
IRJET- Recent Trends in Green Cloud Computing
IRJET- Recent Trends in Green Cloud ComputingIRJET- Recent Trends in Green Cloud Computing
IRJET- Recent Trends in Green Cloud Computing
 
Green computing
Green computingGreen computing
Green computing
 
Energy efficient resource allocation007
Energy efficient resource allocation007Energy efficient resource allocation007
Energy efficient resource allocation007
 
greencomputingqwwerrtt-170129172015.pptx
greencomputingqwwerrtt-170129172015.pptxgreencomputingqwwerrtt-170129172015.pptx
greencomputingqwwerrtt-170129172015.pptx
 

Mehr von Nico Meisenzahl

Festive Tech Calendar: Festive time with AKS networking
Festive Tech Calendar: Festive time with AKS networkingFestive Tech Calendar: Festive time with AKS networking
Festive Tech Calendar: Festive time with AKS networking
Nico Meisenzahl
 
ContainerConf 2022: Hijack Kubernetes
ContainerConf 2022: Hijack KubernetesContainerConf 2022: Hijack Kubernetes
ContainerConf 2022: Hijack Kubernetes
Nico Meisenzahl
 
ContainerConf 2022: Kubernetes is awesome - but...
ContainerConf 2022: Kubernetes is awesome - but...ContainerConf 2022: Kubernetes is awesome - but...
ContainerConf 2022: Kubernetes is awesome - but...
Nico Meisenzahl
 

Mehr von Nico Meisenzahl (20)

Container Day Security: How to Prevent Your Kubernetes Cluster From Being Hacked
Container Day Security: How to Prevent Your Kubernetes Cluster From Being HackedContainer Day Security: How to Prevent Your Kubernetes Cluster From Being Hacked
Container Day Security: How to Prevent Your Kubernetes Cluster From Being Hacked
 
Festive Tech Calendar: Festive time with AKS networking
Festive Tech Calendar: Festive time with AKS networkingFestive Tech Calendar: Festive time with AKS networking
Festive Tech Calendar: Festive time with AKS networking
 
ContainerConf 2022: Hijack Kubernetes
ContainerConf 2022: Hijack KubernetesContainerConf 2022: Hijack Kubernetes
ContainerConf 2022: Hijack Kubernetes
 
ContainerConf 2022: Kubernetes is awesome - but...
ContainerConf 2022: Kubernetes is awesome - but...ContainerConf 2022: Kubernetes is awesome - but...
ContainerConf 2022: Kubernetes is awesome - but...
 
KCD Munich 2022: How to Prevent Your Kubernetes Cluster From Being Hacked
KCD Munich 2022: How to Prevent Your Kubernetes Cluster From Being HackedKCD Munich 2022: How to Prevent Your Kubernetes Cluster From Being Hacked
KCD Munich 2022: How to Prevent Your Kubernetes Cluster From Being Hacked
 
KCD Munich 2022: Hijack a Kubernetes Cluster - a Walkthrough
KCD Munich 2022: Hijack a Kubernetes Cluster - a WalkthroughKCD Munich 2022: Hijack a Kubernetes Cluster - a Walkthrough
KCD Munich 2022: Hijack a Kubernetes Cluster - a Walkthrough
 
Cloud Love Conference: Kubernetes is awesome, but...
Cloud Love Conference: Kubernetes is awesome, but...Cloud Love Conference: Kubernetes is awesome, but...
Cloud Love Conference: Kubernetes is awesome, but...
 
How to Prevent Your Kubernetes Cluster From Being Hacked
How to Prevent Your Kubernetes Cluster From Being HackedHow to Prevent Your Kubernetes Cluster From Being Hacked
How to Prevent Your Kubernetes Cluster From Being Hacked
 
Container Days: Hijack a Kubernetes Cluster - a Walkthrough
Container Days: Hijack a Kubernetes Cluster - a WalkthroughContainer Days: Hijack a Kubernetes Cluster - a Walkthrough
Container Days: Hijack a Kubernetes Cluster - a Walkthrough
 
Hijack a Kubernetes Cluster - a Walkthrough
Hijack a Kubernetes Cluster - a WalkthroughHijack a Kubernetes Cluster - a Walkthrough
Hijack a Kubernetes Cluster - a Walkthrough
 
Azure Zürich User Group: Azure Kubernetes Service – more than just a managed ...
Azure Zürich User Group: Azure Kubernetes Service – more than just a managed ...Azure Zürich User Group: Azure Kubernetes Service – more than just a managed ...
Azure Zürich User Group: Azure Kubernetes Service – more than just a managed ...
 
Hijack a Kubernetes Cluster - a Walkthrough
Hijack a Kubernetes Cluster - a WalkthroughHijack a Kubernetes Cluster - a Walkthrough
Hijack a Kubernetes Cluster - a Walkthrough
 
azdevcom - Hijack a Kubernetes Cluster
azdevcom - Hijack a Kubernetes Clusterazdevcom - Hijack a Kubernetes Cluster
azdevcom - Hijack a Kubernetes Cluster
 
Continuous Lifecycle: Enhance Your Compliance and Governance With Policy-Base...
Continuous Lifecycle: Enhance Your Compliance and Governance With Policy-Base...Continuous Lifecycle: Enhance Your Compliance and Governance With Policy-Base...
Continuous Lifecycle: Enhance Your Compliance and Governance With Policy-Base...
 
Continuous Lifecycle: Hijack Kubernetes
Continuous Lifecycle: Hijack KubernetesContinuous Lifecycle: Hijack Kubernetes
Continuous Lifecycle: Hijack Kubernetes
 
Hijack a Kubernetes Cluster - a Walkthrough
Hijack a Kubernetes Cluster - a WalkthroughHijack a Kubernetes Cluster - a Walkthrough
Hijack a Kubernetes Cluster - a Walkthrough
 
GitLab Commit: Enhance your Compliance with Policy-Based CI/CD
GitLab Commit: Enhance your Compliance with Policy-Based CI/CDGitLab Commit: Enhance your Compliance with Policy-Based CI/CD
GitLab Commit: Enhance your Compliance with Policy-Based CI/CD
 
Azure Meetup Hamburg: Production-Ready Terraform Deployments on Azure
Azure Meetup Hamburg: Production-Ready Terraform Deployments on AzureAzure Meetup Hamburg: Production-Ready Terraform Deployments on Azure
Azure Meetup Hamburg: Production-Ready Terraform Deployments on Azure
 
Microsoft DevOps Forum 2021 – DevOps & Security
 Microsoft DevOps Forum 2021 – DevOps & Security Microsoft DevOps Forum 2021 – DevOps & Security
Microsoft DevOps Forum 2021 – DevOps & Security
 
DevOpsCon Berlin: Helm vs Operators – Do I Need to Decide?
DevOpsCon Berlin: Helm vs Operators – Do I Need to Decide?DevOpsCon Berlin: Helm vs Operators – Do I Need to Decide?
DevOpsCon Berlin: Helm vs Operators – Do I Need to Decide?
 

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 

Cloud-Native & Sustainability: How and Why to Build Sustainable Workloads

  • 1.
  • 2. Cloud-Native & Sustainability: How and Why to Build Sustainable Workloads 🌱 Software Craft Community @ DATEV, June 2023
  • 3. Nico Meisenzahl (Head of DevOps Consulting & Operations, Cloud Solution Architect) +49 8031 230159-0 nico.meisenzahl@whiteduck.de @nmeisenzahl www.linkedin.com/in/nicomeisenzahl Who am I? • Doing Cloud Native, Kubernetes & Azure • Microsoft MVP • Microsoft Azure • Developer Technologies • GitLab Hero
  • 4. Agenda • What is sustainability? • Cloud-native & sustainable workloads • Patterns & best-practice for cloud-native apps • Real-world examples • Current state & how to get started 4
  • 6. 6 Sustainability means creating and maintaining software systems with minimal negative impact on the environment, society, and the economy. In software development, the overall goal is to develop and operate carbon-efficient applications. 🌱
  • 7. Principles to be carbon efficient • Energy Efficiency • Carbon Awareness • Hardware Efficiency • Measurement • Climate Commitments 7
  • 8. Energy Efficiency “Use the least amount of energy possible” • most electricity is still generated by burning fossil fuels and is responsible for 49%* of carbon emissions into the atmosphere • already a common pattern for mobile apps • needs to be expanded to all workloads • waste as little as possible within the whole developer lifecycle • also think about the end-user • aim for a high utilization of compute resources • the relationship between power consumption and utilization is not linear 8 * https://ourworldindata.org/co2-and-greenhouse-gas-emissions#co2-emissions-by-sector
  • 9. Carbon Awareness “Do more when the electricity is cleaner and do less when the electricity is dirtier” • carbon intensity varies depending on the time and place it is consumed • prefer green energy over brown even if it comes with downsides • we need to push/invest into green energy • WattTime or Electricity Maps can help gaining insights by providing real-time data and forecasts of the current carbon intensity on a specific location • https://www.watttime.org • https://www.electricitymaps.com 9
  • 10. Hardware Efficiency “Use the least amount of embodied carbon possible” • longer backward compatibility for end-user devices (e.g., web apps) • better utilize cloud compute resources 10 https://learn.greensoftware.foundation/assets/images/18_amortization-6471768431ab2f6432bee01b1c22d538.png
  • 11. Measurement “What you can't measure, you can't improve” • Software Carbon Intensity (SCI) specification • energy/hardware efficient and carbon awareness will decrease your SCI score 11 https://learn.greensoftware.foundation/assets/images/23_SCI-9b0c1ccc27826ea65f8ff754c8cc0fbd.png
  • 12. Climate Commitments “Understand the exact mechanism of carbon reduction” • carbon neutral – must cover direct emissions (indirect is optional) • no need reduce carbon emissions • compensation to reduce emissions outside of their value chain • net zero – the actual amount of carbon in the atmosphere remains constant • through carbon removals (neutralizations) • requires emissions reductions in line with a 1.5°C pathway • carbon negative – remove more CO2 from the atmosphere than emitting • 100% renewable – either “direct powered by” or via certificates 12
  • 13. Cloud-native & sustainable workloads 💚 13
  • 14. Sustainable workloads are… • developed and operated while being aware of the environmental impact • optimized for environmental impact • maximize utilization while minimizing waste • ultimately reducing the footprint on the environment • carbon efficiency, i.e., emitting as few carbon emissions as possible 14
  • 15. Isn’t cloud-native enough? • it's a first step into the right direction, but you can do more • you benefit from advantages through cloud native design patterns • you rely on the commitment and work from Microsoft Azure • but it’s still a shared responsibility • “Azure services are up to 98 percent more carbon efficient and up to 93% more energy efficient than a traditional enterprise datacenter”* 15 * https://datacenters.microsoft.com/globe/powering-sustainable-transformation
  • 16. Microsoft commitments* • $1 billion Climate Innovation Fund • Commitment to protecting more land than we use by 2025 • Zero-waste certification by 2030 • Water positive by 2030 – replenish more water than we consume • Diesel-free backup power by 2030 • 100 percent of our electricity consumption, 100 percent of the time, matched by zero carbon energy purchases by 2030 16 * https://datacenters.microsoft.com/globe/powering-sustainable-transformation
  • 17. Azure as we know it 17
  • 18. A different view of Azure 18
  • 19. An example: Sweden Region datacenter* • launched in November 2021 • 30 percent reduction in energy costs and 90 percent less water usage • free cooling – allows the warm air in the building to be mixed with cool outside air to maintain the correct temperature • rainwater harvesting – rain is captured and stored to be mainly to produce humidification for cooling • recycle and repurposing hardware using Microsoft’s Circular Center • not yet needed in Sweden (hardware lifetime is about 6 years) • Amsterdam Circular Center has resulted in 83 percent of hardware being reused 19 * https://news.microsoft.com/europe/features/how-microsofts-new-datacenter-region-in-sweden-incorporates-the-companys-sustainability-commitments
  • 20. An example: Sweden Region datacenter* • 100 percent renewable energy • this can be ensured with near real-time monitoring and partnering with Vattenfall • every megawatt hour consumed is matched with a MWh of renewable energy generated during the same hour of consumption • 45% lower net carbon dioxide emissions for backup power • by using less carbon-intensive fuel (containing 50% renewable diesel) 20 * https://news.microsoft.com/europe/features/how-microsofts-new-datacenter-region-in-sweden-incorporates-the-companys-sustainability-commitments
  • 21. Current status (Azure’s and yours) • “2022 Environmental Sustainability Report” • https://www.microsoft.com/corporate-responsibility/sustainability/report • Emissions Impact Dashboard for Azure • https://appsource.microsoft.com/product/power-bi/coi- sustainability.emissions_impact_dashboard • Power BI Pro license required • Cloud for Sustainability API (Preview) • https://learn.microsoft.com/industry/sustainability/api-overview • currently no support for CSP and PAYG 21
  • 22. Patterns & best practice for cloud-native apps 22
  • 23. Decide on the right location • not the easiest one! • you should choose a region • near to your users • relying on green energy • even if there are downsides you should still prefer green energy over brown • we need to invest in green energy to develop it further • there might not be just one… 23
  • 24. Demand shifting • moving your energy consumption to different locations or times of days where the carbon intensity is lower • spatial shifting vs. temporal shifting • less energy demand results in lower carbon intensity (demand can be met by renewable energy) 24 https://learn.greensoftware.foundation/assets/images/14_spatial_shifting-4949d342f2ff430edea67874a9eaad52.png
  • 25. Demand shaping • adapting your energy consumption around carbon intensity variability when required • scaling down and/or limit scaling • eco-mode opt-in for end-users 25 https://learn.greensoftware.foundation/assets/images/16_demand_shaping-4d2d1021da9740ea3cd15a383874f4ed.png
  • 26. Networking • the goal is to further eliminate unnecessary traffic • implement a CDN (Content Delivery Network) for static assets • follow caching best practices to reduce requests • enable network compression • implement DDoS protection • opt-in for TLS termination where possible 26
  • 27. Optimize for efficiency • think about your overall hardware utilization • the energy does not increase linearly with consumption • utilize auto-scaling, bursting capabilities (B-Series VMs) & Spot VMs • latter utilize the otherwise wasted capacity • rely on Platform as a Service (PaaS) • managed services are highly optimized and operate on more efficient hardware • better overall utilization • build your application based on serverless (Azure Functions) • delete zombie workloads • and implement a process to clean them up 27
  • 28. Microservices • think about moving to a microservice architecture • but: they come with an overhead • monoliths can still be the best choice for smaller applications • also, don’t build micro-monoliths (not only because of the network overhead)! • extra overhead on the CI/CD parts • they allow to scale parts of the application independent form each other • opt-in for containerization for smaller footprint 28
  • 29. Think about your data • Data is gold – but think about how to store it! • store less frequent requested data to cold or archive storage • only store what is relevant • no data is the most sustainable data 😉 • revise your backup and retention policies • optimize the collection of your metrics & logs • again, think about what you really need • also optimize your application logging to not create data you don’t need 29
  • 31. Rethink your UI/UX • reduce the components to load and render • use optimized assets • don’t render full-size images as thumbnails (network traffic, local CPU usage) • decide to use lower resolutions in general • rely on system fonts • provide an optional eco-mode (opt-in) • enabled dark-mode • shifting async jobs to times where green energy is available • reduced UI 31
  • 32. Optimize your database (access) • invest in reducing your database load • optimize your database queries & indexes • implement caching where possible • validate & rework your data design • this can save a lot of compute & energy • positive side effect: your applications performance will increase 32
  • 33. Optimize your code • implement circuit breaker patterns • repeated failures can lead to overhead and unnecessary processing • optimize your code for efficient resource usage • use optimized and efficient algorithms and design patterns • rely the “don't repeat yourself” (DRY) principle • rely on asynchronous access patterns • queue and buffer requests, then process in batch • actively decide when and where to process them • invest into your legacy code • identify inefficient code and start modernizing it 33
  • 34. ARM-based compute resources • “Ampere Altra VMs outperform equivalently sized Intel and AMD instances from the same generation by 39% and 47%, respectively. In addition to being the high-performance choice, Ampere Altra processors are extremely power efficient, directly reducing users’ overall carbon footprint”* • if you don’t care, move your workload to ARM-based resources • otherwise, invest time to migrate • make use of ARM-based resources in runtime and build time (CI/CD) 34 * https://amperecomputing.com/en/blogs/ampere-altra-now-available-on-microsoft-azure-cloud-platform
  • 35. server-side vs. client-side rendering • again, this isn’t an easy one • do you know your end-users? • server-side pros • you can opt-in for green energy and better utilization • less chatty (browser-to-server round-trips) and centralized caching • lower requirements on the client-side • client-side pros • no need for a server, as you can rely on static storage • it’s more efficient only to render what's needed • less network traffic 35
  • 36. Improve API efficiency • GraphQL can help with chatty I/O antipattern • “GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data” • reduce unnecessary load with rate limits and throttling • implement caching to reduce workload on your backends • e.g., implement caching via API Management 36
  • 37. Think about your CI/CD • rely on shared resources like managed agents • implement scaling to zero with VM scale sets or containerization • e.g., run your CI/CD jobs in a shared Kubernetes Cluster • optimize your pipeline for caching • don’t build identical things multiple times • split large code repos (to be able to build just parts of your code) • reduce your GitOps sync interval 37
  • 38. Testing is energy intensive • rely on demand shifting for your integration, performance, load, or any other intense testing • move them to a different time or region to reduce carbon intense • implement chaos engineering • introduction of chaos engineering can significantly help improve reliability and resilience and how the applications react to failures • allows you optimizing your workload to handle failures gracefully with less wasted resources 38
  • 39. Don’t use AI for everything! Sorry… • AI can help to be more sustainable • e.g., Microsoft uses AI in there Sweden datacenters to manage green energy consumption • but AI requires extensive resources for training and hosting models* • rely on it, but only for use-cases where AI really shines • do not build the next chat bot • use it selectively in particular use cases or parts of it 39 * https://sustainabilitymag.com/sustainability/sustainability-applications-for-artificial-intelligence
  • 40. Kubernetes Event-driven Autoscaling (KEDA) • allows scaling workload on Kubernetes based on events • cron scaler allows to stop workload outside of business hours • “Carbon Aware KEDA Operator” also allows carbon-aware scheduling 40 https://user-images.githubusercontent.com/966110/232321762-bb114716-f719-4e1f-9dc0-20680c94ab52.png
  • 41. Carbon Aware KEDA Operator • use carbon intensity data from third party sources such as WattTime, Electricity Map or any other provider, to dynamically adjust the scaling • integrates with any KEDA scaler • allows scaling to zero (as it relies on KEDA) • more details and current status • https://github.com/Azure/carbon-aware-keda-operator • https://www.tfir.io/carbon-aware-kubernetes-scaling-a-step-towards-greener-cloud- computing • https://github.com/kedacore/keda/issues/3467 41
  • 42. Kubernetes Carbon Intensity Exporter • retrieves the 24-hour carbon intensity forecast data every 12 hours and stores it into a ConfigMap to be consumed • therefore, can be used with any application • currently supports Watttime only • also used by KEDA Operator • https://github.com/Azure/kubernetes-carbon-intensity-exporter 42
  • 43. eBPF & Sustainability • dynamically program the kernel for efficient networking, observability, tracing, and security • https://ebpf.io • Cilium for scaling Kubernetes networking • Tetragon for efficient Kubernetes security • Kubernetes-based Efficient Power Level Exporter (Kepler) 43 https://ebpf.io/static/diagram-b6b32006ea52570dc6773f5dbf9ef8dc.svg
  • 44. Kubernetes Efficient Power Level Exporter (Kepler) • leverages eBPF to probe per-container energy consumption and exports them as metrics • these metrics allowing users to monitor their containers and nodes energy consumption • https://github.com/sustainable-computing-io/kepler 44 https://github.com/sustainable-computing-io/kepler/blob/main/doc/dashboard.png
  • 45. Carbon-Aware SDK • at its core the Carbon Aware SDK provides an API, CLI, and C# Library to assist in building carbon aware software • https://github.com/Green-Software-Foundation/carbon-aware-sdk • supports Watttime and Electricity Maps • is also used by Kepler 45 https://github.com/Green-Software-Foundation/carbon-aware-sdk/blob/dev/images/screenshot_web_api.png
  • 46. Distributed Application Runtime (Dapr) • helps building APIs for portable and reliable microservices • assists implementing patterns like async communications, retries and circuit breaker • first-class implementations (clean and optimized code) • based on Golang* 46 * https://greenlab.di.uminho.pt/wp-content/uploads/2017/10/sleFinal.pdf https://dapr.io/images/banner-image.png
  • 47. Current state & how to get started 47
  • 48. Awareness is rising • “Gartner Says Three Emerging Environmental Sustainability Technologies Will See Early Mainstream Adoption by 2025” • https://www.gartner.com/en/newsroom/press-releases/2022-04-21-gartner-says- three-emerging-environmental-sustainability-technologies-will-see-early- mainstream-adoption-by-2025 • the tooling ecosystem and projects are still in early stages • in development, the current focus is on carbon and energy reduction • not yet about water consumption and waste 48
  • 49. Get started • Basics • https://greensoftware.foundation • https://principles.green • https://learn.microsoft.com/en-us/azure/well-architected/sustainability • https://github.com/Green-Software-Foundation/awesome-green-software • Container & Kubernetes focus • https://github.com/cncf/tag-env-sustainability • German sustainability meetup • https://www.greenmanifesto.de 49