From 374d867182ed1686a292df9049b55ed871ea54fc Mon Sep 17 00:00:00 2001 From: Markus Seidl Date: Tue, 17 Jan 2023 09:25:28 +0100 Subject: [PATCH 1/5] Direct conversion of @srini1978 submitted version from https://github.com/Green-Software-Foundation/green-software-patterns-dev/blob/3082514aefa56b1688775e603bdc0532320f390f/docs/catalog/web/Use%20async%20network%20calls.md Wording has been fixed a bit. --- docs/catalog/web/use-async-instead-of-sync.md | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 docs/catalog/web/use-async-instead-of-sync.md diff --git a/docs/catalog/web/use-async-instead-of-sync.md b/docs/catalog/web/use-async-instead-of-sync.md new file mode 100644 index 00000000..2dd314bf --- /dev/null +++ b/docs/catalog/web/use-async-instead-of-sync.md @@ -0,0 +1,41 @@ +--- +version: 1.0 +submitted_by: srini1978, markus-ntt-seidl +published_date: TBD +category: web +tags: + - web +--- + +# Use Asynchronous network calls instead of synchronous + +## Description + +When making calls across process boundaries to either databases or file systems or REST APIs, use asynchronous calling patterns compared to synchronous calls. + +## Solution + +Using asynchronous patterns frees the calling thread from being blocked on the response and hence additional work is achieved without CPU cycles being consumed. Therefore this pattern drives optimal utilization of the CPU and Memory cycles contributing to lesser energy consumed. + +## SCI Impact + +`SCI = (E * I) + M per R` +[Software Carbon Intensity Spec](https://grnsft.org/sci) + +This pattern affects the SCI as follows: + +- `E`: This pattern drives optimal utilization of the CPU, hence energy consumed is reduced +- `M`: Optimized average CPU utilization can reduce the amount of resources needed which will decrease the amount of embodied carbon required to support + +## Assumptions + +- The specific library for making asynchronous calls is available in the language being used for web development. E.g Task parallel library in C# + +## Considerations + +[PATTERN_CONSIDERATIONS] + +## References + +- Async/Await (https://en.wikipedia.org/wiki/Async/await) +- Optimize Peak and Average CPU utilization (https://patterns.greensoftware.foundation/catalog/cloud/optimize-avg-cpu-utilization) From 6e11cf01a5f78df57af891a08b616a4ca289d1da Mon Sep 17 00:00:00 2001 From: Markus Seidl Date: Mon, 20 Feb 2023 07:14:45 +0100 Subject: [PATCH 2/5] Moved it to cloud; added consideration --- docs/catalog/{web => cloud}/use-async-instead-of-sync.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename docs/catalog/{web => cloud}/use-async-instead-of-sync.md (91%) diff --git a/docs/catalog/web/use-async-instead-of-sync.md b/docs/catalog/cloud/use-async-instead-of-sync.md similarity index 91% rename from docs/catalog/web/use-async-instead-of-sync.md rename to docs/catalog/cloud/use-async-instead-of-sync.md index 2dd314bf..3c631855 100644 --- a/docs/catalog/web/use-async-instead-of-sync.md +++ b/docs/catalog/cloud/use-async-instead-of-sync.md @@ -2,9 +2,9 @@ version: 1.0 submitted_by: srini1978, markus-ntt-seidl published_date: TBD -category: web +category: cloud tags: - - web + - cloud --- # Use Asynchronous network calls instead of synchronous @@ -33,7 +33,7 @@ This pattern affects the SCI as follows: ## Considerations -[PATTERN_CONSIDERATIONS] +- Consider higher level patterns for asynchronous communication as well, for example Queues, Topics and Streams ## References From 76a52d852405ac1f70ae148715e247edfd74d33d Mon Sep 17 00:00:00 2001 From: Markus Seidl Date: Mon, 20 Feb 2023 07:37:14 +0100 Subject: [PATCH 3/5] Added reference to the Azure WAF --- docs/catalog/cloud/use-async-instead-of-sync.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/catalog/cloud/use-async-instead-of-sync.md b/docs/catalog/cloud/use-async-instead-of-sync.md index 3c631855..f6af1388 100644 --- a/docs/catalog/cloud/use-async-instead-of-sync.md +++ b/docs/catalog/cloud/use-async-instead-of-sync.md @@ -39,3 +39,4 @@ This pattern affects the SCI as follows: - Async/Await (https://en.wikipedia.org/wiki/Async/await) - Optimize Peak and Average CPU utilization (https://patterns.greensoftware.foundation/catalog/cloud/optimize-avg-cpu-utilization) +- [Azure Well-Architected Framework Sustainability Pillar](https://learn.microsoft.com/en-us/azure/architecture/framework/sustainability/sustainability-application-design) From 9a1c334deb3809340edd7f311b15968b08bfe820 Mon Sep 17 00:00:00 2001 From: Markus Seidl Date: Thu, 16 Mar 2023 15:33:51 +0100 Subject: [PATCH 4/5] Fixed grammar --- docs/catalog/cloud/use-async-instead-of-sync.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/catalog/cloud/use-async-instead-of-sync.md b/docs/catalog/cloud/use-async-instead-of-sync.md index f6af1388..269c6942 100644 --- a/docs/catalog/cloud/use-async-instead-of-sync.md +++ b/docs/catalog/cloud/use-async-instead-of-sync.md @@ -15,7 +15,7 @@ When making calls across process boundaries to either databases or file systems ## Solution -Using asynchronous patterns frees the calling thread from being blocked on the response and hence additional work is achieved without CPU cycles being consumed. Therefore this pattern drives optimal utilization of the CPU and Memory cycles contributing to lesser energy consumed. +Using asynchronous patterns frees the calling thread from being blocked on the response and hence additional work is achieved without CPU cycles being consumed. Therefore this pattern drives optimal utilization of the CPU and Memory cycles contributing to reduced energy consumption. ## SCI Impact @@ -24,12 +24,12 @@ Using asynchronous patterns frees the calling thread from being blocked on the r This pattern affects the SCI as follows: -- `E`: This pattern drives optimal utilization of the CPU, hence energy consumed is reduced -- `M`: Optimized average CPU utilization can reduce the amount of resources needed which will decrease the amount of embodied carbon required to support +- `E`: This pattern drives optimal utilization of the CPU, hence reducing energy consumption. +- `M`: Optimized average CPU utilization can reduce the amount of resources needed which will decrease the amount of embodied carbon required to support. ## Assumptions -- The specific library for making asynchronous calls is available in the language being used for web development. E.g Task parallel library in C# +- The specific library for making asynchronous calls is available in the language being used for web development. E.g Task parallel library in C#. ## Considerations @@ -38,5 +38,4 @@ This pattern affects the SCI as follows: ## References - Async/Await (https://en.wikipedia.org/wiki/Async/await) -- Optimize Peak and Average CPU utilization (https://patterns.greensoftware.foundation/catalog/cloud/optimize-avg-cpu-utilization) - [Azure Well-Architected Framework Sustainability Pillar](https://learn.microsoft.com/en-us/azure/architecture/framework/sustainability/sustainability-application-design) From 763b78c7d447bf54b055a06fa5c41229d8c4a0f2 Mon Sep 17 00:00:00 2001 From: Markus Seidl Date: Thu, 16 Mar 2023 15:37:15 +0100 Subject: [PATCH 5/5] DCO Remediation Commit for Markus Seidl I, Markus Seidl , hereby add my Signed-off-by to this commit: 374d867182ed1686a292df9049b55ed871ea54fc I, Markus Seidl , hereby add my Signed-off-by to this commit: 6e11cf01a5f78df57af891a08b616a4ca289d1da I, Markus Seidl , hereby add my Signed-off-by to this commit: 76a52d852405ac1f70ae148715e247edfd74d33d I, Markus Seidl , hereby add my Signed-off-by to this commit: 9a1c334deb3809340edd7f311b15968b08bfe820 Signed-off-by: Markus Seidl --- docs/catalog/cloud/use-async-instead-of-sync.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/catalog/cloud/use-async-instead-of-sync.md b/docs/catalog/cloud/use-async-instead-of-sync.md index 269c6942..2acf4b17 100644 --- a/docs/catalog/cloud/use-async-instead-of-sync.md +++ b/docs/catalog/cloud/use-async-instead-of-sync.md @@ -5,6 +5,7 @@ published_date: TBD category: cloud tags: - cloud + - size:medium --- # Use Asynchronous network calls instead of synchronous