<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-24657923</atom:id><lastBuildDate>Mon, 24 Nov 2025 14:48:22 +0000</lastBuildDate><category>C#</category><category>.net</category><category>ASP.NET Core</category><category>AWS</category><category>ASP.NET MVC</category><category>asp.net</category><category>Coding Challenge</category><category>ASP.NET MVC Learning</category><category>Angular</category><category>ASP.NET WEB FORMS</category><category>AWS Learning</category><category>C#  Interview Questions</category><category>Extension Methods</category><category>Javascript</category><category>ASP.NET Core Interview Questions</category><category>Akka.NET</category><category>Angular Debugging</category><category>Architecture</category><category>C# Coding Best Practices</category><category>C# Constructors</category><category>C# Tips</category><category>Dependency Injection</category><category>Microservices</category><category>ASP.NET Core Middleware</category><category>AWS EC2</category><category>Amazon EC2</category><category>Angular Issues</category><category>Azure</category><category>Building Dynamic SQL in C#</category><category>C# Cheat Sheet</category><category>C# Coding Standards</category><category>Cloud Computing</category><category>Custom Middleware</category><category>LINQ</category><category>Monolith Services</category><category>String Manipulation in C#</category><category>Task Parallel Library (TPL)</category><category>memory management best practices</category><category>.NET 4.0</category><category>ASP.NET Core API Versioning</category><category>ASP.NET Core Configuration</category><category>ASP.NET Core State Management</category><category>ASP.NET Core WebAPI</category><category>ASP.NET Issue Fixes</category><category>ASP.NET MVC Interview Questions</category><category>ASP.NET Publishing. ASP.NET</category><category>ASP.NET Web API</category><category>AWS Certified Developer - Associate Exam</category><category>AWS Infrastructure</category><category>AWS NACL</category><category>AWS NAT Gateway</category><category>AWS NAT Instance</category><category>AWS Security Groups</category><category>Advanced Programming</category><category>Alibaba Cloud</category><category>Amazon EC2 Instance Purchase Options</category><category>Amazon EC2 instances</category><category>Amazon Inspector</category><category>Angular Pipes</category><category>Angular Sample</category><category>Application Security</category><category>Architecture best practices</category><category>Audio Files</category><category>Authentication</category><category>Authorization</category><category>Azure NAT Gateway</category><category>Beginners Coding Challenge</category><category>Bootstrap</category><category>C# 12</category><category>C# Advanced</category><category>C# Quick Programming</category><category>C# for Beginners</category><category>CI</category><category>Cheat Sheets</category><category>Cloud CI Services Comparison</category><category>Cloud Security</category><category>CommaondField</category><category>Concepts</category><category>Configure Method</category><category>Continuous Deployment (CD)</category><category>Continuous Integration</category><category>Copy Constructors</category><category>DDoS Protection</category><category>DI</category><category>DIP</category><category>DVA-C01</category><category>Dynamic Programming</category><category>DynamoDB</category><category>EC2 Instance Types</category><category>ForgeRock</category><category>Generate CSV values easily in C#</category><category>Global Variables</category><category>Google Cloud</category><category>Gridview</category><category>HTML5</category><category>IBM Cloud</category><category>IOC</category><category>ISP</category><category>ImageCommand</category><category>Immutable String</category><category>Implicit Conversions</category><category>In-Memory</category><category>Interface-Driven Development - IDD</category><category>Interview Questions</category><category>Inversion of Controls</category><category>Ionic</category><category>Ionic Angular</category><category>JQuery</category><category>LCP</category><category>LINQ Example for Select</category><category>LINQ Example for SelectMany</category><category>Lazy Initialization</category><category>Memory Leaks</category><category>New Features in .NET 4.0</category><category>OCP</category><category>OOP in C#</category><category>OneAnanda</category><category>Optional Parameters</category><category>Options Pattern</category><category>Outlook Programming</category><category>PDF Printing</category><category>Performance management</category><category>Programming Questions</category><category>React</category><category>ReactJS</category><category>ReactJS Source Code</category><category>Real World Example</category><category>Reference Programming</category><category>RequestDelegate</category><category>Routing</category><category>SOLID Principles</category><category>SOLID Real World Examples</category><category>SQL</category><category>SQL 2000</category><category>SRP</category><category>SSO</category><category>Select Query LINQ</category><category>Select and SelectMany Difference</category><category>SelectMany LINQ</category><category>Silent Printing C#</category><category>Startup.cs</category><category>Strangler pattern</category><category>String Manipulation</category><category>Typescript</category><category>User Controls</category><category>Visual Studio</category><category>Windows Programming</category><category>Windows Service Print</category><category>checkbox</category><category>client side</category><category>color change</category><category>css</category><category>dropdown</category><category>headertemplate</category><category>ngelse</category><category>ngif</category><category>nodejs</category><category>nodejs interview questions</category><category>print-it implementation</category><category>reference based programming</category><category>select all</category><category>try catch finally</category><category>unselect all</category><title>OneAnanda</title><description>Code and Code Only</description><link>https://code.oneananda.com/</link><managingEditor>noreply@blogger.com (Unknown)</managingEditor><generator>Blogger</generator><openSearch:totalResults>112</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-1398039649665007068</guid><pubDate>Sat, 29 Mar 2025 03:58:00 +0000</pubDate><atom:updated>2025-03-28T20:58:49.335-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#</category><title>Handling Multiple Value Returns in C#: Techniques and Best Practices</title><description>&lt;h1&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Handling Multiple Value Returns in C#: Techniques and Best Practices&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;When coding in C#, you might run into situations where you need your methods to return more than just one value. Instead of juggling multiple lines of code to send back a bunch of data, C# offers several neat ways to do it. Let’s walk through some of these techniques using a simple example: calculating the double and triple of a number.&lt;/span&gt;&lt;/p&gt;&lt;hr /&gt;&lt;h2&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;1. Out Parameters&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Think of out parameters as a way to send back extra data without having to create a whole new object. With out parameters, you can pass variables into a method, and then the method fills them in for you. Here’s a quick look:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;public static void GetDataViaOut(int input, out int doubled, out int tripled)
{
    doubled = input * 2;
    tripled = input * 3;
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Pros:&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Simple and straightforward for small tasks.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Works with any version of C#.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Cons:&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Can be confusing if you have too many out parameters.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Not always the clearest way to show what your method does.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;2. Tuples&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Tuples are a modern and concise way to return multiple values, introduced in C# 7.0. They let you name the values you’re returning, which makes your code easier to read. Here’s how you might use them:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;public static (int Doubled, int Tripled) GetDataViaTuple(int input)
{
    return (input * 2, input * 3);
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;You can grab the values like this:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;var result = GetDataViaTuple(5);
Console.WriteLine($&quot;Doubled: {result.Doubled}, Tripled: {result.Tripled}&quot;);

var (doubled, tripled) = GetDataViaTuple(5);
Console.WriteLine($&quot;Doubled: {doubled}, Tripled: {tripled}&quot;);
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Why I like tuples:&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;They make your intentions clear with named values.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Less code is often needed compared to out parameters.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;3. Custom Classes or Structs&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Sometimes you’re working with related data, and it makes sense to group it together in a custom class or struct. This way, you’re not just returning raw numbers, but a meaningful object. For example:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;public class DataResult
{
    public int Doubled { get; set; }
    public int Tripled { get; set; }
}

public static DataResult GetDataViaCustom(int input)
{
    return new DataResult { Doubled = input * 2, Tripled = input * 3 };
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Benefits:&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;It clearly shows that the values belong together.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Easy to extend if you need to return more related data later.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Drawback:&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Might feel like too much work for simple tasks.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;4. KeyValuePair&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;If you only need to return two values, you might consider using a KeyValuePair. It’s quick and gets the job done:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;public static KeyValuePair&amp;lt;int, int&amp;gt; GetDataViaPair(int input)
{
    return new KeyValuePair&amp;lt;int, int&amp;gt;(input * 2, input * 3);
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Highlights:&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Simple and direct when working with just two values.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Limitations:&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;The property names &lt;code inline=&quot;&quot;&gt;Key&lt;/code&gt; and &lt;code inline=&quot;&quot;&gt;Value&lt;/code&gt; aren’t very descriptive unless you’re used to them.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;5. Arrays and Collections&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;When you’re returning values of the same type or a variable number of items, an array or a collection like a List might be the way to go. For instance:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;public static int[] GetDataViaArray(int input)
{
    return new int[] { input * 2, input * 3 };
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Or, if you want to update an existing collection:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;code class=&quot;language-csharp&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;public static void GetDataViaCollectionReference(int input, int[] initialized)
{
    initialized[0] = input * 2;
    initialized[1] = input * 3;
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Pros:&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Flexible when dealing with a list of values.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Cons:&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;The meaning of each position in the array isn’t obvious unless you document it well.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;hr /&gt;&lt;h2&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Wrapping It Up&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Choosing the right approach depends on your specific needs.&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;strong&gt;Out parameters&lt;/strong&gt; and &lt;strong&gt;KeyValuePair&lt;/strong&gt; are great for quick, simple returns.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;strong&gt;Tuples&lt;/strong&gt; and &lt;strong&gt;custom classes/structs&lt;/strong&gt; shine when you need clarity and readability.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;strong&gt;Arrays and collections&lt;/strong&gt; are your go-to when dealing with multiple values of the same type or when the number of returned items can vary.&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;By understanding these methods, you can pick the one that fits your coding style and project needs best. Enjoy experimenting with these techniques and making your C# code cleaner and more efficient!&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;The complete source code is available &lt;a href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/Handling_MultiValue_Returns&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;















































&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Happy coding!&lt;/span&gt;&lt;/p&gt;</description><link>https://code.oneananda.com/2025/03/handling-multiple-value-returns-in-c.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-1610309445292859449</guid><pubDate>Mon, 30 Sep 2024 01:21:00 +0000</pubDate><atom:updated>2024-09-29T18:40:19.122-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Amazon Inspector</category><category domain="http://www.blogger.com/atom/ns#">AWS</category><title>Amazon Inspector</title><description>&lt;p&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;code style=&quot;border-radius: 6px; box-sizing: border-box; color: #1f2328; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Amazon Inspector&lt;/code&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;&quot; style=&quot;background-color: white; color: #1f2328;&quot;&gt;&amp;nbsp;is an automated security assessment tool focused on identifying vulnerabilities and scans security best practices in AWS.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span face=&quot;ui-monospace, SFMono-Regular, &amp;quot;SF Mono&amp;quot;, Menlo, Consolas, &amp;quot;Liberation Mono&amp;quot;, monospace&quot; style=&quot;font-size: medium; white-space-collapse: break-spaces;&quot;&gt;Amazon Inspector specifically works with EC2, Containers and Lamba (indirectly).&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Amazon Inspector&lt;/code&gt;&amp;nbsp;is like a security expert who regularly checks the cloud servers and container images for weak spots. If it finds any potential issues, like an old piece of software that hackers could exploit, it lets us know and guides us on how to fix it. It’s an automated security checkup that keeps the cloud environment safe and up to date.&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;In short,&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Amazon Inspector&lt;/code&gt;&amp;nbsp;helps to identify security risks in AWS servers and containers so that we can fix them quickly and keep the applications safe.&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Use Cases&lt;/span&gt;:&lt;/span&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Detecting security vulnerabilities in EC2 instances, such as unpatched software or network misconfigurations.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Assessing container images in ECR for potential security issues.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Continuous security monitoring in DevOps pipelines.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Amazon Inspector&lt;/span&gt;&amp;nbsp;works specifically with certain AWS services, focusing on assessing security vulnerabilities and compliance for workloads running in those services.&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Here’s a table of where&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Amazon Inspector&lt;/span&gt;&amp;nbsp;can and cannot operate in terms of AWS services:&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Summary of Supported and Unsupported Services:&lt;/span&gt;&lt;/h3&gt;&lt;div&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;a aria-label=&quot;Permalink: Amazon Inspector: Summary of Supported and Unsupported Services:&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/024%20Amazon%20Inspector#amazon-inspector-summary-of-supported-and-unsupported-services&quot; id=&quot;user-content-amazon-inspector-summary-of-supported-and-unsupported-services&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/span&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;markdown-accessiblity-table data-catalyst=&quot;&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; display: block; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;;&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border-spacing: 0px; display: block; margin-bottom: var(--base-size-16); margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;thead style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Service&lt;/span&gt;&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Amazon Inspector Support&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Amazon EC2&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;✔️ Supported&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Amazon ECR&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;✔️ Supported&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Amazon Lambda (container-based)**&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Limited (via ECR image scanning)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Amazon S3&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;❌ Not Supported&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Amazon RDS&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;❌ Not Supported&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Amazon DynamoDB&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;❌ Not Supported&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Amazon IAM&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;❌ Not Supported&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Amazon SQS/SNS&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;❌ Not Supported&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;AWS Networking (VPC, Route 53)&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;❌ Not Supported&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Amazon CloudFront, API Gateway&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;❌ Not Supported&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/markdown-accessiblity-table&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Amazon Inspector&lt;/span&gt;&amp;nbsp;focuses on&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Amazon EC2&lt;/span&gt;&amp;nbsp;instances and&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Amazon ECR&lt;/span&gt;&amp;nbsp;for container image security. For other AWS services like databases, storage, and identity management, you will need to use complementary AWS security services such as&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Amazon Macie&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;AWS Security Hub&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;AWS IAM Access Analyzer&lt;/span&gt;, and others to cover those areas.&lt;/span&gt;&lt;/p&gt;</description><link>https://code.oneananda.com/2024/09/amazon-inspector.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-965557767319234580</guid><pubDate>Mon, 23 Sep 2024 15:02:00 +0000</pubDate><atom:updated>2024-09-23T08:02:27.801-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">AWS</category><category domain="http://www.blogger.com/atom/ns#">DynamoDB</category><title>Hot Partition in DynamoDB</title><description>&lt;p&gt;&amp;nbsp;&lt;span style=&quot;background-color: white; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px;&quot;&gt;A&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border-radius: 6px; box-sizing: border-box; color: #1f2328; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;hot partition in DynamoDB&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px;&quot;&gt;occurs when one or more partitions receive a disproportionately high amount of traffic, while other partitions remain underutilized. This imbalance can happen if the partition key used to distribute data doesn&#39;t have enough distinct values, leading to concentrated read or write activity on a small subset of partitions.&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Let’s consider a real-world example to explain&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;hot partitions&lt;/span&gt;&amp;nbsp;in DynamoDB and how to avoid them.&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Scenario:&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Scenario:&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/blob/main/Learning/017%20Amazon%20DynamoDB/Hot%20Partition%20in%20DynamoDB.md#scenario&quot; id=&quot;user-content-scenario&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;You are building an online shopping website, and you want to store customer orders in a DynamoDB table. Let’s say you define the table with the following schema:&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Partition key&lt;/span&gt;:&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;CustomerID&lt;/code&gt;&amp;nbsp;(The unique ID of the customer)&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Sort key&lt;/span&gt;:&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;OrderID&lt;/code&gt;&amp;nbsp;(The unique ID of the order placed by the customer)&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Problem:&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Problem:&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/blob/main/Learning/017%20Amazon%20DynamoDB/Hot%20Partition%20in%20DynamoDB.md#problem&quot; id=&quot;user-content-problem&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;If you have a small number of high-volume customers (e.g., big corporate clients placing hundreds of orders daily) and many low-volume customers, you will have a&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;hot partition&lt;/span&gt;&amp;nbsp;problem. For example:&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Customer A&lt;/span&gt;&amp;nbsp;might place 500 orders every day.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Customer B&lt;/span&gt;&amp;nbsp;might place 10 orders every day.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Other customers might place only a few orders every month.&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;In this case, DynamoDB will assign all the orders for each customer (based on&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;CustomerID&lt;/code&gt;) to the same partition, resulting in&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;high traffic on the partition for Customer A&lt;/span&gt;. This could overload that specific partition and cause performance issues, like throttling and delayed responses. Meanwhile, the partitions for low-traffic customers remain underutilized.&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;How to Avoid Hot Partitions:&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: How to Avoid Hot Partitions:&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/blob/main/Learning/017%20Amazon%20DynamoDB/Hot%20Partition%20in%20DynamoDB.md#how-to-avoid-hot-partitions&quot; id=&quot;user-content-how-to-avoid-hot-partitions&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ol dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: var(--base-size-16);&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;High Cardinality Partition Key&lt;/span&gt;: Instead of just using&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;CustomerID&lt;/code&gt;&amp;nbsp;as the partition key, you can include an additional high-cardinality attribute, like&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;OrderDate&lt;/code&gt;&amp;nbsp;or&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;OrderMonth&lt;/code&gt;. This spreads the data across more partitions.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: var(--base-size-16);&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;New Partition Key&lt;/span&gt;: Combine&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;CustomerID&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;OrderDate&lt;/code&gt;.&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Partition key:&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;CustomerID#OrderDate&lt;/code&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Sort key:&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;OrderID&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: var(--base-size-16);&quot;&gt;Now, each day&#39;s orders for a given customer are spread across different partitions, avoiding hotspots for high-traffic customers.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: var(--base-size-16);&quot;&gt;Example of partition key values:&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;CustomerA#2024-09-21&lt;/code&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;CustomerA#2024-09-22&lt;/code&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;CustomerB#2024-09-21&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: var(--base-size-16);&quot;&gt;This ensures that the system doesn&#39;t overload a single partition based on customer activity alone.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: var(--base-size-16);&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Write Sharding&lt;/span&gt;: If the&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;CustomerID&lt;/code&gt;&amp;nbsp;is required to be the sole partition key, another approach is&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;write sharding&lt;/span&gt;. In this case, you modify the partition key by adding a random suffix.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: var(--base-size-16);&quot;&gt;For instance, you could add a random number between 1 and 10 to the&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;CustomerID&lt;/code&gt;&amp;nbsp;to create multiple shards:&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: var(--base-size-16);&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;New Partition Key&lt;/span&gt;:&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;CustomerID + RandomNumber&lt;/code&gt;&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Partition key:&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;CustomerID#Shard1&lt;/code&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Sort key:&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;OrderID&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: var(--base-size-16);&quot;&gt;Example:&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;For&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;CustomerA&lt;/code&gt;, generate keys like&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;CustomerA#1&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;CustomerA#2&lt;/code&gt;, etc.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Orders will be distributed randomly across different shards, reducing the risk of hot partitions.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Summary:&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Summary:&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/blob/main/Learning/017%20Amazon%20DynamoDB/Hot%20Partition%20in%20DynamoDB.md#summary&quot; id=&quot;user-content-summary&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 0px !important; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;In the&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;original setup&lt;/span&gt;,&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;CustomerID&lt;/code&gt;&amp;nbsp;as the partition key can lead to hot partitions because high-traffic customers cause excessive load on certain partitions.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;By&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;adding high-cardinality attributes&lt;/span&gt;&amp;nbsp;or using&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;write sharding&lt;/span&gt;, you can distribute the workload evenly across DynamoDB partitions, avoiding hot partitions and improving performance.&lt;/li&gt;&lt;/ul&gt;</description><link>https://code.oneananda.com/2024/09/hot-partition-in-dynamodb.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-6584223899918402323</guid><pubDate>Tue, 17 Sep 2024 07:29:00 +0000</pubDate><atom:updated>2024-09-17T00:29:06.241-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">AWS</category><category domain="http://www.blogger.com/atom/ns#">AWS Learning</category><category domain="http://www.blogger.com/atom/ns#">DDoS Protection</category><title>AWS DDoS Protection Services</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-top: 0px !important; position: relative;&quot;&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px !important; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;AWS DDoS Protection Services&lt;/h1&gt;&lt;a aria-label=&quot;Permalink: AWS DDoS Protection Services&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/blob/main/Learning/AWS%20General%20Concepts/AWS%20DDoS%20Protection%20Services.md#aws-ddos-protection-services&quot; id=&quot;user-content-aws-ddos-protection-services&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 25.162px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Overview of AWS services that actively protect against SYN Flood attacks or divert requests to mitigate the impact of such attacks.&lt;/p&gt;&lt;markdown-accessiblity-table data-catalyst=&quot;&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; display: block; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px;&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border-spacing: 0px; display: block; margin-bottom: var(--base-size-16); margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;thead style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;AWS Service&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;Protection Type&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;Active Protection&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;Divert Requests&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;Monitoring and Alerts&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;AWS Shield Standard&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Automatic protection against common DDoS attacks, including SYN Floods&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Yes&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;No&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;No&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;AWS Shield Advanced&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Enhanced DDoS protection with detailed diagnostics and access to DRT&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Yes&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;No&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Yes&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;AWS WAF&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Custom rules for blocking or rate-limiting traffic, primarily focused on Layer 7&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Partial (primarily Layer 7)&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;No&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Yes&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Elastic Load Balancing (ELB)&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Distributes traffic across multiple targets to absorb impact&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Yes&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;No&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Limited&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;AWS Global Accelerator&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Diverts traffic through AWS global network for improved availability and performance&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Yes&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Yes&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Yes&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Amazon CloudFront&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Caches content at edge locations and filters malicious requests&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Yes&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Yes&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Yes&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;VPC Security Groups&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Blocks suspicious traffic at the VPC level&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Partial&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;No&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;No&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Network ACLs&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Adds an additional layer of protection by filtering traffic&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Partial&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;No&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;No&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;AWS Firewall Manager&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Centrally manages firewall rules across AWS services for consistent protection&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Yes&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;No&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Yes&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;AWS Route 53&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Scalable DNS with built-in DDoS protection that diverts traffic&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Yes&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Yes&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Limited&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/markdown-accessiblity-table&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Key Points&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Key Points&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/blob/main/Learning/AWS%20General%20Concepts/AWS%20DDoS%20Protection%20Services.md#key-points&quot; id=&quot;user-content-key-points&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9699px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 0px !important; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Active Protection&lt;/span&gt;: Services that provide proactive measures to block or mitigate SYN Flood attacks.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Divert Requests&lt;/span&gt;: Services that can divert or route traffic to reduce the impact of attacks on your resources.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Monitoring and Alerts&lt;/span&gt;: Indicates whether the service offers monitoring and alert capabilities to track potential threats and respond accordingly.&lt;/li&gt;&lt;/ul&gt;</description><link>https://code.oneananda.com/2024/09/aws-ddos-protection-services.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-3455425080156110538</guid><pubDate>Sat, 14 Sep 2024 18:19:00 +0000</pubDate><atom:updated>2024-09-14T11:22:34.406-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Application Security</category><category domain="http://www.blogger.com/atom/ns#">Cloud Security</category><title>SYN Flood Attack</title><description>&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-top: 0px; position: relative;&quot;&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;SYN Flood Attack&lt;/h1&gt;&lt;a aria-label=&quot;Permalink: SYN Flood Attack&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/Software-Architecture-Best-Practices/blob/main/Security-Best%20Practices/SYN%20flood.md#syn-flood-attack&quot; id=&quot;user-content-syn-flood-attack&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 25.162px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;A SYN flood is a type of Denial of Service (DoS) attack that targets the handshake process of the TCP/IP protocol used for establishing a connection between a client and a server.&amp;nbsp;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;i&gt;A SYN flood attack is like someone repeatedly knocking on your door without any intention of entering, just to keep you busy and prevent you from attending to real visitors.&lt;/i&gt;&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;How SYN Flood Attacks Work&lt;/h3&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a aria-label=&quot;Permalink: How SYN Flood Attacks Work&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/Software-Architecture-Best-Practices/blob/main/Security-Best%20Practices/SYN%20flood.md#how-syn-flood-attacks-work&quot; id=&quot;user-content-how-syn-flood-attacks-work&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ol dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: var(--base-size-16);&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Normal TCP Handshake:&lt;/span&gt;&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Normally, when two computers want to talk to each other over the internet, they perform a &quot;handshake,&quot; like a polite greeting:&lt;ol dir=&quot;auto&quot; style=&quot;box-sizing: border-box; list-style-type: lower-alpha; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Step 1:&lt;/span&gt;&amp;nbsp;The client sends a “Hello” (SYN packet) to the server.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Step 2:&lt;/span&gt;&amp;nbsp;The server responds with a “Hello back” (SYN-ACK packet).&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Step 3:&lt;/span&gt;&amp;nbsp;The client replies with an “Okay, let’s talk” (ACK packet), and the connection is established.&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: var(--base-size-16);&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;SYN Flood:&lt;/span&gt;&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;In a SYN flood, the attacker sends a lot of those initial “Hello” messages (SYN packets) but never replies to the server’s “Hello back” (SYN-ACK).&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;The server keeps waiting for the final “Okay, let’s talk” (ACK) that never comes. It has to keep resources reserved for these half-open connections, which ends up using a lot of its capacity.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: var(--base-size-16);&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Why It’s a Problem:&lt;/span&gt;&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Wasted Resources:&lt;/span&gt;&amp;nbsp;(Resource Exhaustion) The server gets bogged down with all these unfinished handshakes, using up memory and processing power.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Unavailable Service:&lt;/span&gt;&amp;nbsp;(Service Unavailability) Legitimate users who actually want to connect can’t get through because the server is too busy dealing with the fake requests.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;How to Protect Against SYN Floods&lt;/h3&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a aria-label=&quot;Permalink: How to Protect Against SYN Floods&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/Software-Architecture-Best-Practices/blob/main/Security-Best%20Practices/SYN%20flood.md#how-to-protect-against-syn-floods&quot; id=&quot;user-content-how-to-protect-against-syn-floods&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ol dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: var(--base-size-16);&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;SYN Cookies:&lt;/span&gt;&amp;nbsp;Imagine checking the sincerity of every “Hello” before reserving time for a full conversation. This prevents your resources from being held hostage by fake handshakes.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: var(--base-size-16);&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Rate Limiting:&lt;/span&gt;&amp;nbsp;This is like setting a rule that says, “Only a certain number of ‘Hellos’ per minute,” so you don’t get overwhelmed.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: var(--base-size-16);&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Firewalls and IPS:&lt;/span&gt;&amp;nbsp;Think of these as security guards who can spot the fake handshakes and block them at the door.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: var(--base-size-16);&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Timeout Reduction:&lt;/span&gt;&amp;nbsp;If a handshake doesn’t complete quickly, drop it and move on. It’s like hanging up on a prank call faster.&lt;/p&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: var(--base-size-16);&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Load Balancing and Redundancy:&lt;/span&gt;&amp;nbsp;Spread out the connections across multiple servers or have backups ready, so no single server gets overloaded.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 0px; margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 0px; margin-top: 0px;&quot;&gt;Knowing about SYN floods is crucial for designing robust systems that can withstand malicious attempts to disrupt service availability.&lt;/p&gt;</description><link>https://code.oneananda.com/2024/09/syn-flood-attack.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-603566776605316902</guid><pubDate>Sat, 14 Sep 2024 17:34:00 +0000</pubDate><atom:updated>2024-09-14T10:46:30.718-07:00</atom:updated><title>AWS Security Services Overview - Exam twisting questions </title><description>&lt;style&gt;
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
            padding: 0;
            color: #333;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 20px;
        }
        th, td {
            padding: 10px;
            text-align: left;
            border: 1px solid #ddd;
        }
        th {
            background-color: #f4f4f4;
        }
        tr:nth-child(even) {
            background-color: #f9f9f9;
        }
        tr:hover {
            background-color: #f1f1f1;
        }
        .container {
            max-width: 1200px;
            margin: auto;
            overflow-x: auto;
        }
        h1 {
            text-align: center;
            color: #0066cc;
        }
        .responsive-table {
            display: block;
            overflow-x: auto;
            white-space: nowrap;
        }
    &lt;/style&gt;    
&lt;div class=&quot;container&quot;&gt;
        &lt;h1&gt;AWS Security Services Overview&lt;/h1&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span style=&quot;background: white; color: #333333; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; line-height: 107%;&quot;&gt;Scroll
horizontal for see the &lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;background: white; color: red; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; line-height: 107%;&quot;&gt;Limitations&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;background: white; color: #333333; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; line-height: 107%;&quot;&gt;, &lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;background: white; color: #4472c4; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; line-height: 107%; mso-themecolor: accent1;&quot;&gt;Exam Question Twists&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;background: white; color: #333333; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; line-height: 107%;&quot;&gt;, &lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;background: white; color: #70ad47; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; line-height: 107%; mso-themecolor: accent6;&quot;&gt;Cost-Effectiveness&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;background: white; color: #333333; font-family: &amp;quot;Arial&amp;quot;,sans-serif; font-size: 10.5pt; line-height: 107%;&quot;&gt;, &lt;span style=&quot;background: yellow; mso-highlight: yellow;&quot;&gt;Ease of Integration&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;
        &lt;div class=&quot;responsive-table&quot;&gt;
            &lt;table&gt;
                &lt;thead&gt;
                    &lt;tr&gt;
                        &lt;th&gt;Service&lt;/th&gt;
                        &lt;th&gt;Capabilities&lt;/th&gt;
                        &lt;th&gt;Limitations&lt;/th&gt;
                        &lt;th&gt;Exam Question Twists&lt;/th&gt;
                        &lt;th&gt;Cost-Effectiveness&lt;/th&gt;
                        &lt;th&gt;Ease of Integration&lt;/th&gt;
                    &lt;/tr&gt;
                &lt;/thead&gt;
                &lt;tbody&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS WAF (Web Application Firewall)&lt;/td&gt;
                        &lt;td&gt;Protects web applications from common attacks like SQL injection and XSS.&lt;/td&gt;
                        &lt;td&gt;Only protects application layer; not effective for non-web or network-layer attacks.&lt;/td&gt;
                        &lt;td&gt;Questions may ask about its use for network-level attacks, which it doesn&#39;t handle.&lt;/td&gt;
                        &lt;td&gt;Moderate cost based on usage; costs can increase with traffic and rules.&lt;/td&gt;
                        &lt;td&gt;Integrates easily with CloudFront, ALB, API Gateway; complex with custom rules.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS Shield&lt;/td&gt;
                        &lt;td&gt;Provides DDoS protection; Advanced tier offers enhanced response and support.&lt;/td&gt;
                        &lt;td&gt;Does not protect against application-layer attacks; focuses on DDoS mitigation.&lt;/td&gt;
                        &lt;td&gt;Scenarios may confuse Shield Standard and Advanced benefits or suggest protection at the application layer.&lt;/td&gt;
                        &lt;td&gt;Standard is free; Advanced has a subscription fee.&lt;/td&gt;
                        &lt;td&gt;Easy integration for Standard; Advanced setup requires AWS Support involvement.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS IAM (Identity and Access Management)&lt;/td&gt;
                        &lt;td&gt;Controls access to AWS services with fine-grained permissions.&lt;/td&gt;
                        &lt;td&gt;Does not handle external identity federation; careful setup needed to avoid overly permissive access.&lt;/td&gt;
                        &lt;td&gt;Twists could involve complex policy setups, roles vs. groups, or permission boundaries.&lt;/td&gt;
                        &lt;td&gt;Free but time-intensive to manage policies; misconfigurations can lead to security risks.&lt;/td&gt;
                        &lt;td&gt;Integrated with AWS; complex in environments with many policies/roles.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS KMS (Key Management Service)&lt;/td&gt;
                        &lt;td&gt;Manages and controls encryption keys with AWS service integration.&lt;/td&gt;
                        &lt;td&gt;Not as secure as hardware-based solutions; limited for some compliance needs.&lt;/td&gt;
                        &lt;td&gt;Questions might twist with comparisons to CloudHSM or scenarios needing key rotation and cross-region management.&lt;/td&gt;
                        &lt;td&gt;Cost-effective per key use; scales with usage but can be costly.&lt;/td&gt;
                        &lt;td&gt;Seamless integration with AWS; more effort needed for hybrid environments.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS Secrets Manager&lt;/td&gt;
                        &lt;td&gt;Manages secrets like API keys and rotates them automatically.&lt;/td&gt;
                        &lt;td&gt;Does not protect other sensitive data directly; must be used alongside other security tools.&lt;/td&gt;
                        &lt;td&gt;May ask to choose between Secrets Manager and Parameter Store or involve scenarios with automated rotations.&lt;/td&gt;
                        &lt;td&gt;Higher cost than Parameter Store; charges per secret and API call.&lt;/td&gt;
                        &lt;td&gt;Easy integration with AWS; external integrations may need extra setup.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS CloudHSM&lt;/td&gt;
                        &lt;td&gt;Provides dedicated hardware for key management with high compliance.&lt;/td&gt;
                        &lt;td&gt;High setup complexity and cost; manual integration needed for many AWS services.&lt;/td&gt;
                        &lt;td&gt;Scenarios may test knowledge of high compliance needs or mislead on cost and integration ease compared to KMS.&lt;/td&gt;
                        &lt;td&gt;Costly; charged per HSM instance.&lt;/td&gt;
                        &lt;td&gt;Complex integration; best for specialized, high-compliance requirements.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;Amazon GuardDuty&lt;/td&gt;
                        &lt;td&gt;Monitors AWS environments for malicious activity and unauthorized behavior.&lt;/td&gt;
                        &lt;td&gt;Detects threats but does not block or respond automatically.&lt;/td&gt;
                        &lt;td&gt;Questions may twist by suggesting GuardDuty provides active blocking; understand it only detects and alerts.&lt;/td&gt;
                        &lt;td&gt;Cost scales with the volume of data processed; pay-per-use model.&lt;/td&gt;
                        &lt;td&gt;Easy AWS integration; outputs can feed into AWS Security Hub or third-party tools.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS Config&lt;/td&gt;
                        &lt;td&gt;Monitors AWS resource configurations for compliance and security.&lt;/td&gt;
                        &lt;td&gt;Does not automatically fix non-compliance; requires manual intervention or automation.&lt;/td&gt;
                        &lt;td&gt;Twists may suggest auto-remediation capabilities, which Config doesn&#39;t provide directly.&lt;/td&gt;
                        &lt;td&gt;Costs depend on rule evaluations; high-frequency evaluations can be expensive.&lt;/td&gt;
                        &lt;td&gt;Good integration with AWS; remediation needs additional tools like Lambda.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS Artifact&lt;/td&gt;
                        &lt;td&gt;Provides access to AWS compliance documents and security reports.&lt;/td&gt;
                        &lt;td&gt;Does not enforce compliance; informational use only.&lt;/td&gt;
                        &lt;td&gt;Questions might imply Artifact offers active compliance checks; focus on its documentation role.&lt;/td&gt;
                        &lt;td&gt;Free service.&lt;/td&gt;
                        &lt;td&gt;Simple to access; no integration needed.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS Inspector&lt;/td&gt;
                        &lt;td&gt;Assesses EC2 instances for vulnerabilities and compliance issues.&lt;/td&gt;
                        &lt;td&gt;Limited to specific instance types and OS; does not cover containers or serverless directly.&lt;/td&gt;
                        &lt;td&gt;Scenarios may mislead by suggesting broader coverage; focus on its scope for EC2.&lt;/td&gt;
                        &lt;td&gt;Charged per assessment; costs add up with frequent scans.&lt;/td&gt;
                        &lt;td&gt;Easy with EC2; lacks direct support for containers/serverless.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS Certificate Manager (ACM)&lt;/td&gt;
                        &lt;td&gt;Manages SSL/TLS certificates for AWS services.&lt;/td&gt;
                        &lt;td&gt;Limited to AWS environments; cannot manage external service certificates directly.&lt;/td&gt;
                        &lt;td&gt;Exam might suggest capabilities beyond AWS; know ACM&#39;s scope within AWS.&lt;/td&gt;
                        &lt;td&gt;Free for public certificates; private certificates have additional costs.&lt;/td&gt;
                        &lt;td&gt;Seamless with AWS services; limited external integration.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS Directory Service&lt;/td&gt;
                        &lt;td&gt;Manages Microsoft Active Directory within AWS.&lt;/td&gt;
                        &lt;td&gt;Limited to AD; doesn&#39;t support other identity systems like LDAP or Okta directly.&lt;/td&gt;
                        &lt;td&gt;Questions may involve unsupported systems; focus on its AD-specific role.&lt;/td&gt;
                        &lt;td&gt;Varies by directory type; enterprise setups can be costly.&lt;/td&gt;
                        &lt;td&gt;Good with AWS; hybrid configurations add complexity.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS Firewall Manager&lt;/td&gt;
                        &lt;td&gt;Centralizes firewall rule management across multiple AWS accounts.&lt;/td&gt;
                        &lt;td&gt;Limited to AWS services it integrates with; cannot manage third-party firewalls.&lt;/td&gt;
                        &lt;td&gt;Exam may twist by implying broader management scope; focus on its AWS-specific integrations.&lt;/td&gt;
                        &lt;td&gt;Costs add on top of WAF/Shield; can get expensive at scale.&lt;/td&gt;
                        &lt;td&gt;Easy within AWS; cannot manage non-AWS firewalls.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS Macie&lt;/td&gt;
                        &lt;td&gt;Uses ML to identify and protect sensitive data in AWS.&lt;/td&gt;
                        &lt;td&gt;Limited to AWS data; doesn&#39;t extend to on-premises or other clouds.&lt;/td&gt;
                        &lt;td&gt;Questions might suggest it works beyond S3; focus on S3 and PII detection.&lt;/td&gt;
                        &lt;td&gt;Pay-per-GB; costs rise with large data sets.&lt;/td&gt;
                        &lt;td&gt;Simple with S3; lacks broad integration for other sources.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS CloudTrail&lt;/td&gt;
                        &lt;td&gt;Tracks user activity and API usage for auditing and governance.&lt;/td&gt;
                        &lt;td&gt;Does not prevent unauthorized access; logs must be monitored separately.&lt;/td&gt;
                        &lt;td&gt;Scenarios may confuse logging with real-time monitoring; CloudTrail is audit-focused.&lt;/td&gt;
                        &lt;td&gt;Free for management events; other logs have costs.&lt;/td&gt;
                        &lt;td&gt;Native to AWS; integrates well with other analysis tools.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;Amazon Detective&lt;/td&gt;
                        &lt;td&gt;Analyzes AWS logs and data to identify security issues.&lt;/td&gt;
                        &lt;td&gt;Investigative only; doesn&#39;t prevent or respond to incidents.&lt;/td&gt;
                        &lt;td&gt;Twists might suggest mitigation capabilities; focus on analysis role.&lt;/td&gt;
                        &lt;td&gt;Pay-per-use; costs scale with data volume.&lt;/td&gt;
                        &lt;td&gt;Integrates well with GuardDuty and Security Hub; external logs need setup.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS Security Hub&lt;/td&gt;
                        &lt;td&gt;Aggregates security alerts and compliance statuses across AWS.&lt;/td&gt;
                        &lt;td&gt;Does not provide remediation; serves as a dashboard for alerts.&lt;/td&gt;
                        &lt;td&gt;Questions may imply automatic fixes; know it aggregates alerts and integrates for overview.&lt;/td&gt;
                        &lt;td&gt;Pay-per-finding; costs rise with more alerts and integrations.&lt;/td&gt;
                        &lt;td&gt;Easy with AWS; setup needed for third-party tools.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS Network Firewall&lt;/td&gt;
                        &lt;td&gt;Manages network security with firewall rules and intrusion prevention.&lt;/td&gt;
                        &lt;td&gt;Limited to AWS VPCs; no support for on-premises or hybrid setups.&lt;/td&gt;
                        &lt;td&gt;Questions may suggest broader use; focus on its VPC-specific role.&lt;/td&gt;
                        &lt;td&gt;Costs depend on traffic processed; can be high with heavy use.&lt;/td&gt;
                        &lt;td&gt;Easy within VPCs; lacks support for external environments.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS SSO (Single Sign-On)&lt;/td&gt;
                        &lt;td&gt;Provides centralized access and SSO for AWS accounts and integrated apps.&lt;/td&gt;
                        &lt;td&gt;Limited to supported AWS services and apps; not universal for all third-party apps.&lt;/td&gt;
                        &lt;td&gt;Twists might suggest it replaces IAM; know its scope within AWS and supported apps.&lt;/td&gt;
                        &lt;td&gt;Free for AWS apps; custom integrations may incur costs.&lt;/td&gt;
                        &lt;td&gt;Easy for AWS; needs SAML or other configurations for third-party.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS Systems Manager Parameter Store&lt;/td&gt;
                        &lt;td&gt;Securely stores configuration data and secrets, using AWS KMS encryption.&lt;/td&gt;
                        &lt;td&gt;Basic storage without advanced secret management features like auto-rotation.&lt;/td&gt;
                        &lt;td&gt;Questions may confuse it with Secrets Manager; differentiate by its simpler storage role.&lt;/td&gt;
                        &lt;td&gt;Free for basic parameters; advanced parameters have costs.&lt;/td&gt;
                        &lt;td&gt;Simple with AWS; not as robust for secret management as Secrets Manager.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS Detective&lt;/td&gt;
                        &lt;td&gt;Provides insights into potential security issues using ML and analysis.&lt;/td&gt;
                        &lt;td&gt;Detection only; no active threat mitigation or response.&lt;/td&gt;
                        &lt;td&gt;Twists may involve scenarios suggesting active responses; focus on its analytical role.&lt;/td&gt;
                        &lt;td&gt;Pay-per-use; scales with data complexity.&lt;/td&gt;
                        &lt;td&gt;Integrates easily with Security Hub, GuardDuty; limited for non-AWS sources.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS Access Analyzer&lt;/td&gt;
                        &lt;td&gt;Analyzes and identifies resources shared with external entities.&lt;/td&gt;
                        &lt;td&gt;Only recommends changes; doesn&#39;t enforce access restrictions automatically.&lt;/td&gt;
                        &lt;td&gt;Scenarios may twist by suggesting auto-enforcement; focus on its advisory role.&lt;/td&gt;
                        &lt;td&gt;Free service.&lt;/td&gt;
                        &lt;td&gt;Easy within AWS IAM; limited to AWS environments.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS Service Catalog&lt;/td&gt;
                        &lt;td&gt;Manages approved IT services for compliance and policy adherence.&lt;/td&gt;
                        &lt;td&gt;Doesn&#39;t monitor ongoing compliance; limited to service catalog management.&lt;/td&gt;
                        &lt;td&gt;Questions may mislead by suggesting it handles active compliance checks.&lt;/td&gt;
                        &lt;td&gt;Pay-per-use; cost varies by catalog size and usage.&lt;/td&gt;
                        &lt;td&gt;Good integration with AWS; governance setup can be complex.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS Organizations&lt;/td&gt;
                        &lt;td&gt;Centralized management of AWS accounts with security and compliance policies.&lt;/td&gt;
                        &lt;td&gt;Limited to AWS; can&#39;t manage non-AWS accounts.&lt;/td&gt;
                        &lt;td&gt;Exam scenarios might suggest cross-cloud management; focus on AWS-specific policies and account structures.&lt;/td&gt;
                        &lt;td&gt;Free; some paid features like advanced policies and consolidated billing.&lt;/td&gt;
                        &lt;td&gt;Easy within AWS; lacks support for non-AWS environments.&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;AWS Resource Access Manager (RAM)&lt;/td&gt;
                        &lt;td&gt;Simplifies sharing AWS resources across accounts without shared credentials.&lt;/td&gt;
                        &lt;td&gt;Limited to sharing; doesn&#39;t manage detailed permissions beyond AWS resources.&lt;/td&gt;
                        &lt;td&gt;Questions may twist by implying it handles detailed permissions; focus on its sharing capabilities.&lt;/td&gt;
                        &lt;td&gt;Free for most sharing scenarios.&lt;/td&gt;
                        &lt;td&gt;Easy within AWS; limited to AWS resources.&lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/tbody&gt;
            &lt;/table&gt;
        &lt;/div&gt;
    &lt;/div&gt;

</description><link>https://code.oneananda.com/2024/09/aws-security-services-overview.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-1031217747353483025</guid><pubDate>Thu, 12 Sep 2024 13:13:00 +0000</pubDate><atom:updated>2024-09-12T06:13:15.500-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">AWS Learning</category><category domain="http://www.blogger.com/atom/ns#">AWS NAT Gateway</category><category domain="http://www.blogger.com/atom/ns#">AWS NAT Instance</category><title>AWS NAT Gateway vs. AWS NAT Instance</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-top: 0px !important; position: relative;&quot;&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px !important; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;AWS NAT Gateway vs. AWS NAT Instance&lt;/h1&gt;&lt;a aria-label=&quot;Permalink: AWS NAT Gateway vs. AWS NAT Instance&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/blob/main/Learning/005%20AWS%20Network%20Address%20Translation%20(NAT)/NAT%20Gateway%20vs%20NAT%20Instance.md#aws-nat-gateway-vs-aws-nat-instance&quot; id=&quot;user-content-aws-nat-gateway-vs-aws-nat-instance&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 25.162px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;markdown-accessiblity-table data-catalyst=&quot;&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; display: block; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 0px !important;&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border-spacing: 0px; display: block; margin-bottom: var(--base-size-16); margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;thead style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;Feature&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;NAT Gateway&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;NAT Instance&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Management&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Fully managed by AWS; no maintenance needed.&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;User-managed; requires manual setup and updates.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Scalability&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Automatically scales up to handle high traffic (up to 45 Gbps).&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Manual scaling; limited by EC2 instance type.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;High Availability&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Highly available within an Availability Zone; can be set up in multiple AZs for redundancy.&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Can be made highly available, but requires custom setup (e.g., Auto Scaling).&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Performance&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Consistent and high performance for most workloads.&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Performance depends on the chosen instance type; can vary.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Security&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Does not allow inbound connections from the internet; only outbound.&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Customizable security with security groups; can control inbound rules.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Setup and Ease of Use&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Easy to set up with minimal configuration; integrates well with VPC.&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;More complex setup with configuration of EC2 instances and routing.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Cost&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Charged per hour and per GB of data processed; generally more expensive for high usage.&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Costs include EC2 instance charges, EBS, and data transfer; can be cheaper for low traffic.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Static IP&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Automatically gets a public IP; can associate an Elastic IP for a fixed address.&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Can be assigned an Elastic IP or use a public IP of the instance.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Monitoring&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Integrated with CloudWatch for easy monitoring of metrics like data transfer and connections.&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Requires manual setup for monitoring and logging.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Use Case&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Best for those who want a &quot;set it and forget it&quot; solution with minimal overhead.&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Ideal for custom setups, lower cost scenarios, or when specific configurations are needed.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/markdown-accessiblity-table&gt;</description><link>https://code.oneananda.com/2024/09/aws-nat-gateway-vs-aws-nat-instance.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-3240803455213787791</guid><pubDate>Sat, 07 Sep 2024 15:36:00 +0000</pubDate><atom:updated>2024-09-08T07:13:03.315-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Interface-Driven Development - IDD</category><title>Interface-Driven Development - IDD - Deep Dive</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-top: 0px !important; position: relative;&quot;&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px !important; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Interface-Driven Development - IDD&lt;/h1&gt;&lt;a aria-label=&quot;Permalink: Interface-Driven Development - IDD&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/Software-Architecture-Best-Practices/tree/main/Interface-Driven%20Development%20-%20IDD#interface-driven-development---idd&quot; id=&quot;user-content-interface-driven-development---idd&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 25.162px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h4 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: inherit; margin: 0px; padding: 0px 0.2em; white-space-collapse: break-spaces;&quot;&gt;Interface-Driven Development - IDD&lt;/code&gt;&amp;nbsp;is a Software development design approach that emphasis on using interfaces to define contracts or boundaries between different components of the system.&lt;/h4&gt;&lt;a aria-label=&quot;Permalink: Interface-Driven Development - IDD is a Software development design approach that emphasis on using interfaces to define contracts or boundaries between different components of the system.&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/Software-Architecture-Best-Practices/tree/main/Interface-Driven%20Development%20-%20IDD#interface-driven-development---idd-is-a-software-development-design-approach-that-emphasis-on-using-interfaces-to-define-contracts-or-boundaries-between-different-components-of-the-system&quot; id=&quot;user-content-interface-driven-development---idd-is-a-software-development-design-approach-that-emphasis-on-using-interfaces-to-define-contracts-or-boundaries-between-different-components-of-the-system&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 20.7292px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;The principle is, the components should interact each other using well defined interfaces which leads to&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Modularity&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Flexiblity&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Testablity&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Maintainablity&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Key Concepts&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Key Concepts&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/Software-Architecture-Best-Practices/tree/main/Interface-Driven%20Development%20-%20IDD#key-concepts&quot; id=&quot;user-content-key-concepts&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9699px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Interface as a contract&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Interface as a contract&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/Software-Architecture-Best-Practices/tree/main/Interface-Driven%20Development%20-%20IDD#interface-as-a-contract&quot; id=&quot;user-content-interface-as-a-contract&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;An interface defines a contract and the classes which implement those should comply with the same,&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;That means if an interface is having a method called&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Print()&lt;/code&gt;&amp;nbsp;in C# like this&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto !important; position: relative !important;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;public interface IPrint
{
	void Print();
}
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center !important; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex !important; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center !important; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px !important; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;public interface IPrint
{
	void Print();
}&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;The implementing class should comply with the contract that it is implementing the method&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Print()&lt;/code&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto !important; position: relative !important;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;public class Process : IPrint
{
	public void Print()
	{
		// Print logic
	}
}
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center !important; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex !important; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center !important; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px !important; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;public class Process : IPrint
{
	public void Print()
	{
		// Print logic
	}
}&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;But there is a catch here:&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;IPrint&lt;/code&gt;&amp;nbsp;is insisting the implementation should use the method&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Print()&lt;/code&gt;&amp;nbsp;but in reality there is no necessity to implement the printing functionality inside the&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Print()&lt;/code&gt;&amp;nbsp;function, we can choose to write any other logic inside the&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Print()&lt;/code&gt;, the interface has no control over this.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;The&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Print()&lt;/code&gt;&amp;nbsp;method in the Process class could include logic to print something to the console, save a file, or even do nothing at all. The implementation inside the&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Print()&lt;/code&gt;&amp;nbsp;method is up to the developer.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;This means that while the interface guarantees that the method&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Print()&lt;/code&gt;&amp;nbsp;is available in the Process class, it doesn&#39;t ensure that the method performs any specific action related to printing. The method could theoretically do something entirely unrelated, like calculating a sum or logging data.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;em style=&quot;box-sizing: border-box;&quot;&gt;The interface only ensures the method signature (i.e., the name, return type, and parameters) but has no control over the actual code inside the method.&lt;/em&gt;&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Decoupling&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Decoupling&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/Software-Architecture-Best-Practices/tree/main/Interface-Driven%20Development%20-%20IDD#decoupling&quot; id=&quot;user-content-decoupling&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;IDD encourages decoupling between components, Since components interact through interfaces, they don’t need to know about each other&#39;s concrete implementations. This reduces dependencies and allows for easier changes and maintenance.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;But there is a catch here too&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Using decoupling may lead to&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Over-Decoupling&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Over-decoupling&lt;/code&gt;&amp;nbsp;can lead to a situation where the system becomes excessively fragmented. This means introducing too many layers or abstractions between components can make the system harder to understand and navigate. It can also introduce unnecessary complexity without significant benefits.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Scenario:&lt;/span&gt;&amp;nbsp;Suppose you have a simple application that reads and writes user data to a database. To achieve maximum decoupling, you create separate classes and interfaces for every tiny aspect of the application: one class for data access, one for validation, one for transformation, and so on.&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto !important; position: relative !important;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;public interface IUserDataAccess
{
    void SaveUser(User user);
}

public class UserDataAccess : IUserDataAccess
{
    public void SaveUser(User user) { /* Save logic */ }
}

public interface IUserValidator
{
    bool Validate(User user);
}

public class UserValidator : IUserValidator
{
    public bool Validate(User user) { /* Validation logic */ }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center !important; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex !important; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center !important; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px !important; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;public interface IUserDataAccess
{
    void SaveUser(User user);
}

public class UserDataAccess : IUserDataAccess
{
    public void SaveUser(User user) { /* Save logic */ }
}

public interface IUserValidator
{
    bool Validate(User user);
}

public class UserValidator : IUserValidator
{
    public bool Validate(User user) { /* Validation logic */ }
}&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;em style=&quot;box-sizing: border-box;&quot;&gt;Problem: Managing and understanding the interactions between these highly decoupled components can become cumbersome, especially for a small application where simpler designs might be more appropriate.&lt;/em&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;em style=&quot;box-sizing: border-box;&quot;&gt;&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Interface Proliferation&lt;/h3&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a aria-label=&quot;Permalink: Interface Proliferation&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/Software-Architecture-Best-Practices/tree/main/Interface-Driven%20Development%20-%20IDD#interface-proliferation&quot; id=&quot;user-content-interface-proliferation&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Overusing interfaces can lead to a proliferation of small, fine-grained interfaces. This can make the system harder to manage and understand, and it may lead to a situation where you have many interfaces with single methods or tightly focused responsibilities.&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Difficulty in Testing&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Difficulty in Testing&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/Software-Architecture-Best-Practices/tree/main/Interface-Driven%20Development%20-%20IDD#difficulty-in-testing&quot; id=&quot;user-content-difficulty-in-testing&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;While interfaces make mocking easier, they can also complicate testing if not used properly. For example, a test might need to deal with multiple interfaces and their implementations, increasing the setup complexity for unit tests.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Loss of Cohesion&lt;/h3&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a aria-label=&quot;Permalink: Loss of Cohesion&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/Software-Architecture-Best-Practices/tree/main/Interface-Driven%20Development%20-%20IDD#loss-of-cohesion&quot; id=&quot;user-content-loss-of-cohesion&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Scenario: You have a class that initially managed user-related functionality, but you split it into several smaller classes, each handling a specific aspect (e.g., user creation, user update, user deletion), which leads to a greater confusion of original purpose.&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto !important; position: relative !important;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;public class UserCreationService
{
    public void CreateUser(User user) { /* Create logic */ }
}

public class UserUpdateService
{
    public void UpdateUser(User user) { /* Update logic */ }
}

public class UserDeletionService
{
    public void DeleteUser(User user) { /* Delete logic */ }
}&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description><link>https://code.oneananda.com/2024/09/interface-driven-development-idd.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-607761637906599439</guid><pubDate>Sat, 07 Sep 2024 15:11:00 +0000</pubDate><atom:updated>2024-09-07T08:11:36.274-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Amazon EC2 Instance Purchase Options</category><category domain="http://www.blogger.com/atom/ns#">AWS</category><category domain="http://www.blogger.com/atom/ns#">AWS EC2</category><title>AWS Learning 001 - Amazon EC2 - 003 - Instance Purchase Options</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-top: 0px !important; position: relative;&quot;&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px !important; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Amazon EC2 Instance Purchase Options&lt;/h1&gt;&lt;a aria-label=&quot;Permalink: Amazon EC2 Instance Purchase Options&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/003%20Amazon%20EC2%20Instance%20Purchase%20Options#amazon-ec2-instance-purchase-options&quot; id=&quot;user-content-amazon-ec2-instance-purchase-options&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 25.162px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Instance Purchasing Options in AWS EC2:&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Instance Purchasing Options in AWS EC2:&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/003%20Amazon%20EC2%20Instance%20Purchase%20Options#instance-purchasing-options-in-aws-ec2&quot; id=&quot;user-content-instance-purchasing-options-in-aws-ec2&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9699px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;hr style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: content-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; height: 0.25em; margin: var(--base-size-24) 0; padding: 0px;&quot; /&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;On-Demand Instances&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: On-Demand Instances&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/003%20Amazon%20EC2%20Instance%20Purchase%20Options#on-demand-instances&quot; id=&quot;user-content-on-demand-instances&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Pay by hour / pay by seconds&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;No long term commitments&lt;/code&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Charges only if the&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;instance is running&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: content-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; height: 0.25em; margin: var(--base-size-24) 0; padding: 0px;&quot; /&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Savings plan&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Savings plan&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/003%20Amazon%20EC2%20Instance%20Purchase%20Options#savings-plan&quot; id=&quot;user-content-savings-plan&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Compute savings plan&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Provides most flexiblity&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Discounts apply across different&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Instance types&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Sizes&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Regions&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;EC2 instance savings plan&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Offers the lowest prices&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Discounts apply to specific instance families in a choosen region&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: content-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; height: 0.25em; margin: var(--base-size-24) 0; padding: 0px;&quot; /&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Reserved Instances (RI)&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Reserved Instances (RI)&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/003%20Amazon%20EC2%20Instance%20Purchase%20Options#reserved-instances-ri&quot; id=&quot;user-content-reserved-instances-ri&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;General characteristics for Reserved Instances&lt;/span&gt;&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Commitment from 1 to 3 years&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;The following determine the price&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Instance type&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Region&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Platform&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Can&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;buy / sell the unused instances&lt;/code&gt;&amp;nbsp;in AWS Marketplace,&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;except for Convertible RIs&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Standard Reserved Instances&lt;/span&gt;&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Use Case:&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Steady-state&lt;/code&gt;, predictable workloads.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Economy: High savings with long-term commitment.&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Convertible Reserved Instances&lt;/span&gt;&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Use Case: Workloads that&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;may change&lt;/code&gt;.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Economy: Moderate savings with long-term commitment.&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Scheduled Reserved Instances&lt;/span&gt;&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Use Case:&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Predictable workloads&lt;/code&gt;&amp;nbsp;that run on schedule.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Economy: Cost savings compared to On-Demand, but with scheduled flexibility.&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: content-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; height: 0.25em; margin: var(--base-size-24) 0; padding: 0px;&quot; /&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Spot Instances&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Spot Instances&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/003%20Amazon%20EC2%20Instance%20Purchase%20Options#spot-instances&quot; id=&quot;user-content-spot-instances&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Cost sensitive that&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;can accept interuptions&lt;/code&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Suitable for non-critical workloads&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;There is&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;no commitment&lt;/code&gt;&amp;nbsp;needed&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Anytime the instance may get terminated&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: content-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; height: 0.25em; margin: var(--base-size-24) 0; padding: 0px;&quot; /&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Dedicated Hosts&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Dedicated Hosts&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/003%20Amazon%20EC2%20Instance%20Purchase%20Options#dedicated-hosts&quot; id=&quot;user-content-dedicated-hosts&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Dedicated hardware&lt;/code&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Rent a host or rack&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Suitable for the SW which you pay per socket, pay per core, pay per VM licences to reduce costs&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Supports&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;BYOL (Bring your own licence)&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Dedicated hosts are particularly used when you have a dedicated SW which is tied to specific physical metrices such as,&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Number of core&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Sockets&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Virtual Machines&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;These Software often desingnated to run on specifcic Hardware&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Example: SQL Server Licencing&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Suppose you have a SQL Server license that is based on the number of physical cores on a server. The license states that you can run SQL Server on up to 8 physical cores per license.&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Physical Core Visibility:&lt;/span&gt;&amp;nbsp;A Dedicated Host gives you visibility into the physical server&#39;s configuration. For instance, you might choose a Dedicated Host with exactly 8 cores to fully utilize your SQL Server license.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Compliance:&lt;/span&gt;&amp;nbsp;Since you&#39;re aware of and can control the number of cores, you can ensure that your SQL Server instance is compliant with the licensing terms. You can place one or more instances of SQL Server on this Dedicated Host, knowing that you&#39;re not exceeding the licensed core count.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Host Affinity (Attachment):&lt;/span&gt;&amp;nbsp;If your license requires that the software remains on specific hardware, you can use host affinity to ensure that your SQL Server instances always run on this Dedicated Host.&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;If you are not using Dedicated host for this scenario&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;No Physical Core Visibility:&lt;/span&gt;&amp;nbsp;In a typical EC2 instance or even on a Dedicated Instance, you don’t have visibility or control over the underlying physical cores&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Potential Non-Compliance:&lt;/span&gt;&amp;nbsp;Without this visibility and control, it becomes challenging to ensure compliance with licensing terms that are tied to physical core counts&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: content-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; height: 0.25em; margin: var(--base-size-24) 0; padding: 0px;&quot; /&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Dedicated Instances&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Dedicated Instances&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/003%20Amazon%20EC2%20Instance%20Purchase%20Options#dedicated-instances&quot; id=&quot;user-content-dedicated-instances&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Dedicated hardware&lt;/code&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Similiar to Dedicated Hosts but having less control over the hardware&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Less granular control&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Supports partially&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;BYOL (Bring your own licence)&lt;/code&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Typically, Dedicated Instances are less expensive than Dedicated Hosts&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: content-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; height: 0.25em; margin: var(--base-size-24) 0; padding: 0px;&quot; /&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Differences Between Dedicated Hosts and Dedicated Instances&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Differences Between Dedicated Hosts and Dedicated Instances&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/003%20Amazon%20EC2%20Instance%20Purchase%20Options#differences-between-dedicated-hosts-and-dedicated-instances&quot; id=&quot;user-content-differences-between-dedicated-hosts-and-dedicated-instances&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9699px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;markdown-accessiblity-table data-catalyst=&quot;&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; display: block; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px;&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border-spacing: 0px; display: block; margin-bottom: var(--base-size-16); margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;thead style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Feature&lt;/span&gt;&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Dedicated Hosts&lt;/span&gt;&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Dedicated Instances&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Control and Visibility&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Provides control over the physical server, with visibility into sockets, cores, etc.&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;No visibility into the underlying host; AWS manages the server placement.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Licensing&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Supports BYOL for licenses that require core, socket, or VM-level compliance.&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Supports BYOL, but with less flexibility in managing hardware-bound licenses.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Host Affinity (Attachment)&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Allows instance placement on specific Dedicated Hosts, enabling host affinity.&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;No control over instance placement; AWS handles it.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Compliance Requirements&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Helps meet compliance by providing control over the physical environment.&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Less suited for strict compliance needs due to lack of control over the physical host.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Instance Types&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Allows mixing of different EC2 instance types within the same family on a single host.&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Instances are managed by AWS with no control over instance type placement.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Management Complexity&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Requires more management and monitoring due to increased control.&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Simpler to manage, as AWS handles the underlying server management.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Cost&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Potentially higher cost due to increased control and management.&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Generally easier and potentially less expensive to manage, depending on use case.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/markdown-accessiblity-table&gt;&lt;hr style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: content-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; height: 0.25em; margin: var(--base-size-24) 0; padding: 0px;&quot; /&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Capacity Reservations&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Capacity Reservations&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/003%20Amazon%20EC2%20Instance%20Purchase%20Options#capacity-reservations&quot; id=&quot;user-content-capacity-reservations&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;We can reserve Capacity Reservations for any Availablity Zone for any duration&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;No long term commitment is needed&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;This is ensuring capacity availability for mission-critical apps.&lt;/li&gt;&lt;/ul&gt;</description><link>https://code.oneananda.com/2024/09/aws-learning-001-amazon-ec2-003.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-8627986650208414065</guid><pubDate>Sat, 07 Sep 2024 07:10:00 +0000</pubDate><atom:updated>2024-09-07T00:10:54.686-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">AWS</category><category domain="http://www.blogger.com/atom/ns#">AWS Learning</category><category domain="http://www.blogger.com/atom/ns#">EC2 Instance Types</category><title>AWS Learning 001 - Amazon EC2 - 002 - Instance Types</title><description>&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-top: 0px; position: relative;&quot;&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-size: 2em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px !important; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Amazon EC2 Instance Types&lt;/h1&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-top: 0px !important; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: Amazon EC2 Instance Types&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/002%20Amazon%20EC2%20Instance%20Types#amazon-ec2-instance-types&quot; id=&quot;user-content-amazon-ec2-instance-types&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 25.162px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Amazon EC2 Instances&lt;/code&gt;&amp;nbsp;are categorized based on performance characteristics and appropriate use cases.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;The following are the instance types&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;based on the performance&lt;/code&gt;&lt;/p&gt;&lt;/h1&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;EC2 Instance Types and Server Purposes - Use Cases&lt;/h2&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: EC2 Instance Types and Server Purposes - Use Cases&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/002%20Amazon%20EC2%20Instance%20Types#ec2-instance-types-and-server-purposes---use-cases&quot; id=&quot;user-content-ec2-instance-types-and-server-purposes---use-cases&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9699px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h1&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;General Purpose&lt;/h2&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: General Purpose&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/002%20Amazon%20EC2%20Instance%20Types#general-purpose&quot; id=&quot;user-content-general-purpose&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9699px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Balances computing, memory and networking resources&lt;/code&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Suitable for variety of workloads&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;T-Family instances offer burstable performance by utilizing CPU credits&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Once CPU credits exhausted then the bursting capabilities are disabled, until more credits are earned&lt;/li&gt;&lt;/ul&gt;&lt;markdown-accessiblity-table data-catalyst=&quot;&quot; style=&quot;box-sizing: border-box; display: block; font-size: 16px; font-weight: 400;&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border-spacing: 0px; display: block; margin-bottom: var(--base-size-16); margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;thead style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Use Case&lt;/span&gt;&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Description&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Web Servers&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Suitable for a balanced mix of compute, memory, and networking.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Application Servers&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Suitable for backend applications that handle non-heavy compute, memory, and networking.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Small to Medium Databases&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Applicable where computing and memory are not heavily used.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Development and Test Environments&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Suitable for balanced SDLC life cycle management.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Microservices&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Suitable, but balanced.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Gaming Applications&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Suitable, but balanced.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Caching Servers&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Suitable, but balanced.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/markdown-accessiblity-table&gt;&lt;hr style=&quot;background-attachment: initial; background-clip: initial; background-color: var(--borderColor-default, var(--color-border-default)); background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: content-box; font-size: 16px; font-weight: 400; height: 0.25em; margin: var(--base-size-24) 0; padding: 0px;&quot; /&gt;&lt;/h1&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Compute Optimized&lt;/h2&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: Compute Optimized&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/002%20Amazon%20EC2%20Instance%20Types#compute-optimized&quot; id=&quot;user-content-compute-optimized&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9699px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Ideal for compute-bound applications that need&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;high-performance processors&lt;/code&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;/h1&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Compute Optimized&lt;/h2&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: Compute Optimized&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/002%20Amazon%20EC2%20Instance%20Types#compute-optimized-1&quot; id=&quot;user-content-compute-optimized-1&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9699px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;markdown-accessiblity-table data-catalyst=&quot;&quot; style=&quot;box-sizing: border-box; display: block; font-size: 16px; font-weight: 400;&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border-spacing: 0px; display: block; margin-bottom: var(--base-size-16); margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;thead style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Use Case&lt;/span&gt;&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Description&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Batch Processing Workloads&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Suitable for applications that use significant computational power.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;High Performance Web Servers&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;For servers that handle high traffic and require strong performance.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Media Transcoding&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Suitable for media encoding and transcoding tasks for video and audio processing.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;High Performance Computing (HPC)&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Ideal for scientific modeling, simulations, and other HPC workloads that demand high processing power.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Gaming Servers&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Suitable for multiple players, high performance.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Ad Server Engines&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;For real-time ad-serving servers.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Machine Learning Inference&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Requires rapid computation.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Scientific Modeling and Simulation&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Suitable for complex simulations.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/markdown-accessiblity-table&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Examples&lt;/span&gt;&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Batch Processing Workloads : Large-scale data processing in Hadoop clusters, 3rd Party Example: Apache Hadoop, Apache Spark&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;High Performance Web Servers : High traffic e-commerce websites like Amazon, eBay, 3rd Party Example: NGNIX (Pronouncation: EN-jin-EKS), HAProxy&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Media Transcoding : Video streaming platforms like Netflix, processing multiple media files on the fly, 3rd Party Example: FFmpeg, AWS Elemental MediaConvert&lt;/li&gt;&lt;/ul&gt;&lt;hr style=&quot;background-attachment: initial; background-clip: initial; background-color: var(--borderColor-default, var(--color-border-default)); background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: content-box; font-size: 16px; font-weight: 400; height: 0.25em; margin: var(--base-size-24) 0; padding: 0px;&quot; /&gt;&lt;/h1&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Memory Optimized&lt;/h2&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: Memory Optimized&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/002%20Amazon%20EC2%20Instance%20Types#memory-optimized&quot; id=&quot;user-content-memory-optimized&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9699px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Ideal for&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;memory-intensive applications&lt;/code&gt;&amp;nbsp;and large enterprises.&lt;/li&gt;&lt;/ul&gt;&lt;markdown-accessiblity-table data-catalyst=&quot;&quot; style=&quot;box-sizing: border-box; display: block; font-size: 16px; font-weight: 400;&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border-spacing: 0px; display: block; margin-bottom: var(--base-size-16); margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;thead style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Use Case&lt;/span&gt;&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Description&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;In-Memory Databases&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Running in-memory databases like Redis, Memcached, or SAP HANA that require high memory capacity and low latency to store and process large data sets in memory.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Real-time Big Data Analytics&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Performing real-time analytics on large datasets using tools like Apache Spark or Hadoop, where processing speed is crucial, and large memory resources are required to keep data in memory.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;HPC for Genomics&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Analyzing genetic data in fields like bioinformatics, where processing large-scale DNA sequencing data in memory is necessary for quick analysis.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;In-Memory Caching&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Implementing large-scale in-memory caches that store and serve frequently accessed data, reducing access times and improving application performance.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Large-scale Enterprise Applications&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Running memory-intensive enterprise applications such as SAP ERP or Oracle databases that need substantial memory to maintain performance under heavy workloads.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Machine Learning and AI Model Training&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Training machine learning models on large datasets that need to be loaded into memory for faster processing, particularly for deep learning algorithms.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/markdown-accessiblity-table&gt;&lt;hr style=&quot;background-attachment: initial; background-clip: initial; background-color: var(--borderColor-default, var(--color-border-default)); background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: content-box; font-size: 16px; font-weight: 400; height: 0.25em; margin: var(--base-size-24) 0; padding: 0px;&quot; /&gt;&lt;/h1&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Accelerated Computing&lt;/h2&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: Accelerated Computing&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/002%20Amazon%20EC2%20Instance%20Types#accelerated-computing&quot; id=&quot;user-content-accelerated-computing&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9699px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Suitable for&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;HPC (High Performance Computing)&lt;/code&gt;&amp;nbsp;applications.&lt;/li&gt;&lt;/ul&gt;&lt;markdown-accessiblity-table data-catalyst=&quot;&quot; style=&quot;box-sizing: border-box; display: block; font-size: 16px; font-weight: 400;&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border-spacing: 0px; display: block; margin-bottom: var(--base-size-16); margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;thead style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Use Case&lt;/span&gt;&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Description&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Machine Learning Inference&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Enhance performance for deep learning models by leveraging GPU-based instances for faster predictions and real-time analysis.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Graphics Rendering&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Run complex graphics processing tasks such as 3D rendering, video encoding, and visual effects creation using GPU acceleration.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;High-Performance Computing (HPC)&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Execute parallel computations for scientific simulations, financial modeling, and computational fluid dynamics with faster results.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Data Pattern Matching&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Speed up workloads that involve extensive pattern matching, such as genome sequencing or large-scale data analysis, with FPGA-based instances.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Cryptography&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Perform high-speed cryptographic operations like encryption and decryption using hardware accelerators for enhanced security and efficiency.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/markdown-accessiblity-table&gt;&lt;hr style=&quot;background-attachment: initial; background-clip: initial; background-color: var(--borderColor-default, var(--color-border-default)); background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: content-box; font-size: 16px; font-weight: 400; height: 0.25em; margin: var(--base-size-24) 0; padding: 0px;&quot; /&gt;&lt;/h1&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Storage Optimized&lt;/h2&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: Storage Optimized&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/002%20Amazon%20EC2%20Instance%20Types#storage-optimized&quot; id=&quot;user-content-storage-optimized&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9699px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Tailored for&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;workloads requiring high, sequential read/write access&lt;/code&gt;&amp;nbsp;to large data sets on local storage.&lt;/li&gt;&lt;/ul&gt;&lt;markdown-accessiblity-table data-catalyst=&quot;&quot; style=&quot;box-sizing: border-box; display: block; font-size: 16px; font-weight: 400;&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border-spacing: 0px; display: block; margin-bottom: var(--base-size-16); margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;thead style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Use Case&lt;/span&gt;&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Description&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;High-Frequency OLTP&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Ideal for workloads requiring fast, low-latency access to large volumes of transactional data.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Big Data Analytics&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Optimize the processing of large data sets with high sequential read and write throughput.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Data Warehousing&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Suitable for workloads that need to manage and query large-scale databases efficiently.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Log or Data Processing&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Efficiently handle high-speed processing of log files, streaming data, or large datasets.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;NoSQL Databases&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Enhance performance for NoSQL databases that require low-latency, high-random I/O operations.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Cache Storage&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Ideal for in-memory databases or caching systems that demand high IOPS for fast data retrieval.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/markdown-accessiblity-table&gt;&lt;hr style=&quot;background-attachment: initial; background-clip: initial; background-color: var(--borderColor-default, var(--color-border-default)); background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; box-sizing: content-box; font-size: 16px; font-weight: 400; height: 0.25em; margin: var(--base-size-24) 0; padding: 0px;&quot; /&gt;&lt;/h1&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Nitro-based&lt;/h2&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: Nitro-based&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/002%20Amazon%20EC2%20Instance%20Types#nitro-based&quot; id=&quot;user-content-nitro-based&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9699px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Enables&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;higher IOPS provisioning for EBS volumes&lt;/code&gt;, offering up to 64,000 IOPS per volume, compared to 32,000 on other instances.&lt;/li&gt;&lt;/ul&gt;&lt;markdown-accessiblity-table data-catalyst=&quot;&quot; style=&quot;box-sizing: border-box; display: block; font-size: 16px; font-weight: 400;&quot;&gt;&lt;table style=&quot;border-collapse: collapse; border-spacing: 0px; display: block; margin-bottom: var(--base-size-16); margin-top: 0px; max-width: 100%; overflow: auto; width: max-content;&quot;&gt;&lt;thead style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Use Case&lt;/span&gt;&lt;/th&gt;&lt;th style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Description&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Bare Metal Workloads&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Ideal for applications requiring direct access to physical hardware without virtualization overhead.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;High-Performance Databases&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Suitable for running large, high-performance databases that demand low latency and high throughput.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Advanced Networking&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Enhanced networking capabilities for workloads requiring advanced networking features such as enhanced networking or SR-IOV.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;High IOPS Storage&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Supports high IOPS storage systems for applications needing fast, low-latency storage performance.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-default, var(--color-canvas-default)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Security-Sensitive Applications&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Perfect for security-sensitive applications requiring hardware-based isolation and encryption.&lt;/td&gt;&lt;/tr&gt;&lt;tr style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-top: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box;&quot;&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); margin-bottom: 0px;&quot;&gt;Virtualization Overhead Elimination&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;border: 1px solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; padding: 6px 13px;&quot;&gt;Eliminates virtualization overhead for workloads requiring full access to underlying hardware resources.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/markdown-accessiblity-table&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Examples&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Bare Metal Workloads&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Bare Metal Workloads on AWS EC2 provide the highest level of performance and control available in the cloud. They are best suited for applications requiring direct access to hardware or those that need to meet strict compliance and licensing requirements. However, they come with added complexity and cost considerations, making them ideal for specific, high-demand workloads.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Running hypervisor-free environments for high-performance computing, such as financial trading platforms that require direct access to hardware for low-latency processing.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;3rd Party Components:&lt;/span&gt;&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;VMware ESXi (for on-premises to cloud migration),&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Oracle Real Application Clusters (RAC) for database workloads.&lt;/li&gt;&lt;/ul&gt;&lt;/h1&gt;&lt;/div&gt;&lt;markdown-accessiblity-table data-catalyst=&quot;&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; display: block; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 0px;&quot;&gt;&lt;/markdown-accessiblity-table&gt;</description><link>https://code.oneananda.com/2024/09/aws-learning-001-amazon-ec2-002.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-141338643624270108</guid><pubDate>Sat, 31 Aug 2024 04:21:00 +0000</pubDate><atom:updated>2024-08-30T21:21:56.275-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">AWS</category><category domain="http://www.blogger.com/atom/ns#">Continuous Deployment (CD)</category><title>Cloud Continuous Deployment (CD) Services Comparison</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1vo-KWqXj9WZOSI-6EgAzzgSbd9Mq6zUENiebZvdbL5S4osWMmAZ7SX9FFgFN0GqOUKSajGSagyCmqszxpOmLBs-eNCKMyNDDHXVyrFzrVjCXlIaYaLgSJP-dAFYwbyGe7Z0Msz0h7faFxPyu6n9Vh0gtsdgNXAzHvacd8T5w3SPFKhiDAukhNQ/s1722/Cloud%20CD%20Services%20Comparison.jpeg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Cloud CD Services Comparison&quot; border=&quot;0&quot; data-original-height=&quot;1150&quot; data-original-width=&quot;1722&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1vo-KWqXj9WZOSI-6EgAzzgSbd9Mq6zUENiebZvdbL5S4osWMmAZ7SX9FFgFN0GqOUKSajGSagyCmqszxpOmLBs-eNCKMyNDDHXVyrFzrVjCXlIaYaLgSJP-dAFYwbyGe7Z0Msz0h7faFxPyu6n9Vh0gtsdgNXAzHvacd8T5w3SPFKhiDAukhNQ/s16000/Cloud%20CD%20Services%20Comparison.jpeg&quot; title=&quot;Cloud CD Services Comparison&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;</description><link>https://code.oneananda.com/2024/08/cloud-continuous-deployment-cd-services.html</link><author>noreply@blogger.com (One-Ananda)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1vo-KWqXj9WZOSI-6EgAzzgSbd9Mq6zUENiebZvdbL5S4osWMmAZ7SX9FFgFN0GqOUKSajGSagyCmqszxpOmLBs-eNCKMyNDDHXVyrFzrVjCXlIaYaLgSJP-dAFYwbyGe7Z0Msz0h7faFxPyu6n9Vh0gtsdgNXAzHvacd8T5w3SPFKhiDAukhNQ/s72-c/Cloud%20CD%20Services%20Comparison.jpeg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-3406390560386764525</guid><pubDate>Fri, 30 Aug 2024 00:03:00 +0000</pubDate><atom:updated>2024-08-29T17:16:45.868-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">AWS</category><category domain="http://www.blogger.com/atom/ns#">AWS NACL</category><category domain="http://www.blogger.com/atom/ns#">AWS Security Groups</category><title>AWS Network Access Control Lists (NACLs) and Security Groups</title><description>&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 1;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #1f2328; font-size: 18pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;AWS NACLs vs. AWS Security Groups: What&#39;s the
Difference?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-yfti-tbllook: 1184; width: 714px;&quot;&gt;
 &lt;thead&gt;
  &lt;tr&gt;
   &lt;td style=&quot;border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 116.75pt;&quot; width=&quot;156&quot;&gt;
   &lt;p align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Feature&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
   &lt;/td&gt;
   &lt;td style=&quot;border-left: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 193.5pt;&quot; width=&quot;258&quot;&gt;
   &lt;p align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Security Groups&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
   &lt;/td&gt;
   &lt;td style=&quot;border-left: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 225.0pt;&quot; width=&quot;300&quot;&gt;
   &lt;p align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Network Access Control Lists
   (NACLs)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
   &lt;/td&gt;
  &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;&lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 116.75pt;&quot; width=&quot;156&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Statefulness&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 193.5pt;&quot; width=&quot;258&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Security Groups are&amp;nbsp;&lt;b&gt;stateful&lt;/b&gt;. They remember
  things like whether a request was allowed, so they automatically allow return
  traffic without us having to do anything extra.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 225.0pt;&quot; width=&quot;300&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;NACLs are&amp;nbsp;&lt;b&gt;stateless&lt;/b&gt;, meaning they don&#39;t
  remember anything about previous requests. Each request is treated like it&#39;s
  the first one.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 116.75pt;&quot; width=&quot;156&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Where They Work&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 193.5pt;&quot; width=&quot;258&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Security Groups work at the&amp;nbsp;&lt;b&gt;instance level&lt;/b&gt;&amp;nbsp;(or
  for other specific resources), so they control traffic for individual
  instances.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 225.0pt;&quot; width=&quot;300&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;NACLs work at the&amp;nbsp;&lt;b&gt;subnet level&lt;/b&gt;, so they
  control traffic for all instances in a subnet.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 116.75pt;&quot; width=&quot;156&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Inbound Rules&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 193.5pt;&quot; width=&quot;258&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Security Groups check all their rules, and if any rule
  allows the traffic, it&#39;s allowed in. They don’t care about the order.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 225.0pt;&quot; width=&quot;300&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;NACLs follow their rules in a specific order, starting
  from the lowest number. Once a match is found, that&#39;s it—no more rules are
  checked.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 116.75pt;&quot; width=&quot;156&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Outbound Rules&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 193.5pt;&quot; width=&quot;258&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Security Groups automatically allow return traffic if it
  was allowed in. So if someone connects in, their responses are allowed out
  without extra rules.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 225.0pt;&quot; width=&quot;300&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;With NACLs, we need to set up rules for&amp;nbsp;&lt;b&gt;both&lt;/b&gt;&amp;nbsp;inbound
  and outbound traffic. If we want traffic to go out, we have to explicitly
  allow it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 116.75pt;&quot; width=&quot;156&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Default Settings&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 193.5pt;&quot; width=&quot;258&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;The default Security Group blocks everything from coming
  in, but it allows everything to go out unless we say otherwise.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 225.0pt;&quot; width=&quot;300&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;By default, the NACL that comes with our VPC allows
  everything in and out. But if we create a new NACL, it blocks everything
  until we set up rules. In summary, the default NACL will allow traffic by
  default, but the ones we create will block everything by default.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 116.75pt;&quot; width=&quot;156&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;How Rules Are Ordered&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 193.5pt;&quot; width=&quot;258&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Security Groups don’t have rule numbers. They look at all
  the rules and use the most permissive one that applies.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 225.0pt;&quot; width=&quot;300&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;NACLs have numbered rules, and they check them in order
  from lowest to highest. The first rule that matches gets applied.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 116.75pt;&quot; width=&quot;156&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Logging and Monitoring&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 193.5pt;&quot; width=&quot;258&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Security Groups can log changes through AWS CloudTrail,
  and we can monitor traffic with VPC Flow Logs.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 225.0pt;&quot; width=&quot;300&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;NACLs don’t keep track of what they block or allow by
  default. We’ll need to set up something like VPC Flow Logs to see what’s
  happening.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 116.75pt;&quot; width=&quot;156&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;How They’re Assigned&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 193.5pt;&quot; width=&quot;258&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Security Groups need to be assigned to specific instances
  or resources; they’re not automatically applied.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 225.0pt;&quot; width=&quot;300&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Every subnet in a VPC has to be associated with a NACL. If
  we don’t pick one, it’ll get the default NACL.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 116.75pt;&quot; width=&quot;156&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Best Use Case&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 193.5pt;&quot; width=&quot;258&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Security Groups are our go-to for securing individual
  instances. They’re perfect for managing who can connect to our servers and
  how.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 225.0pt;&quot; width=&quot;300&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;NACLs are great for adding an extra layer of security at
  the subnet level, especially when we want to control traffic between
  different subnets.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 116.75pt;&quot; width=&quot;156&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;How They’re Managed&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 193.5pt;&quot; width=&quot;258&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Security Groups are managed at the instance level or for
  specific AWS resources.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 225.0pt;&quot; width=&quot;300&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;NACLs are managed at the subnet level in our VPC.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 116.75pt;&quot; width=&quot;156&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;How Rules Are Applied&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 193.5pt;&quot; width=&quot;258&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Security Groups check all rules at once. If any rule
  allows the traffic, it’s allowed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 225.0pt;&quot; width=&quot;300&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;NACLs apply rules in a set order, and once a match is
  found, that rule is applied, and the rest are ignored.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td style=&quot;border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 116.75pt;&quot; width=&quot;156&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Return Traffic&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 193.5pt;&quot; width=&quot;258&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Security Groups automatically allow return traffic for any
  inbound connections, so we don’t need to worry about it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt 4.5pt 9.75pt; width: 225.0pt;&quot; width=&quot;300&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;With NACLs, we need to create rules for both incoming and
  outgoing traffic separately. Return traffic won’t be allowed unless we set up
  a rule for it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 1;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #1f2328; font-size: 18pt;&quot;&gt;&lt;span&gt;What AWS Security Groups and NACLs Have in
Common?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;



&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-yfti-tbllook: 1184;&quot;&gt;
 &lt;thead&gt;
  &lt;tr style=&quot;mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;
   &lt;td style=&quot;border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt;&quot;&gt;
   &lt;p align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Feature&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
   &lt;/td&gt;
   &lt;td style=&quot;border-left: none; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt;&quot;&gt;
   &lt;p align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in; text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Description&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
   &lt;/td&gt;
  &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;&lt;tr style=&quot;mso-yfti-irow: 1;&quot;&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt;&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;IP Address Filtering&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt;&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Both Security Groups and NACLs can filter traffic based on
  specific IP address ranges (CIDR blocks). This helps us manage which IP
  addresses are allowed or denied access to our resources.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&quot;mso-yfti-irow: 2;&quot;&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt;&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Protocol Support&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt;&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Both Security Groups and NACLs can handle traffic using
  protocols like TCP, UDP, ICMP, and others, giving us flexibility in managing
  network traffic.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&quot;mso-yfti-irow: 3;&quot;&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt;&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Allow/Deny Rules&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt;&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Both can explicitly allow or deny traffic based on rules
  we set up, providing us with control over what traffic is permitted or
  blocked.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&quot;mso-yfti-irow: 4;&quot;&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt;&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;VPC Integration&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt;&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Both Security Groups and NACLs are integral to a Virtual
  Private Cloud (VPC) environment, playing a key role in securing our network
  within AWS.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&quot;mso-yfti-irow: 5;&quot;&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt;&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Monitoring with VPC Flow Logs&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt;&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Both can be monitored using VPC Flow Logs, allowing us to
  track the traffic that is allowed or denied by our rules, helping us maintain
  security and troubleshoot issues.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&quot;mso-yfti-irow: 6;&quot;&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt;&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Ease of Modification&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt;&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;We can modify both Security Groups and NACLs at any time,
  updating the rules as our security needs change.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&quot;mso-yfti-irow: 7; mso-yfti-lastrow: yes;&quot;&gt;
  &lt;td style=&quot;border-top: none; border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt;&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Network Layer Security&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1pt solid windowtext; border-left: none; border-right: 1pt solid windowtext; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 4.5pt 9.75pt;&quot;&gt;
  &lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Both provide an important layer of network security within
  AWS, with Security Groups focusing on instance-level protection and NACLs
  focusing on subnet-level control.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;o:p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;</description><link>https://code.oneananda.com/2024/08/aws-network-access-control-lists-nacls.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-64769432410488918</guid><pubDate>Tue, 27 Aug 2024 00:11:00 +0000</pubDate><atom:updated>2024-08-26T17:32:40.498-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Azure</category><category domain="http://www.blogger.com/atom/ns#">Azure NAT Gateway</category><title>Azure NAT Gateway Process</title><description>&lt;p&gt;&lt;span style=&quot;font-family: courier; font-size: large;&quot;&gt;&lt;b&gt;&amp;nbsp;Azure NAT Gateway Process - Managing Outbound Traffic&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7VjjZjxVnzygCERt2r0a-UoYblYuWqk4zYgtg7nJyz7aSM2VchqFm782Q4X7tw2SWbcM7GD3l8UsVqdLsJvhEjEnJpXkRXsQ00YRZ33hCcILZKU_XFRTnApi4jrqFe2W9XgaOXlI2SvSStW9d-oFxZGAx5PsRf_ZI3nhMriIFT2pU6BbcCe1ZDQ/s1622/Azure%20NAT%20Gateway%20Process.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Azure NAT Gateway Process&quot; border=&quot;0&quot; data-original-height=&quot;982&quot; data-original-width=&quot;1622&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7VjjZjxVnzygCERt2r0a-UoYblYuWqk4zYgtg7nJyz7aSM2VchqFm782Q4X7tw2SWbcM7GD3l8UsVqdLsJvhEjEnJpXkRXsQ00YRZ33hCcILZKU_XFRTnApi4jrqFe2W9XgaOXlI2SvSStW9d-oFxZGAx5PsRf_ZI3nhMriIFT2pU6BbcCe1ZDQ/s16000/Azure%20NAT%20Gateway%20Process.png&quot; title=&quot;Azure NAT Gateway Process&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;</description><link>https://code.oneananda.com/2024/08/azure-nat-gateway-process.html</link><author>noreply@blogger.com (One-Ananda)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7VjjZjxVnzygCERt2r0a-UoYblYuWqk4zYgtg7nJyz7aSM2VchqFm782Q4X7tw2SWbcM7GD3l8UsVqdLsJvhEjEnJpXkRXsQ00YRZ33hCcILZKU_XFRTnApi4jrqFe2W9XgaOXlI2SvSStW9d-oFxZGAx5PsRf_ZI3nhMriIFT2pU6BbcCe1ZDQ/s72-c/Azure%20NAT%20Gateway%20Process.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-5196313946725019817</guid><pubDate>Sun, 25 Aug 2024 09:24:00 +0000</pubDate><atom:updated>2024-08-25T03:06:29.867-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CI</category><category domain="http://www.blogger.com/atom/ns#">Cloud CI Services Comparison</category><category domain="http://www.blogger.com/atom/ns#">Continuous Integration</category><title>Cloud Continuous Integration (CI) Services Comparison</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxZVflktARd8nos3XM70-l86RvckgKNoWHvbUIxB40nC1-etFJ9fg7oLzkyz2-fcvs8032DsD4TiiXaddhrTQEYNA2ORakSQV4tPrd3IAe6kBOgLnFgJo0Mfepi62pr2jvGnLs-r9jHZ5mmVnhe-2vV4FZmQPv1XzBqy0TqspXzYIdlD5FLvps8g/s1782/Cloud%20CI%20Services%20Comparison.jpeg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1782&quot; data-original-width=&quot;1722&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxZVflktARd8nos3XM70-l86RvckgKNoWHvbUIxB40nC1-etFJ9fg7oLzkyz2-fcvs8032DsD4TiiXaddhrTQEYNA2ORakSQV4tPrd3IAe6kBOgLnFgJo0Mfepi62pr2jvGnLs-r9jHZ5mmVnhe-2vV4FZmQPv1XzBqy0TqspXzYIdlD5FLvps8g/s16000/Cloud%20CI%20Services%20Comparison.jpeg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;</description><link>https://code.oneananda.com/2024/08/cloud-ci-services-comparison.html</link><author>noreply@blogger.com (One-Ananda)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxZVflktARd8nos3XM70-l86RvckgKNoWHvbUIxB40nC1-etFJ9fg7oLzkyz2-fcvs8032DsD4TiiXaddhrTQEYNA2ORakSQV4tPrd3IAe6kBOgLnFgJo0Mfepi62pr2jvGnLs-r9jHZ5mmVnhe-2vV4FZmQPv1XzBqy0TqspXzYIdlD5FLvps8g/s72-c/Cloud%20CI%20Services%20Comparison.jpeg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-4779492284810867628</guid><pubDate>Sat, 24 Aug 2024 08:55:00 +0000</pubDate><atom:updated>2024-08-24T01:58:11.226-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">Reference Programming</category><title>C# - out - Reference Programming - Deep dive</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-top: 0px; position: relative;&quot;&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&#39;out&#39; - Reference Programming - Deep dive&lt;/h1&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a aria-label=&quot;Permalink: &#39;out&#39; Deep dive&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/out_Deep_Dive#out-deep-dive&quot; id=&quot;user-content-out-deep-dive&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 25.125px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;This article demonstrates how to use&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;out&lt;/code&gt;&amp;nbsp;keyword with different aspects,&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;In C# using &#39;out&#39; keyword is indicating that the parameter is passed by reference rather than value, that means, any changes made to the parameter will be made available outside of the method.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;The other purpose of using out is, we can return multiple parameters from a method, this might be very useful in cases where we need multiple values to be evaluated in the caller function.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;We will see how this is happening!&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Purpose&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Purpose&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/out_Deep_Dive#purpose&quot; id=&quot;user-content-purpose&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;The primary objective of this project is to showcase how the&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;out&lt;/code&gt;&amp;nbsp;keyword can be utilized in different programming scenarios. This includes:&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Returning multiple values from a method.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Handling method overloading with&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;out&lt;/code&gt;&amp;nbsp;parameters.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Parsing strings using&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;TryParse&lt;/code&gt;&amp;nbsp;with&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;out&lt;/code&gt;.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Assigning values within methods using the&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;out&lt;/code&gt;&amp;nbsp;keyword.&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Examples&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Examples&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/out_Deep_Dive#examples&quot; id=&quot;user-content-examples&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;The project covers the following examples:&lt;/p&gt;&lt;ol dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Basic Example with&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;out&lt;/code&gt;&amp;nbsp;Parameter&lt;/span&gt;&lt;/span&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Demonstrates how the&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;out&lt;/code&gt;&amp;nbsp;keyword can be used to return a value from a method.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Calling method&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;            int x, y;
            
            y = Multiply(out x);

            Console.WriteLine($&quot;x = {x}, y = {y}&quot;);
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;            int x, y;
            
            y = Multiply(out x);

            Console.WriteLine($&amp;quot;x = {x}, y = {y}&amp;quot;);&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Out Method&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;        static int Multiply(out int a)
        {
            // The a needs to be assigned before the control leaves the method
            // if not, the compiler error will happen
            a = 10; 
            return a * a;
        } 
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;        static int Multiply(out int a)
        {
            // The a needs to be assigned before the control leaves the method
            // if not, the compiler error will happen
            a = 10; 
            return a * a;
        } &quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol dir=&quot;auto&quot; start=&quot;2&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Using&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;out&lt;/code&gt;&amp;nbsp;for Multiple Return Values&lt;/span&gt;&lt;/span&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Illustrates how to use the&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;out&lt;/code&gt;&amp;nbsp;keyword to return multiple values from a method, such as quotient and remainder from a division operation.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Calling method&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;            int dividend = 17, divisor = 3;
            int quotient, remainder;

            Divide(dividend, divisor, out quotient, out remainder);

            Console.WriteLine($&quot;Quotient: {quotient}, Remainder: {remainder}&quot;);
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;            int dividend = 17, divisor = 3;
            int quotient, remainder;

            Divide(dividend, divisor, out quotient, out remainder);

            Console.WriteLine($&amp;quot;Quotient: {quotient}, Remainder: {remainder}&amp;quot;);&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Out Method&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;        static void Divide(int dividend, int divisor, out int quotient, out int remainder)
        {
            quotient = dividend / divisor;
            remainder = dividend % divisor;
        }
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;        static void Divide(int dividend, int divisor, out int quotient, out int remainder)
        {
            quotient = dividend / divisor;
            remainder = dividend % divisor;
        }&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol dir=&quot;auto&quot; start=&quot;3&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Using&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;out&lt;/code&gt;&amp;nbsp;with&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;TryParse&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Shows how&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;out&lt;/code&gt;&amp;nbsp;is commonly used with the&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;TryParse&lt;/code&gt;&amp;nbsp;method to convert strings to numeric types safely.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Calling method&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;            string input = &quot;123&quot;;

            if (int.TryParse(input, out int result))
            {
                Console.WriteLine($&quot;Parsing successful: {result}&quot;);
            }
            else
            {
                Console.WriteLine(&quot;Parsing failed.&quot;);
            }
            Console.WriteLine(string.Empty);

           
            input = &quot;123A&quot;;

            if (int.TryParse(input, out result))
            {
                Console.WriteLine($&quot;Parsing successful: {result}&quot;);
            }
            else
            {
                Console.WriteLine(&quot;Parsing failed.&quot;);
            }
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;            string input = &amp;quot;123&amp;quot;;

            if (int.TryParse(input, out int result))
            {
                Console.WriteLine($&amp;quot;Parsing successful: {result}&amp;quot;);
            }
            else
            {
                Console.WriteLine(&amp;quot;Parsing failed.&amp;quot;);
            }
            Console.WriteLine(string.Empty);

           
            input = &amp;quot;123A&amp;quot;;

            if (int.TryParse(input, out result))
            {
                Console.WriteLine($&amp;quot;Parsing successful: {result}&amp;quot;);
            }
            else
            {
                Console.WriteLine(&amp;quot;Parsing failed.&amp;quot;);
            }&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol dir=&quot;auto&quot; start=&quot;4&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Method Overloading with&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;out&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Explores how method overloading works when methods differ by their&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;out&lt;/code&gt;&amp;nbsp;parameters, and how it can be used to provide multiple functionalities.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Calling method&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;            int overloadResult;

            DoSomething(5, out overloadResult); // Calls the first method
            Console.WriteLine(overloadResult);   // Output: 10

            DoSomething(5, 3, out overloadResult); // Calls the second method
            Console.WriteLine(overloadResult);     // Output: 8
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;            int overloadResult;

            DoSomething(5, out overloadResult); // Calls the first method
            Console.WriteLine(overloadResult);   // Output: 10

            DoSomething(5, 3, out overloadResult); // Calls the second method
            Console.WriteLine(overloadResult);     // Output: 8&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Out Method&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;        static void DoSomething(int a, out int b)
        {
            b = a * 2;
        }
        static void DoSomething(int a, int c, out int b)
        {
            b = a + c;
        }
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;        static void DoSomething(int a, out int b)
        {
            b = a * 2;
        }
        static void DoSomething(int a, int c, out int b)
        {
            b = a + c;
        }&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Output&lt;/h2&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3-I4g9of2HDzgd27DyKzTE-0KbkaXUPNvA8TQNxM1WXYG1mweG3Z3u9myKbhpuXX5rmFdXbcOn1hPxLkZuVfxE1RB2fZfEiiqFCIM6O6k9359ZNY5rqrvX9Im81QHwv9e_E4GXCvyA0tyukJjhWc4-QglfsxSQJb7jayEUVt24m752qFdntV7vQ/s865/out-keyword-output.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;444&quot; data-original-width=&quot;865&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3-I4g9of2HDzgd27DyKzTE-0KbkaXUPNvA8TQNxM1WXYG1mweG3Z3u9myKbhpuXX5rmFdXbcOn1hPxLkZuVfxE1RB2fZfEiiqFCIM6O6k9359ZNY5rqrvX9Im81QHwv9e_E4GXCvyA0tyukJjhWc4-QglfsxSQJb7jayEUVt24m752qFdntV7vQ/s16000/out-keyword-output.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Key Takeaways&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a aria-label=&quot;Permalink: Key Takeaways&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/out_Deep_Dive#key-takeaways&quot; id=&quot;user-content-key-takeaways&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Mandatory Assignment:&lt;/span&gt;&amp;nbsp;The&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;out&lt;/code&gt;&amp;nbsp;parameter must be assigned a value within the method before the method returns. If not, the compiler will generate an error.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Difference from&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;ref&lt;/code&gt;:&lt;/span&gt;&amp;nbsp;Unlike&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;ref&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;out&lt;/code&gt;&amp;nbsp;parameters do not need to be initialized before passing them to a method, but they must be initialized within the method.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Multiple Return Values:&lt;/span&gt;&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;out&lt;/code&gt;&amp;nbsp;is an excellent way to return multiple values from a method without using complex data structures.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Overloading Flexibility:&lt;/span&gt;&amp;nbsp;Method overloading with&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;out&lt;/code&gt;&amp;nbsp;parameters allows for flexible method signatures and multiple implementations.&lt;/li&gt;&lt;/ul&gt;</description><link>https://code.oneananda.com/2024/08/c-out-reference-programming-deep-dive.html</link><author>noreply@blogger.com (One-Ananda)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3-I4g9of2HDzgd27DyKzTE-0KbkaXUPNvA8TQNxM1WXYG1mweG3Z3u9myKbhpuXX5rmFdXbcOn1hPxLkZuVfxE1RB2fZfEiiqFCIM6O6k9359ZNY5rqrvX9Im81QHwv9e_E4GXCvyA0tyukJjhWc4-QglfsxSQJb7jayEUVt24m752qFdntV7vQ/s72-c/out-keyword-output.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-4501418427212892039</guid><pubDate>Thu, 22 Aug 2024 23:08:00 +0000</pubDate><atom:updated>2024-08-24T01:56:27.183-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">reference based programming</category><title>C# - ref - Reference Programming - Deep dive</title><description>&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-top: 0px; position: relative;&quot;&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-size: 2em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-size: 16px; font-weight: 400;&quot;&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px !important; padding: 0px 0px 0.3em; position: relative; text-align: justify;&quot; tabindex=&quot;-1&quot;&gt;&#39;ref&#39; - Reference Programming - Deep dive&lt;/h1&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-size: 2em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-size: 16px; font-weight: 400;&quot;&gt;In C# using &#39;ref&#39; keyword is indicating that the parameter is passed by reference rather than value, that means, any changes made to the parameter will be made available outside of the method.&lt;/span&gt;&lt;/h1&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-size: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;The other purpose of using ref is, we can return multiple parameters from a method, this might be very useful in cases where we need multiple values to be evaluated in the caller function.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;We will see how this is happening!&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/h1&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-size: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Example 1: Basic implementation of &#39;ref&#39;&lt;/h2&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-size: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: Example 1: Basic implementation of &#39;ref&#39;&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/ref_Deep_Dive#example-1-basic-implementation-of-ref&quot; id=&quot;user-content-example-1-basic-implementation-of-ref&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; display: flex; font-size: 16px; font-weight: 400; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;            int num = 10;
            Console.WriteLine($&quot;Before method call: {num}&quot;);

            ModifyValue(ref num);

            Console.WriteLine($&quot;After method call: {num}&quot;);

            // Output
            // Before method call: 10
            // After method call: 20
        }
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; background-color: transparent; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;            int num = 10;
            Console.WriteLine($&amp;quot;Before method call: {num}&amp;quot;);

            ModifyValue(ref num);

            Console.WriteLine($&amp;quot;After method call: {num}&amp;quot;);

            // Output
            // Before method call: 10
            // After method call: 20
        }&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Calling method&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; display: flex; font-size: 16px; font-weight: 400; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;        static void ModifyValue(ref int x)
        {
            x = x * 2;
        }
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; background-color: transparent; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;        static void ModifyValue(ref int x)
        {
            x = x * 2;
        }&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h1&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-size: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Example 2: Multiple &#39;ref&#39; implementation&lt;/h2&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-size: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: Example 2: Multiple &#39;ref&#39; implementation&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/ref_Deep_Dive#example-2-multiple-ref-implementation&quot; id=&quot;user-content-example-2-multiple-ref-implementation&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; display: flex; font-size: 16px; font-weight: 400; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;            int result1 = 0, result2 = 0;

            CalculateValues(5, 3, ref result1, ref result2);

            Console.WriteLine($&quot;Sum: {result1}, Difference: {result2}&quot;);
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; background-color: transparent; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;            int result1 = 0, result2 = 0;

            CalculateValues(5, 3, ref result1, ref result2);

            Console.WriteLine($&amp;quot;Sum: {result1}, Difference: {result2}&amp;quot;);&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Calling method&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; display: flex; font-size: 16px; font-weight: 400; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;            static void CalculateValues(int a, int b, ref int sum, ref int difference)
            {
                sum = a + b;
                difference = a - b;
            }
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; background-color: transparent; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;            static void CalculateValues(int a, int b, ref int sum, ref int difference)
            {
                sum = a + b;
                difference = a - b;
            }&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h1&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-size: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Example 3: Handling Reference Types&lt;/h2&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-size: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: Example 3: Handling Reference Types&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/ref_Deep_Dive#example-3-handling-reference-types&quot; id=&quot;user-content-example-3-handling-reference-types&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; display: flex; font-size: 16px; font-weight: 400; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;            // Create a new Person object and set its Name property.
            Person person = new Person { Name = &quot;Alice&quot; };
            Console.WriteLine($&quot;Before: {person.Name}&quot;);

            // Pass the person object by reference.
            ModifyPerson(ref person);

            // The reference to person has been changed inside the method.
            Console.WriteLine($&quot;After: {person.Name}&quot;);

&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; background-color: transparent; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;            // Create a new Person object and set its Name property.
            Person person = new Person { Name = &amp;quot;Alice&amp;quot; };
            Console.WriteLine($&amp;quot;Before: {person.Name}&amp;quot;);

            // Pass the person object by reference.
            ModifyPerson(ref person);

            // The reference to person has been changed inside the method.
            Console.WriteLine($&amp;quot;After: {person.Name}&amp;quot;);
&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Calling method&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; display: flex; font-size: 16px; font-weight: 400; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;        // Method that takes a Person object by reference.
        static void ModifyPerson(ref Person p)
        {
            // Create a new Person object and assign it to the parameter.
            p = new Person { Name = &quot;Bob&quot; };
        }
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; background-color: transparent; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;        // Method that takes a Person object by reference.
        static void ModifyPerson(ref Person p)
        {
            // Create a new Person object and assign it to the parameter.
            p = new Person { Name = &amp;quot;Bob&amp;quot; };
        }&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h1&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-size: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Example 3: Demonstrating String Behavior&lt;/h2&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-size: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: Example 3: Demonstrating String Behavior&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/ref_Deep_Dive#example-3-demonstrating-string-behavior&quot; id=&quot;user-content-example-3-demonstrating-string-behavior&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; display: flex; font-size: 16px; font-weight: 400; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;            // Create a new Person object and set its Name property.
            Person person = new Person { Name = &quot;Alice&quot; };
            Console.WriteLine($&quot;Before: {person.Name}&quot;);

            // Pass the person object by reference.
            ModifyPerson(ref person);

            // The reference to person has been changed inside the method.
            Console.WriteLine($&quot;After: {person.Name}&quot;);

&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; background-color: transparent; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;            // Create a new Person object and set its Name property.
            Person person = new Person { Name = &amp;quot;Alice&amp;quot; };
            Console.WriteLine($&amp;quot;Before: {person.Name}&amp;quot;);

            // Pass the person object by reference.
            ModifyPerson(ref person);

            // The reference to person has been changed inside the method.
            Console.WriteLine($&amp;quot;After: {person.Name}&amp;quot;);
&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Calling method&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; display: flex; font-size: 16px; font-weight: 400; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;        // Method that takes a Person object by reference.
        static void ModifyPerson(ref Person p)
        {
            // Create a new Person object and assign it to the parameter.
            p = new Person { Name = &quot;Bob&quot; };
        }
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; background-color: transparent; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;        // Method that takes a Person object by reference.
        static void ModifyPerson(ref Person p)
        {
            // Create a new Person object and assign it to the parameter.
            p = new Person { Name = &amp;quot;Bob&amp;quot; };
        }&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h1&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Example 4: Using ref in string&lt;/h3&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-size: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: Example 4: Using ref in string&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/ref_Deep_Dive#example-4-using-ref-in-string&quot; id=&quot;user-content-example-4-using-ref-in-string&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; display: flex; font-size: 16px; font-weight: 400; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;            string text = &quot;Hello&quot;;
            Console.WriteLine($&quot;Before: {text}&quot;);

            // Pass the string by reference.
            ModifyString(ref text);

            // The string reference should point to the new string value.
            Console.WriteLine($&quot;After: {text}&quot;);
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; background-color: transparent; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;            string text = &amp;quot;Hello&amp;quot;;
            Console.WriteLine($&amp;quot;Before: {text}&amp;quot;);

            // Pass the string by reference.
            ModifyString(ref text);

            // The string reference should point to the new string value.
            Console.WriteLine($&amp;quot;After: {text}&amp;quot;);&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Calling method&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; display: flex; font-size: 16px; font-weight: 400; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;        static void ModifyString(ref string s)
        {
            // Reassign the reference to a new string instance.
            s = &quot;World&quot;;
        }
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; background-color: transparent; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;        static void ModifyString(ref string s)
        {
            // Reassign the reference to a new string instance.
            s = &amp;quot;World&amp;quot;;
        }&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Important point to be noted:&lt;/span&gt;&amp;nbsp;Even though by natural the&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;string&lt;/code&gt;&amp;nbsp;is reference type, it will not hold the values across methods as it is immutable, that means everytime you are assining a new value it will start referring to a new reference pointer.&lt;/p&gt;&lt;/h1&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Example 5: Using ref in Recursive Methods&lt;/h3&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-size: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: Example 5: Using ref in Recursive Methods&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/ref_Deep_Dive#example-5-using-ref-in-recursive-methods&quot; id=&quot;user-content-example-5-using-ref-in-recursive-methods&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; display: flex; font-size: 16px; font-weight: 400; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;            int number = 1;
            Console.WriteLine($&quot;Original Number: {number}&quot;);

            IncrementRef(ref number, 5);

            Console.WriteLine($&quot;Incremented Number: {number}&quot;);
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; background-color: transparent; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;            int number = 1;
            Console.WriteLine($&amp;quot;Original Number: {number}&amp;quot;);

            IncrementRef(ref number, 5);

            Console.WriteLine($&amp;quot;Incremented Number: {number}&amp;quot;);&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Calling method&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; display: flex; font-size: 16px; font-weight: 400; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;            static void IncrementRef(ref int num, int limit)
            {
                if (num &amp;lt; limit)
                {
                    num++;
                    IncrementRef(ref num, limit);
                }
            }
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; background-color: transparent; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;            static void IncrementRef(ref int num, int limit)
            {
                if (num &amp;lt; limit)
                {
                    num++;
                    IncrementRef(ref num, limit);
                }
            }&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h1&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Example 6: Without Using ref but achive the same functionality&lt;/h3&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-size: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: Example 6: Without Using ref but achive the same functionality&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/ref_Deep_Dive#example-6-without-using-ref-but-achive-the-same-functionality&quot; id=&quot;user-content-example-6-without-using-ref-but-achive-the-same-functionality&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; display: flex; font-size: 16px; font-weight: 400; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;            List&amp;lt;string&amp;gt; LstStr = new List&amp;lt;string&amp;gt;();
            LstStr.Add(&quot;Adding string 1&quot;);
            Console.WriteLine($&quot;Original Count: {LstStr.Count}&quot;);

            ProcessLstStr(LstStr);

            Console.WriteLine($&quot;Current Count: {LstStr.Count}&quot;);
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; background-color: transparent; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;            List&amp;lt;string&amp;gt; LstStr = new List&amp;lt;string&amp;gt;();
            LstStr.Add(&amp;quot;Adding string 1&amp;quot;);
            Console.WriteLine($&amp;quot;Original Count: {LstStr.Count}&amp;quot;);

            ProcessLstStr(LstStr);

            Console.WriteLine($&amp;quot;Current Count: {LstStr.Count}&amp;quot;);&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Calling method&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; display: flex; font-size: 16px; font-weight: 400; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;            private static void ProcessLstStr(List&amp;lt;string&amp;gt; lstStr)
            {
                // Adding values, but not returning
                lstStr.Add(&quot;Adding new string&quot;);
                lstStr.Add(&quot;Adding another new string&quot;);
            }
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; background-color: transparent; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;            private static void ProcessLstStr(List&amp;lt;string&amp;gt; lstStr)
            {
                // Adding values, but not returning
                lstStr.Add(&amp;quot;Adding new string&amp;quot;);
                lstStr.Add(&amp;quot;Adding another new string&amp;quot;);
            }&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;/h1&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Example 7: With and without Using ref - Performance considerations&lt;/h3&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: Example 7: With and without Using ref - Performance considerations&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/ref_Deep_Dive#example-7-with-and-without-using-ref---performance-considerations&quot; id=&quot;user-content-example-7-with-and-without-using-ref---performance-considerations&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Without ref&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; display: flex; font-size: 16px; font-weight: 400; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;            LargeStruct largeStruct = new LargeStruct(1000000);
            Console.WriteLine(&quot;Starting Without ref...&quot;);

            for (int i = 0; i &amp;lt; 1000; i++)
            {
                ProcessLargeStruct(largeStruct);
            }

            Console.WriteLine(&quot;Finished Without ref.&quot;);
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; background-color: transparent; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;            LargeStruct largeStruct = new LargeStruct(1000000);
            Console.WriteLine(&amp;quot;Starting Without ref...&amp;quot;);

            for (int i = 0; i &amp;lt; 1000; i++)
            {
                ProcessLargeStruct(largeStruct);
            }

            Console.WriteLine(&amp;quot;Finished Without ref.&amp;quot;);&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Calling method&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; display: flex; font-size: 16px; font-weight: 400; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;        static void ProcessLargeStruct(LargeStruct ls)
        {
            // Processing large struct...
            ls.Data[0] = 42; // Modify just to simulate some processing
        }
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; background-color: transparent; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;        static void ProcessLargeStruct(LargeStruct ls)
        {
            // Processing large struct...
            ls.Data[0] = 42; // Modify just to simulate some processing
        }&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Performance Considerations:&lt;/span&gt;&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Copying:&lt;/span&gt;&amp;nbsp;Each time&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;ProcessLargeStruct&lt;/code&gt;&amp;nbsp;is called, a&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;full copy of largeStruct is made&lt;/code&gt;. If the struct is large (e.g., contains a large array), this copying process can be&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;slow and memory-intensive&lt;/code&gt;.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Complexity:&lt;/span&gt;&amp;nbsp;The overhead increases with the size of the struct and the number of times the method is called, as more time and memory are required to create and manage the copies.&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;With ref&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; display: flex; font-size: 16px; font-weight: 400; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;            LargeStruct largeStruct = new LargeStruct(1000000);
            Console.WriteLine(&quot;Starting With ref...&quot;);

            for (int i = 0; i &amp;lt; 1000; i++)
            {
                ProcessLargeStruct(ref largeStruct);
            }

            Console.WriteLine(&quot;Finished With ref.&quot;);
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; background-color: transparent; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;            LargeStruct largeStruct = new LargeStruct(1000000);
            Console.WriteLine(&amp;quot;Starting With ref...&amp;quot;);

            for (int i = 0; i &amp;lt; 1000; i++)
            {
                ProcessLargeStruct(ref largeStruct);
            }

            Console.WriteLine(&amp;quot;Finished With ref.&amp;quot;);&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Calling method&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; display: flex; font-size: 16px; font-weight: 400; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;        static void ProcessLargeStruct(ref LargeStruct ls)
        {
            // Processing large struct...
            ls.Data[0] = 42; // Modify just to simulate some processing
        }
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; background-color: transparent; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-size: 14px; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;        static void ProcessLargeStruct(ref LargeStruct ls)
        {
            // Processing large struct...
            ls.Data[0] = 42; // Modify just to simulate some processing
        }&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Performance Considerations:&lt;/span&gt;&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;No Copying: By passing the struct with ref, no copying occurs. The method operates directly on the original struct, significantly reducing the time and memory overhead.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Direct Access: Since the struct is passed by reference, any modifications made within the method are applied directly to the original struct, which can be more efficient.&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Performance Comparison Summary&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Memory Usage &amp;amp; Execution Time:&lt;/span&gt;&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Without ref:&lt;/span&gt;&amp;nbsp;Memory usage and Execution Time increases due to the creation of multiple copies of the large struct.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;With ref:&lt;/span&gt;&amp;nbsp;Memory usage and Execution Time are reduced as no copies are made; the method operates directly on the original struct.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;/div&gt;&lt;/h1&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Output&lt;/h3&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrpCnU2maNlCaOetUlhHX-W0SH9x88pvUxbeGZSHCriSuumQM4CBFgbGiNfhEAeu_OD-BdenwEeDXYuhqfUZaxSvMW6qCs8IafXvhhhpejXqj5evLTa590W8osiWcEieDxM797IbX30aXyFGKB9Nf1jpWdow6HvDVhpBu128coywJol9wc4uyAww/s1686/Output_Screenshot_ref_Deep_Dive.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Output_Screenshot_ref_Deep_Dive&quot; border=&quot;0&quot; data-original-height=&quot;775&quot; data-original-width=&quot;1686&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrpCnU2maNlCaOetUlhHX-W0SH9x88pvUxbeGZSHCriSuumQM4CBFgbGiNfhEAeu_OD-BdenwEeDXYuhqfUZaxSvMW6qCs8IafXvhhhpejXqj5evLTa590W8osiWcEieDxM797IbX30aXyFGKB9Nf1jpWdow6HvDVhpBu128coywJol9wc4uyAww/s16000/Output_Screenshot_ref_Deep_Dive.png&quot; title=&quot;Output_Screenshot_ref_Deep_Dive&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Key Points&lt;/h3&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-size: 16px; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: Key Points&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/ref_Deep_Dive#key-points&quot; id=&quot;user-content-key-points&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Parameter Initialization:&lt;/span&gt;&amp;nbsp;The parameter passed to a method with ref must be initialized before being passed to the method. If not initialized, the compiler will throw an error.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Consistent Usage:&lt;/span&gt;&amp;nbsp;You must use the ref keyword both in the method definition and when calling the method. Omitting ref in either place will result in a compilation error.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 16px; font-weight: 400; margin-bottom: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Reference:&lt;/span&gt;&amp;nbsp;Using ref allows you to modify the value of the argument in the caller&#39;s scope, which is different from passing parameters by value, where the method works with a copy of the argument.&lt;/p&gt;&lt;/h1&gt;&lt;/div&gt;</description><link>https://code.oneananda.com/2024/08/ref-deep-dive.html</link><author>noreply@blogger.com (One-Ananda)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrpCnU2maNlCaOetUlhHX-W0SH9x88pvUxbeGZSHCriSuumQM4CBFgbGiNfhEAeu_OD-BdenwEeDXYuhqfUZaxSvMW6qCs8IafXvhhhpejXqj5evLTa590W8osiWcEieDxM797IbX30aXyFGKB9Nf1jpWdow6HvDVhpBu128coywJol9wc4uyAww/s72-c/Output_Screenshot_ref_Deep_Dive.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-1026453191079574247</guid><pubDate>Sun, 18 Aug 2024 13:02:00 +0000</pubDate><atom:updated>2024-08-18T08:22:33.494-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Amazon EC2</category><category domain="http://www.blogger.com/atom/ns#">Amazon EC2 instances</category><category domain="http://www.blogger.com/atom/ns#">AWS Learning</category><title>AWS Learning 001 - Amazon EC2 - 001 - Instance Components</title><description>&lt;div style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-top: 0px; text-align: left;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span&gt;&lt;code style=&quot;background-color: white; border-radius: 6px; box-sizing: border-box; color: #1f2328; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Amazon Elastic Computing Cloud (EC2)&lt;/code&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;&quot; style=&quot;background-color: white; color: #1f2328;&quot;&gt;&amp;nbsp;is a computing service from&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border-radius: 6px; box-sizing: border-box; color: #1f2328; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Amazon Web Services (AWS),&lt;/code&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;&quot; style=&quot;background-color: white; color: #1f2328;&quot;&gt;&amp;nbsp;this is based on virtual machine concept, where users can rent the machines of their needed configuration to work on the computing part, this is categorized as&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border-radius: 6px; box-sizing: border-box; color: #1f2328; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Infrastructure as a Service (IaaS)&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-top: 0px; text-align: left;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span&gt;&lt;code style=&quot;background-color: white; border-radius: 6px; box-sizing: border-box; color: #1f2328; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/span&gt;&lt;span&gt;This is one of the earliest services released by Amazon after&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Simple Storage Services (S3)&lt;/code&gt;&lt;span&gt;&amp;nbsp;and&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Simple Queue Service (SQS)&lt;/code&gt;&lt;span&gt;&amp;nbsp;(A message queuing service),&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;code style=&quot;border-radius: 6px; box-sizing: border-box; color: #1f2328; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Amazon EC2 instances&lt;/code&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;&quot; style=&quot;background-color: white; color: #1f2328;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;&quot; style=&quot;background-color: white; color: #1f2328;&quot;&gt;are virtual servers the provide computing resources need to run the applications on the cloud.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-top: 0px; text-align: left;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;&quot; style=&quot;background-color: white; color: #1f2328;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;It enables the users to run their application on virtual servers known as instances without need to invest in physical hardware, with EC2 we can scale the resources up and down on need basis, making it to ideal for the business ranging from small to large enterprises.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-top: 0px; text-align: left;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;Amazon EC2 Instance Components - There are several components comes to play when it comes to instance creation.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Understanding EC2 Instance Components&lt;/span&gt;&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Understanding EC2 Instance Components&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/001%20Amazon%20EC2%20Instance%20Components#understanding-ec2-instance-components&quot; id=&quot;user-content-understanding-ec2-instance-components&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/span&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;AMI&lt;/span&gt;&amp;nbsp;- Amazon Machine Image (Can be Windows AMI, Linux, MacOS)&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Instance Type&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Instance Size&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Configuring Instances&lt;/span&gt;&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Configuring Instances&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/001%20Amazon%20EC2%20Instance%20Components#configuring-instances&quot; id=&quot;user-content-configuring-instances&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/span&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Number of Instances&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Billing Type&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Configure VPC (Virtual Private Cloud)&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Configure Subnet&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Configure IP Settings (Public, Private, IPv4, IPv6)&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Configure Domain / Directory Integration&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Configure Placement Group&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Configure IAM Roles&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Configure Shutdown Behavior&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Enable Termination Protection&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Option to Mount EFS (Elastic File System)&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Configure User Data (Scripts/Commands on Launch)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Storage&lt;/span&gt;&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Storage&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/001%20Amazon%20EC2%20Instance%20Components#storage&quot; id=&quot;user-content-storage&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/span&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Add Storage of Preferred Type&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Determine EBS (Elastic Block Store) Volumes When the Instance is Terminated&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Tags&lt;/span&gt;&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Tags&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/001%20Amazon%20EC2%20Instance%20Components#tags&quot; id=&quot;user-content-tags&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/span&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Add Tags for Easy Identification&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Security Groups&lt;/span&gt;&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Security Groups&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/001%20Amazon%20EC2%20Instance%20Components#security-groups&quot; id=&quot;user-content-security-groups&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/span&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Add Security Groups to Act as a Firewall&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Manage Inbound/Outbound Traffic via Security Groups&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Modify at Any Time&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Launch Instance&lt;/span&gt;&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Launch Instance&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/001%20Amazon%20EC2%20Instance%20Components#launch-instance&quot; id=&quot;user-content-launch-instance&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/span&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Confirm setting and launch the instance&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Key Things to Note:&lt;/span&gt;&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Key Things to Note:&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/AWS_Operations/tree/main/Learning/001%20Amazon%20EC2/001%20Amazon%20EC2%20Instance%20Components#key-things-to-note&quot; id=&quot;user-content-key-things-to-note&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/span&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;AMIs cannot be modified post-launch.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;There is no option to change the key pair after instance launch.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Instance types and sizes can&#39;t be changed post launch&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;EIPs (Elastic IPs) are static, won&#39;t changed even after instance restart / stopped and started&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Data on ephemeral storage (instance store) will be lost if the instance is terminated / stopped but will not lost if the instance is restarted&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Security groups are stateful, if you allow any inbound traffic, automatically the outbound is allowed&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;The instance&#39;s public IP address will be changed if it is started and stopped and will not lost if the instance is restarted, additionally if you are using EIP the IP remains the same.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Termination protection disabled by default&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;EC2 instances can be part of Auto Scaling Group (ASG)&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Basic monitoring is available using CloudWatch&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;</description><link>https://code.oneananda.com/2024/08/aws-learning-001-amazon-ec2-001.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-1488378812019086136</guid><pubDate>Wed, 14 Aug 2024 14:49:00 +0000</pubDate><atom:updated>2024-08-14T07:55:47.787-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Alibaba Cloud</category><category domain="http://www.blogger.com/atom/ns#">AWS</category><category domain="http://www.blogger.com/atom/ns#">Azure</category><category domain="http://www.blogger.com/atom/ns#">Cloud Computing</category><category domain="http://www.blogger.com/atom/ns#">Google Cloud</category><category domain="http://www.blogger.com/atom/ns#">IBM Cloud</category><title>Comprehensive Cloud Services Comparison</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhWdU2RH80XyKW_RQ6l-AhK6AoNMHNekDGuwe7DpICC1b1Y4L8UX6eZqAuO3YzVVU2AMxNBliREZWDzW5q0CMJnAjmwJsDuKaeu85x-ryTFlScht3L0wxyGEU6kHRawKVIgR9X0hZ2yte_Q7MARul13N7CTOjDAIhtxiMtT2whpOnZZy4Rx8FNZiQ&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img data-original-height=&quot;2043&quot; data-original-width=&quot;1656&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhWdU2RH80XyKW_RQ6l-AhK6AoNMHNekDGuwe7DpICC1b1Y4L8UX6eZqAuO3YzVVU2AMxNBliREZWDzW5q0CMJnAjmwJsDuKaeu85x-ryTFlScht3L0wxyGEU6kHRawKVIgR9X0hZ2yte_Q7MARul13N7CTOjDAIhtxiMtT2whpOnZZy4Rx8FNZiQ=s16000&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;</description><link>https://code.oneananda.com/2024/08/comprehensive-cloud-services-comparison.html</link><author>noreply@blogger.com (One-Ananda)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEhWdU2RH80XyKW_RQ6l-AhK6AoNMHNekDGuwe7DpICC1b1Y4L8UX6eZqAuO3YzVVU2AMxNBliREZWDzW5q0CMJnAjmwJsDuKaeu85x-ryTFlScht3L0wxyGEU6kHRawKVIgR9X0hZ2yte_Q7MARul13N7CTOjDAIhtxiMtT2whpOnZZy4Rx8FNZiQ=s72-c" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-8079859685293767012</guid><pubDate>Sun, 11 Aug 2024 03:48:00 +0000</pubDate><atom:updated>2024-08-10T20:48:18.836-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Architecture</category><category domain="http://www.blogger.com/atom/ns#">Architecture best practices</category><category domain="http://www.blogger.com/atom/ns#">Performance management</category><title>User Configuration Preloading - Performance management</title><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-top: 0px !important; position: relative;&quot;&gt;&lt;h1 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px !important; padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;User Configuration Preloading&lt;/h1&gt;&lt;a aria-label=&quot;Permalink: User Configuration Preloading&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/Software-Architecture-Best-Practices/blob/main/Software%20Architecture%20QA/User%20Configuration%20Preloading.md#user-configuration-preloading&quot; id=&quot;user-content-user-configuration-preloading&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 25.125px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Performance management question:&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Question # 1&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/Software-Architecture-Best-Practices/blob/main/Software%20Architecture%20QA/User%20Configuration%20Preloading.md#question--1&quot; id=&quot;user-content-question--1&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;I am having an application which the each user configuration is rendered in JSON format, the JSON is huge for each user but the user base is low as within 100 count&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Since the JSON configuration is huge to load, can I load the list of JSON for all users at the time of initialization (say in the morning time, every day), so that it be served whenever any particular user is logging in, so that I can improve the performance ?&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Answer&lt;/h3&gt;&lt;a aria-label=&quot;Permalink: Answer&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/Software-Architecture-Best-Practices/blob/main/Software%20Architecture%20QA/User%20Configuration%20Preloading.md#answer&quot; id=&quot;user-content-answer&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Preloading the JSON configuration for all users at the time of application initialization can really improve performance, especially given the scenario where the user base is small (around 100 users). This approach can reduce the complexity of repeatedly loading large JSON files during each user&#39;s login, thereby speeding up response times.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Considerations for Preloading JSON Configurations:&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Memory Usage:&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Ensure that your application has enough memory to hold all the preloaded JSON configurations simultaneously. Since the configurations are large, assess the total memory footprint.&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Initialization Time:&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;The initial loading process might take some time, especially if the JSON files are very large. Consider scheduling this initialization during low-traffic periods (e.g., early morning) to avoid impacting users.&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Data Consistency:&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;If the JSON configurations are subject to change, you’ll need a strategy to update the preloaded data when changes occur. This could be handled by reloading specific configurations or refreshing all configurations at regular intervals.&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Caching Strategy:&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Implement an effective caching strategy. You could store the preloaded configurations in an in-memory cache, such as using Redis or an in-process memory cache if your application runs on a single server.&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Fallback Mechanism:&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Have a fallback mechanism in case the preloading fails or if a configuration is requested that was not preloaded (e.g., a new user).&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Concurrency:&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Ensure thread safety when accessing the preloaded configurations. Use appropriate locking mechanisms or thread-safe collections.&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Monitoring and Alerts:&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Set up monitoring to track memory usage, load times, and the performance impact of this preloading strategy. This will help in fine-tuning the process.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Security considerations:&lt;/h3&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a aria-label=&quot;Permalink: Security considerations&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/Software-Architecture-Best-Practices/blob/main/Software%20Architecture%20QA/User%20Configuration%20Preloading.md#security-considerations&quot; id=&quot;user-content-security-considerations&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Use data encryption if the data is using sensitive information&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Provide strong access control to avoid data leak&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-size: 1.25em; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Implementation Outline:&lt;/h3&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a aria-label=&quot;Permalink: Implementation Outline:&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/Software-Architecture-Best-Practices/blob/main/Software%20Architecture%20QA/User%20Configuration%20Preloading.md#implementation-outline&quot; id=&quot;user-content-implementation-outline&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Step 1: During application startup, load and parse all user JSON configurations into memory.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Step 2: Store the configurations in a thread-safe in-memory data structure (like a dictionary or a cache).&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Step 3: When a user logs in, retrieve their configuration from the preloaded data instead of loading it from disk.&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Step 4: Periodically refresh the preloaded data or update it as necessary based on changes.&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Conclusion&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Conclusion&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/Software-Architecture-Best-Practices/blob/main/Software%20Architecture%20QA/User%20Configuration%20Preloading.md#conclusion&quot; id=&quot;user-content-conclusion&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Assuming if the JSON does not contain any sensitive information, if it contains we need to go for a different approach like&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 0px !important; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Encryption&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Access Control&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Secure Initialization&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Tokenization&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Minimal Data Exposure&lt;/li&gt;&lt;/ul&gt;</description><link>https://code.oneananda.com/2024/08/user-configuration-preloading.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-425569417386111284</guid><pubDate>Sat, 10 Aug 2024 11:48:00 +0000</pubDate><atom:updated>2024-08-10T04:48:52.015-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Architecture</category><category domain="http://www.blogger.com/atom/ns#">Dependency Injection</category><category domain="http://www.blogger.com/atom/ns#">Lazy Initialization</category><title>Lazy Initialization Vs Dependency Injection</title><description>&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Introduction&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Introduction&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/Lazy_Initialization_Vs_Dependency_Injection#introduction&quot; id=&quot;user-content-introduction&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;In software designing one can easily get deceived with the two concepts as one,&amp;nbsp;Lazy Initialization and Dependency Injection&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Here we are going to see the key differences between Lazy Initialization and Dependency Injection which may sound similar, but in fact not, both the SW design concepts are distinct by nature, we will see this with examples&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Lazy Initialization&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Lazy Initialization&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/Lazy_Initialization_Vs_Dependency_Injection#lazy-initialization&quot; id=&quot;user-content-lazy-initialization&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Lazy Initialization is used to delay the object creation process until it is actually needed,&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;This can improve the performance of the application, we can achieve this by using Lazy class which ensures the object is created when it is accessed for first time&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Dependency Injection&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Dependency Injection&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/Lazy_Initialization_Vs_Dependency_Injection#dependency-injection&quot; id=&quot;user-content-dependency-injection&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Dependency Injection (DI) is a design pattern that helps to decouple the creation of objects from it&#39;s usage, In DI, objects are passed their dependencies rather than creating them internally&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;This improves&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Testability,&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Maintainability,&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;Flexibility&lt;/li&gt;&lt;/ul&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;DI is commonly implemented using an IoC (Inversion of Control) container, which manages the lifecycle of the objects&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;DI Analogy&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: DI Analogy&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/Lazy_Initialization_Vs_Dependency_Injection#di-analogy&quot; id=&quot;user-content-di-analogy&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Imagine you are running a restaurant, you tasked the chef to prepare the meal as well as bring ingredients from store whenever any order comes up, this is without DI,&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Now with DI, you asked the chef to do only to prepare the meal, and provide the ingredients whenever needed by restaurant or other person (here we call it DI container)&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;In this analogy:&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Restaurant: DI container&amp;nbsp;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Chef: Your application or service&amp;nbsp;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Ingredients: Dependencies (services)&amp;nbsp;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Customer’s Order: Request for a service&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Use Case for Dependency Injection (DI)&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Use Case for Dependency Injection (DI)&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/Lazy_Initialization_Vs_Dependency_Injection#use-case-for-dependency-injection-di&quot; id=&quot;user-content-use-case-for-dependency-injection-di&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Scenario: You have an application with multiple components that depend on various services, such as a logging service, database access, and configuration management.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Use Case: DI helps in injecting these dependencies into your components, making the code modular and easier to test. For example, you can inject a mock logging service for unit tests without changing the actual implementation.&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Lazy Initialization Analogy&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Lazy Initialization Analogy&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/Lazy_Initialization_Vs_Dependency_Injection#lazy-initialization-analogy&quot; id=&quot;user-content-lazy-initialization-analogy&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Imagine you have a book that you only want to read if you have free time. Instead of carrying it around all day, you keep it on the shelf and only take it out when you decide to read it. This is like Lazy Initialization in programming.&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Use Cases for Lazy Initialization&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Use Cases for Lazy Initialization&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/Lazy_Initialization_Vs_Dependency_Injection#use-cases-for-lazy-initialization&quot; id=&quot;user-content-use-cases-for-lazy-initialization&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-medium); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Scenario: You have a service or object that is costly to create (e.g., due to heavy computation, large memory usage, or network calls).&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 0px !important; margin-top: 0px;&quot;&gt;Use Case: Use Lazy Initialization to defer the creation of this object until it is actually needed, thus avoiding the overhead of creating it upfront if it may not be used.&lt;/p&gt;</description><link>https://code.oneananda.com/2024/08/lazy-initialization-vs-dependency.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-5013634202636783637</guid><pubDate>Wed, 10 Jul 2024 04:40:00 +0000</pubDate><atom:updated>2024-07-09T21:42:22.280-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C# Advanced</category><category domain="http://www.blogger.com/atom/ns#">Implicit Conversions</category><title>Basic to advanced Implicit Conversions in C#</title><description>&lt;p&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;&quot; style=&quot;background-color: white; color: #1f2328;&quot;&gt;Here We can see&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji&quot; style=&quot;color: #1f2328;&quot;&gt;Implicit Conversions&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;&quot; style=&quot;background-color: white; color: #1f2328;&quot;&gt;examples range from basic to advanced scenarios, demonstrating how implicit conversions can be used in various contexts.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-family: courier; font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Overview&lt;/span&gt;&lt;/h2&gt;&lt;/div&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: Overview&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/Implicit_Conversions#overview&quot; id=&quot;user-content-overview&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-small); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/span&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;&lt;span&gt;Implicit&lt;/span&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;&quot;&gt; conversions in C# allow certain types to be converted to other types without explicit casting. This feature is useful for ensuring type safety and simplifying code. This project provides examples of implicit conversions, including numeric type conversions, class inheritance, and custom conversion operators.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;public static void Example1()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; int intVal = 123;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; double doubleVal = intVal; // Implicit conversion from int to double&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; Console.WriteLine(doubleVal); // Output: 123&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;public static void Example2()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; int IntValue = 10;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; long LongValue;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; // Converting int to long is easy&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; LongValue = IntValue;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; // The above code will work as we are converting from small memory size to bigger one&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; Console.WriteLine(LongValue); // Output: 10&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;public static void Example3()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; int IntValue = 10;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; long LongValue = 1000;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; // Converting int to long is NOT easy possible&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; // Un comment the following line to see the compile time error&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; //IntValue = LongValue;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; // The above code will NOT work as we are converting from bigger memory size to smaller one,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; // Even though we are assigning the values to int that is capable of holding&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; //Compiler Error: Cannot implicitly convert type &#39;long&#39; to &#39;int&#39;.An explicit conversion exists(are you missing a cast?)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-size: medium; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Basic level examples&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative;&quot;&gt;&lt;a aria-label=&quot;Permalink: Basic level examples&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/Implicit_Conversions#basic-level-examples&quot; id=&quot;user-content-basic-level-examples&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-small); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/span&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Implicit Conversion Between Numeric Types&lt;/span&gt;&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Converting a smaller numeric type to a larger numeric type (e.g.,&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;int&lt;/code&gt;&amp;nbsp;to&amp;nbsp;&lt;code style=&quot;background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted)); border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;double&lt;/code&gt;).&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Converting int to long&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Converting from bigger memory size to smaller one (will not compile/work)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Medium level examples&lt;/span&gt;&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Medium level examples&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/Implicit_Conversions#medium-level-examples&quot; id=&quot;user-content-medium-level-examples&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-small); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/span&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Implicit Conversion Between Classes&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Converting from a derived class to a base class.&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;internal class Customer&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;public string Name { get; set; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp;class Local_Customer : Customer&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;public void ContactInPerson()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&quot;ContactInPerson!&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp;class National_Customer : Customer&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;public void ContactViaPhone()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&quot;ContactViaPhone!&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp;class International_Customer : Customer&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;public void ContactViaVideoCall()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&quot;ContactViaVideoCall!&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp;Local_Customer localCustomer = new Local_Customer { Name = &quot;Mason Turner&quot; };&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;National_Customer nationalCustomer = new National_Customer { Name = &quot;Emma Coleman&quot; };&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;International_Customer internationalCustomer = new International_Customer { Name = &quot;Jackson Hayes&quot; };&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;CustomerService service = new CustomerService();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;service.ContactCustomer(localCustomer);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;service.ContactCustomer(nationalCustomer);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;service.ContactCustomer(internationalCustomer);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;&quot; style=&quot;background-color: white; color: #1f2328;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;In the example&amp;nbsp; we can see the following things:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Method Overloading: Allows different methods with the same name to handle various types.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;Implicit Conversion:&lt;/span&gt;&amp;nbsp;The derived classes are implicitly converted to the base class Customer when needed.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Polymorphism: The correct method is chosen based on the type of the argument passed, demonstrating polymorphism in action.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Advanced level examples&lt;/span&gt;&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Advanced level examples&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/Implicit_Conversions#advanced-level-examples&quot; id=&quot;user-content-advanced-level-examples&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-small); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/span&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Creating a custom&amp;nbsp;&lt;span style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600);&quot;&gt;implicit conversion&lt;/span&gt;&amp;nbsp;between two user-defined types.&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;In the example we can see the following things:&lt;/span&gt;&lt;/p&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;The USD class has an implicit conversion operator that converts an EUR instance to USD.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;The EUR class has an implicit conversion operator that converts a USD instance to EUR.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;The conversion rates are hardcoded in the example (1 EUR = 1.10 USD and 1 USD = 0.91 EUR)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;div&gt;internal class Currency&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&amp;nbsp;public class USD&lt;/div&gt;&lt;div&gt;&amp;nbsp;{&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; public decimal Amount { get; }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; public USD(decimal amount)&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; {&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt; Amount = amount;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; // Implicit conversion from EUR to USD&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; public static implicit operator USD(EUR eur)&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; {&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt; // Assuming a conversion rate of 1 EUR = 1.10 USD&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt; return new USD(eur.Amount * 1.10m);&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; public override string ToString()&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; {&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt; return $&quot;{Amount} USD&quot;;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; }&lt;/div&gt;&lt;div&gt;&amp;nbsp;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;public class EUR&lt;/div&gt;&lt;div&gt;&amp;nbsp;{&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; public decimal Amount { get; }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; public EUR(decimal amount)&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; {&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt; Amount = amount;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; // Implicit conversion from USD to EUR&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; public static implicit operator EUR(USD usd)&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; {&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt; // Assuming a conversion rate of 1 USD = 0.91 EUR&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt; return new EUR(usd.Amount * 0.91m);&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; public override string ToString()&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; {&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt; return $&quot;{Amount} EUR&quot;;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt; }&lt;/div&gt;&lt;div&gt;&amp;nbsp;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;// Calling&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;public static void Example1()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;// Convert EUR to USD&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Console.WriteLine(&quot;Convert EUR to USD&quot;);&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;EUR euros = new EUR(100);&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;USD dollars = euros; // You can note there is no explicit assignment&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Console.WriteLine(dollars); // Output: 110 USD&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;public static void Example2()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;// Convert USD to EUR&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Console.WriteLine(&quot;Convert USD to EUR&quot;);&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;USD usDollars = new USD(100);&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;EUR eurosFromDollars = usDollars;// You can note there is no explicit assignment&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Console.WriteLine(eurosFromDollars); // Output: 91 EUR&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;// Convert EUR to USD
Console.WriteLine(&quot;Convert EUR to USD&quot;);
EUR euros = new EUR(100);
USD dollars = euros; // You can note there is no explicit assignment
Console.WriteLine(dollars); // Output: 110 USD
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: auto ease 0s 1 normal none running none; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;align-items: center; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; color: var(--fgColor-accent, var(--color-accent-fg)); cursor: pointer; display: flex; font-weight: var(--base-text-weight-medium, 500); height: var(--control-small-size, 28px); justify-content: center; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px; position: relative; text-wrap: nowrap; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1) 0s, background-color 0s ease 0s, box-shadow 0s ease 0s, border-color 0s ease 0s; user-select: none; vertical-align: middle; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;// Convert EUR to USD
Console.WriteLine(&amp;quot;Convert EUR to USD&amp;quot;);
EUR euros = new EUR(100);
USD dollars = euros; // You can note there is no explicit assignment
Console.WriteLine(dollars); // Output: 110 USD&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;path d=&quot;M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z&quot;&gt;&lt;/path&gt;&lt;path d=&quot;M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z&quot;&gt;&lt;/path&gt;&lt;/span&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;// Convert USD to EUR
Console.WriteLine(&quot;Convert USD to EUR&quot;);
USD usDollars = new USD(100);
EUR eurosFromDollars = usDollars;// You can note there is no explicit assignment
Console.WriteLine(eurosFromDollars); // Output: 91 EUR&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;
  I hope we have learnt what we can do with Implicit conversions at advance level, The complete executable source code is available in the following link 
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://github.com/oneananda/C_Sharp_Examples/tree/main/Implicit_Conversionshttps://github.com/oneananda/C_Sharp_Examples/tree/main/Implicit_Conversions&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;https://github.com/oneananda/C_Sharp_Examples/tree/main/Implicit_Conversionshttps://github.com/oneananda/C_Sharp_Examples/tree/main/Implicit_Conversions&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;

</description><link>https://code.oneananda.com/2024/07/basic-to-advanced-implicit-conversions.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-4978901579076351205</guid><pubDate>Sun, 07 Jul 2024 12:34:00 +0000</pubDate><atom:updated>2024-08-18T08:55:09.072-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET Core</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET Core Middleware</category><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">Extension Methods</category><category domain="http://www.blogger.com/atom/ns#">RequestDelegate</category><title>Implementing RequestDelegate in ASP.NET Core</title><description>&lt;p&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;&lt;code style=&quot;background-color: white; border-radius: 6px; box-sizing: border-box; color: #1f2328; margin: 0px; padding: 0.2em 0.4em;&quot;&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji&quot;&gt;In ASP.NET Core the&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;code style=&quot;border-radius: 6px; box-sizing: border-box; color: #1f2328; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;RequestDelegate&lt;/code&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;&quot; style=&quot;background-color: white; color: #1f2328;&quot;&gt;&amp;nbsp;is a delegate that represents a function that can process an HTTP request. It is a fundamental part of the middleware pipeline in ASP.NET Core and is used to define the sequence of operations that handle an HTTP request and produce a response.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;This will do the following process&lt;/span&gt;&lt;/h3&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Process an Incoming Request: Each middleware component can inspect, modify, or process the incoming HTTP request, Except for &quot;No-Op Middleware&quot; which is just passing the command to next Middleware (does nothing other than this, and not recommended)&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Modify the Response (Optional): Middleware components can also modify the HTTP response before it is sent back to the client. This step is optional and depends on the middleware&#39;s purpose.&lt;/span&gt;&lt;/li&gt;&lt;li style=&quot;box-sizing: border-box; margin-top: 0.25em;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Call the Next Middleware Component in the Pipeline: Middleware components usually call the next component in the pipeline to continue the request processing. This is done by invoking the RequestDelegate passed to the middleware.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji&quot; style=&quot;color: #1f2328; font-size: medium;&quot;&gt;&lt;div&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;Step 1 : Create a CustomMiddleware Class:&lt;/h3&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;The CustomMiddleware class has a constructor that accepts a RequestDelegate parameter, which represents the next middleware in the pipeline. The InvokeAsync method is where the request processing logic is implemented. Before calling _next(context), you can add logic to handle the request. After calling _next(context), you can add logic to handle the response.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;

&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;public class CustomMiddleware&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp;private readonly RequestDelegate _next;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp;public CustomMiddleware(RequestDelegate next)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp;_next = next;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp;public async Task Invoke(HttpContext context)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp;// Do something with the request before calling the next middleware&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp;Console.WriteLine($&quot;Handling request in CustomMiddleware&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp;await _next(context);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp;// Do something with the response after calling the next middleware&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;nbsp; &amp;nbsp;Console.WriteLine($&quot;Finished handling request in CustomMiddleware&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Step 2: Create a CustomMiddlewareExtensions Class:&lt;/span&gt;&lt;/h3&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;a aria-label=&quot;Permalink: CustomMiddlewareExtensions Class:&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/asp_dot_net_core_projects/blob/main/014_RequestDelegate_Implementation/README.md#custommiddlewareextensions-class&quot; id=&quot;user-content-custommiddlewareextensions-class&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-small); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/span&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;This class contains an extension method UseCustomMiddleware to add the custom middleware to the application builder.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;


&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;public static class CustomMiddlewareExtensions&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: medium; white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: medium; white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;/// Extension method to add the CustomMiddleware to the application&#39;s request pipeline.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: medium; white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: medium; white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;/// &amp;lt;param name=&quot;app&quot;&amp;gt;The IApplicationBuilder instance.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: medium; white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;/// &amp;lt;returns&amp;gt;The IApplicationBuilder instance with the CustomMiddleware added to the pipeline.&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: medium; white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public static IApplicationBuilder UseCustomMiddleware(this IApplicationBuilder app)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: medium; white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: medium; white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;// Adds the CustomMiddleware to the application&#39;s request pipeline.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: medium; white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;return app.UseMiddleware&amp;lt;CustomMiddleware&amp;gt;();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: medium; white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative;&quot;&gt;&lt;h3 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24);&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Step 3: Create a Startup Class:&lt;/span&gt;&lt;/h3&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;a aria-label=&quot;Permalink: Startup Class:&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/asp_dot_net_core_projects/blob/main/014_RequestDelegate_Implementation/README.md#startup-class&quot; id=&quot;user-content-startup-class&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-small); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 1; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 12.5px; transform: translateY(-50%); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/span&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;In the Configure method, app.UseCustomMiddleware() adds the custom middleware to the request pipeline. app.Run() is a final middleware that processes the request and generates a response.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji&quot; style=&quot;color: #1f2328; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;background-color: white; box-sizing: border-box; position: relative;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Output : In Console&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Handling request in CustomMiddleware
Finished handling request in AdditionalMiddleware
Finished handling request in CustomMiddleware &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Advanced Topics:&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative; white-space: normal;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Short-circuiting the middleware&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Short-circuiting the middleware&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/asp_dot_net_core_projects/tree/main/014_RequestDelegate_Implementation#short-circuiting-the-middleware&quot; id=&quot;user-content-short-circuiting-the-middleware&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-small); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul dir=&quot;auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; padding-left: 2em; white-space: normal;&quot;&gt;&lt;li style=&quot;box-sizing: border-box;&quot;&gt;To Short-circuiting the middleware, we are purposefully not passing the command next and see what happens&lt;/li&gt;&lt;/ul&gt;&lt;div style=&quot;color: #1f2328;&quot;&gt;&lt;span face=&quot;-apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; white-space: normal;&quot;&gt;The pipeline will closes abruptly, To see Short-circuiting uncomment the lines mentioned&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;public class ShortCircuitMiddleware&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; private readonly RequestDelegate _next;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; public ShortCircuitMiddleware(RequestDelegate next)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _next = next;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; public async Task InvokeAsync(HttpContext context)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Short-circuit the pipeline and generate a response&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; context.Response.StatusCode = 403;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; await context.Response.WriteAsync(&quot;Forbidden&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Does not call the next middleware&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative; white-space: normal;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;    &lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;// Short-circuiting the middleware
    app.Use(async (context, next) =&amp;gt;
    {
        var shortCircuitMiddleware = new ShortCircuitMiddleware(next);
        await shortCircuitMiddleware.InvokeAsync(context);
    });
&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative; white-space: normal;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;NoOpMiddleware&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a aria-label=&quot;Permalink: NoOpMiddleware&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/asp_dot_net_core_projects/tree/main/014_RequestDelegate_Implementation#noopmiddleware&quot; id=&quot;user-content-noopmiddleware&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-small); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; white-space: normal;&quot;&gt;NoOpMiddleware - Does nothing other than passing the control to next middleware&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;public class NoOpMiddleware&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;private readonly RequestDelegate _next;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;public NoOpMiddleware(RequestDelegate next)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_next = next;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;public async Task InvokeAsync(HttpContext context)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// No specific processing on the request&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Call the next middleware&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;await _next(context);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;span style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Noto Sans, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; white-space: normal;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative; white-space: normal;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;    app.Use(async (context, next) =&amp;gt;
    {
        var noOpMiddleware = new NoOpMiddleware(next);
        await noOpMiddleware.InvokeAsync(context);
    });&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;;&quot;&gt;&lt;span&gt;&lt;code style=&quot;color: #333333; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative; text-align: start;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Adding multiple middlewares to the application&#39;s request pipeline in a single extension&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Adding multiple middlewares to the application&#39;s request pipeline in a single extension&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/asp_dot_net_core_projects/tree/main/014_RequestDelegate_Implementation#adding-multiple-middlewares-to-the-applications-request-pipeline-in-a-single-extension&quot; id=&quot;user-content-adding-multiple-middlewares-to-the-applications-request-pipeline-in-a-single-extension&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-small); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 33.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); box-sizing: border-box; color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative; text-align: start;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;background-color: var(--bgColor-muted, var(--color-canvas-subtle)); border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: transparent; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;    public static IApplicationBuilder UseMultipleCustomMiddlewares(this IApplicationBuilder app)
    {
        // Adds the AdditionalMiddleware1 and AdditionalMiddleware2 to the application&#39;s request pipeline.
        app.UseMiddleware&amp;lt;AdditionalMiddleware1&amp;gt;();
        return app.UseMiddleware&amp;lt;AdditionalMiddleware2&amp;gt;();
    }&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;code style=&quot;color: #333333; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;;&quot;&gt;&lt;span&gt;&lt;code style=&quot;color: #333333; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;&lt;div class=&quot;markdown-heading&quot; dir=&quot;auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; position: relative; text-align: start;&quot;&gt;&lt;h2 class=&quot;heading-element&quot; dir=&quot;auto&quot; style=&quot;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted)); box-sizing: border-box; font-weight: var(--base-text-weight-semibold, 600); line-height: 1.25; margin-bottom: var(--base-size-16); margin-top: var(--base-size-24); padding-bottom: 0.3em;&quot; tabindex=&quot;-1&quot;&gt;Conclusion&lt;/h2&gt;&lt;a aria-label=&quot;Permalink: Conclusion&quot; class=&quot;anchor&quot; href=&quot;https://github.com/oneananda/asp_dot_net_core_projects/tree/main/014_RequestDelegate_Implementation#conclusion&quot; id=&quot;user-content-conclusion&quot; style=&quot;align-items: center; background-color: transparent; border-radius: var(--borderRadius-small); box-sizing: border-box; display: flex; float: left; height: 28px; justify-content: center; left: -28px; line-height: 1; margin: auto; opacity: 0; padding-right: var(--base-size-4); position: absolute; text-underline-offset: 0.2rem; top: 18.9271px; transform: translateY(calc(-50% - 0.3rem)); width: 28px;&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-link&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;path d=&quot;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; text-align: start;&quot;&gt;Every middleware component must at least handle the HttpContext to either process it or pass it to the next middleware.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; text-align: start;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: var(--base-size-16); margin-top: 0px; text-align: start;&quot;&gt;Modifying the response and calling the next middleware are optional steps, depending on the middleware&#39;s purpose.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: 0px; margin-top: 0px; text-align: start;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; margin-bottom: 0px; margin-top: 0px; text-align: start;&quot;&gt;The extent of request processing can range from extensive modifications to simple logging or even doing nothing specific.&lt;/p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;code style=&quot;color: #333333; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;code style=&quot;color: #333333; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;I hope we have learnt what&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border-radius: 6px; box-sizing: border-box; color: #1f2328; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); margin: 0px; padding: 0.2em 0.4em; text-align: left; white-space-collapse: break-spaces;&quot;&gt;RequestDelegate&lt;/code&gt;&lt;span style=&quot;color: #1f2328; font-family: courier; text-align: left;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;can do,&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;color: #333333; font-family: courier; text-align: justify;&quot;&gt;The complete executable source code is available in the following link&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: courier; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;;&quot;&gt;&lt;a href=&quot;https://github.com/oneananda/asp_dot_net_core_projects/tree/main/014_RequestDelegate_Implementation&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;https://github.com/oneananda/asp_dot_net_core_projects/tree/main/014_RequestDelegate_Implementation&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto; position: relative;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; color: var(--fgColor-default, var(--color-fg-default)); font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description><link>https://code.oneananda.com/2024/07/implementing-requestdelegate-in-aspnet.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-2654686702270348745</guid><pubDate>Sat, 06 Jul 2024 08:17:00 +0000</pubDate><atom:updated>2024-07-06T01:26:54.449-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET Core</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET Core API Versioning</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET Core WebAPI</category><title>ASP.NET Core Web API Advanced Versioning Strategies</title><description>&lt;p&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;&lt;span style=&quot;background-color: white; color: #1f2328;&quot;&gt;This example demonstrates multiple advanced API versioning strategies in ASP.NET Core. This includes examples of URL Path Versioning, Query String Versioning, Header Versioning, Media Type Versioning, and explains the use of the&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border-radius: 6px; box-sizing: border-box; color: #1f2328; margin: 0px; padding: 0.2em 0.4em; white-space-collapse: break-spaces;&quot;&gt;Microsoft.AspNetCore.Mvc.Versioning&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #1f2328;&quot;&gt;&amp;nbsp;library for structured version management.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;We will look into following API Versioning Strategies&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;URL Path Versioning&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;Query String Versioning&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;Header Versioning&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;Media Type Versioning&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;ASP.NET Core API Versioning Library&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;Combining Multiple Versioning Strategies&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;&lt;u&gt;&lt;i&gt;URL Path Versioning:&lt;/i&gt;&lt;/u&gt;&amp;nbsp;In URL path versioning, the version number is included in the URL path. This is the most straightforward approach and makes the version explicit in the endpoint.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;div&gt;// URL Path Versioning -- V1&lt;/div&gt;&lt;div&gt;[Route(&quot;api/v1/products&quot;)]&lt;/div&gt;&lt;div&gt;[ApiController]&lt;/div&gt;&lt;div&gt;public class ProductsV1 : ControllerBase&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;[HttpGet]&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public IActionResult Get() =&amp;gt; Ok(&quot;This is version 1.0&quot;);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;// URL Path Versioning -- V2&lt;/div&gt;&lt;div&gt;[Route(&quot;api/v2/products&quot;)]&lt;/div&gt;&lt;div&gt;[ApiController]&lt;/div&gt;&lt;div&gt;public class ProductsV2 : ControllerBase&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;[HttpGet]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public IActionResult Get() =&amp;gt; Ok(&quot;This is version 2.0&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;/api/products?apiVersion=1&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;/api/products?apiVersion=2&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: large;&quot;&gt;&lt;i&gt;&lt;u&gt;Query String Versioning:&lt;/u&gt;&lt;/i&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: large;&quot;&gt;With query string versioning, the version number is specified as a query parameter in the URL and it will be accessed by &#39;&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;[FromQuery]&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: large;&quot;&gt;&#39; attribute&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;div style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;// Query String Versioning&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;[HttpGet]&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;public IActionResult Get([FromQuery] string apiVersion)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if (apiVersion == &quot;1.0&quot;)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;return Ok(&quot;This is version 1.0&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;else if (apiVersion == &quot;2.0&quot;)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;return Ok(&quot;This is version 2.0&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;else&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;return BadRequest(&quot;Invalid version&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;&lt;i&gt;&lt;u&gt;Header Versioning&lt;/u&gt;&lt;/i&gt;&lt;/span&gt;&lt;span&gt;&lt;span style=&quot;font-family: courier; font-size: large;&quot;&gt;&lt;i&gt;&lt;u&gt;:&lt;/u&gt;&lt;/i&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;In header versioning, the version information is included in the HTTP headers of the request&amp;nbsp;and it will be accessed by &#39;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;[FromHeader(Name = &quot;api-version&quot;)]&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;&#39; attribute&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: large;&quot;&gt;// Header Versioning&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;[HttpGet]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;public IActionResult Get([FromHeader(Name = &quot;api-version&quot;)] string apiVersion)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if (apiVersion == &quot;1,0&quot;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;return Ok(&quot;This is version 1.0&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;else if (apiVersion == &quot;2.0&quot;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;return Ok(&quot;This is version 2.0&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;return BadRequest(&quot;Invalid version&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;i&gt;&lt;u&gt;Media Type Versioning&lt;/u&gt;&lt;/i&gt;&lt;/span&gt;&lt;i style=&quot;font-size: x-large;&quot;&gt;&lt;u&gt;:&lt;/u&gt;&lt;/i&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;Also known as &quot;Content Negotiation,&quot; media type versioning includes the version in the Accept header using custom media types&amp;nbsp;and it will be accessed by &#39;&lt;/span&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;[FromHeader(Name = &quot;Accept&quot;)]&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;&#39; attribute&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;

&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;// Media Type Versioning&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;[HttpGet]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;public IActionResult Get([FromHeader(Name = &quot;Accept&quot;)] string acceptHeader)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if (acceptHeader.Contains(&quot;application/vnd.company.v1+json&quot;))&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;return Ok(&quot;This is version 1.0&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;else if (acceptHeader.Contains(&quot;application/vnd.company.v2+json&quot;))&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;return Ok(&quot;This is version 2.0&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;return BadRequest(&quot;Invalid version&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;i&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;u&gt;ASP.NET Core API Versioning Library&lt;/u&gt;&lt;/span&gt;&lt;u style=&quot;font-size: x-large;&quot;&gt;:&lt;/u&gt;&lt;/i&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;The ASP.NET Core API Versioning Library is a tool that simplifies implementing versioning in ASP.NET Core applications. It supports multiple versioning methods, provides comprehensive configuration options, and integrates well with ASP.NET Core&#39;s routing and dependency injection features.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;Note that we need to specify the controller attribute (&lt;/span&gt;&lt;span style=&quot;font-family: monospace; font-size: large;&quot;&gt;ApiVersion&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: large;&quot;&gt;) and map that in the methods (&lt;/span&gt;&lt;span style=&quot;font-family: monospace; font-size: large;&quot;&gt;MapToApiVersion&lt;/span&gt;&lt;span style=&quot;font-family: courier; font-size: large;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;

&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;// Using API Version Library&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;div&gt;[Route(&quot;api/[controller]&quot;)]&lt;/div&gt;&lt;div&gt;[ApiController]&lt;/div&gt;&lt;div&gt;[ApiVersion(&quot;1.0&quot;)]&lt;/div&gt;&lt;div&gt;[ApiVersion(&quot;2.0&quot;)]&lt;/div&gt;&lt;div&gt;public class RegionController : ControllerBase&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;[HttpGet]&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;[MapToApiVersion(&quot;1.0&quot;)]&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public IActionResult GetV1() =&amp;gt; Ok(&quot;This is version 1.0&quot;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;[HttpGet]&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;[MapToApiVersion(&quot;2.0&quot;)]&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public IActionResult GetV2() =&amp;gt; Ok(&quot;This is version 2.0&quot;);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;i&gt;&lt;u&gt;Combining Multiple Versioning Strategies&lt;span style=&quot;font-size: large;&quot;&gt;:&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Combining multiple versioning strategies involves using more than one method to handle versioning. For example, you might use both URL path versioning and header versioning to provide flexibility for different clients.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;


&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;// In Program.cs or Startup.cs file&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;builder.Services.AddApiVersioning(options =&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;options.DefaultApiVersion = new Asp.Versioning.ApiVersion(1, 0);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;options.AssumeDefaultVersionWhenUnspecified = true;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;options.ReportApiVersions = true;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;options.ApiVersionReader = ApiVersionReader.Combine(&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;new QueryStringApiVersionReader(&quot;api-version&quot;),&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;new HeaderApiVersionReader(&quot;api-version&quot;));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;})&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;.AddApiExplorer(options =&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;options.GroupNameFormat = &quot;&#39;v&#39;VVV&quot;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace; font-size: medium;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;options.SubstituteApiVersionInUrl = true;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;});&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;code&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;I hope we have learnt different versioning strategies,&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;The complete executable source code is available in the following link&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier; font-size: medium;&quot;&gt;&lt;a href=&quot;https://github.com/oneananda/asp_dot_net_core_projects/tree/main/009_API_Versioning_Strategies&quot;&gt;Source code for ASP.NET Core Web API with Advanced Versioning Strategies&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;

</description><link>https://code.oneananda.com/2024/07/aspnet-core-web-api-with-advanced.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-2535613006421581379</guid><pubDate>Sat, 06 Jul 2024 06:40:00 +0000</pubDate><atom:updated>2024-07-05T23:40:37.925-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET Core</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET Core Configuration</category><category domain="http://www.blogger.com/atom/ns#">Building Dynamic SQL in C#</category><category domain="http://www.blogger.com/atom/ns#">Dependency Injection</category><category domain="http://www.blogger.com/atom/ns#">Options Pattern</category><title>Using Options Pattern in ASP.NET Core for managing application settings</title><description>&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;To fetch a customized config values from &quot;appsettings.json&quot; in&amp;nbsp;ASP.NET Core is never easier before, we can use &quot;Options Pattern&quot; to map the config values to a class&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;Here is an example for&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&quot;Options Pattern&quot;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;i&gt;&lt;u&gt;Step 1:&lt;/u&gt;&lt;/i&gt; Create a appsettings.json file or add the section &quot;&lt;span&gt;AppSettings&lt;/span&gt;&quot; like this&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &quot;AppSettings&quot;: {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &quot;APIUrl&quot;: &quot;MyAPIUrl&quot;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &quot;APIKey&quot;: &quot;MyAPIKey&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; },&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &quot;Logging&quot;: {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &quot;LogLevel&quot;: {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Default&quot;: &quot;Information&quot;,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;Microsoft.AspNetCore&quot;: &quot;Warning&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; },&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &quot;AllowedHosts&quot;: &quot;*&quot;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;}&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;

&lt;p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;i&gt;&lt;u&gt;Step 2: &lt;/u&gt;&lt;/i&gt;Create a class &quot;MyAppSettings&quot; which should reflect the type of &quot;&lt;span&gt;AppSettings&lt;/span&gt;&quot;&lt;/span&gt;&lt;/p&gt;


&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;public class MyAppSettings&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public string APIUrl { get; set; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public string APIKey { get; set; }&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;i&gt;&lt;u&gt;Step 3: &lt;/u&gt;&lt;/i&gt;Bind MyAppSettings to the&amp;nbsp;ConfigureServices&amp;nbsp;section&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;public void ConfigureServices(IServiceCollection services)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;// Bind MyAppSettings to the configuration section&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;services.Configure&amp;lt;MyAppSettings&amp;gt;(_configuration.GetSection(&quot;AppSettings&quot;));&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;i&gt;&lt;u&gt;Step 4: &lt;/u&gt;&lt;/i&gt;In the Controller inject it and get access to the values from configuration&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;public class HomeController : Controller&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;font-family: monospace;&quot;&gt;{&lt;/div&gt;&lt;div style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;private readonly MyAppSettings _myAppSettings;&lt;/div&gt;&lt;div style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public HomeController(IOptions&amp;lt;MyAppSettings&amp;gt; myAppSettings)&lt;/div&gt;&lt;div style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/div&gt;&lt;div style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;_myAppSettings = myAppSettings.Value;&lt;/div&gt;&lt;div style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/div&gt;&lt;div style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public IActionResult Index()&lt;/div&gt;&lt;div style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/div&gt;&lt;div style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;ViewBag.APIUrl = _myAppSettings.APIUrl;&lt;/div&gt;&lt;div style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;ViewBag.APIKey = _myAppSettings.APIKey;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;return View();&lt;/div&gt;&lt;div style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/div&gt;&lt;div style=&quot;font-family: monospace;&quot;&gt;}&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #333333; font-size: 14px; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;The complete executable source code is available in the following link :&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #333333; font-size: 14px; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; color: #333333; font-size: 14px; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;a href=&quot;https://github.com/oneananda/asp_dot_net_core_projects/tree/main/007_Options_Pattern_Configuration&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Options_Pattern_Configuration_Example Source code&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
</description><link>https://code.oneananda.com/2024/07/using-options-pattern-in-aspnet-core.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-24657923.post-6488768701328359739</guid><pubDate>Sat, 06 Jul 2024 04:35:00 +0000</pubDate><atom:updated>2024-07-05T22:04:11.097-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET Core</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET Core Middleware</category><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">Custom Middleware</category><category domain="http://www.blogger.com/atom/ns#">Extension Methods</category><title>Creating custom middleware in asp.net core</title><description>&lt;p&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;The &lt;b&gt;&quot;Middleware Request Logging&quot;&lt;/b&gt; application, is designed to demonstrate how to implement custom middleware for logging HTTP requests in an ASP.NET Core application. Here is an overview of the project concept:&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;The application illustrates the creation of a custom middleware in ASP.NET Core that logs details of incoming HTTP requests. This can be useful for monitoring and debugging purposes, providing insights into the requests hitting your application.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Key Components&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;i&gt;Custom Middleware: &lt;/i&gt;The core of the project is a custom middleware component that intercepts HTTP requests and logs relevant information.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;i&gt;Middleware Registration: &lt;/i&gt;The middleware is registered in the ASP.NET Core pipeline, ensuring it processes requests as they come in.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;i&gt;Logging:&lt;/i&gt; The middleware uses a logging mechanism (like ILogger) to record details such as the HTTP method, URL, headers, and possibly the body of the request.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;div&gt;&lt;b&gt;Steps&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;u&gt;&lt;i&gt;Create Middleware Class&lt;/i&gt;:&lt;/u&gt; Implement a class that defines the middleware logic. This class should have a InvokeAsync method that takes an HttpContext parameter.&lt;/div&gt;

  &lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;public async Task InvokeAsync(HttpContext context)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;_logger.LogInformation($&quot;Request: {context.Request.Method} {context.Request.Path}&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;await _requestDelegate(context);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;u&gt;&lt;i&gt;Use ILogger&lt;/i&gt;:&lt;/u&gt; Inject an ILogger instance into the middleware class to log the request details.&lt;/div&gt;
  
  
  &lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;
    
private readonly ILogger&lt;requestloggingmiddleware&gt; _logger;&amp;nbsp;&lt;/requestloggingmiddleware&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;requestloggingmiddleware&gt;&lt;br /&gt;&lt;/requestloggingmiddleware&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;requestloggingmiddleware&gt;public RequestLoggingMiddleware(ILogger&lt;requestloggingmiddleware&gt; logger)&amp;nbsp;&lt;/requestloggingmiddleware&gt;&lt;/requestloggingmiddleware&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;requestloggingmiddleware&gt;&lt;requestloggingmiddleware&gt;{&amp;nbsp;&lt;/requestloggingmiddleware&gt;&lt;/requestloggingmiddleware&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;requestloggingmiddleware&gt;&lt;requestloggingmiddleware&gt;&amp;nbsp; &amp;nbsp; _logger = logger;&amp;nbsp;&lt;/requestloggingmiddleware&gt;&lt;/requestloggingmiddleware&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;requestloggingmiddleware&gt;&lt;requestloggingmiddleware&gt;}
    
    &lt;/requestloggingmiddleware&gt;&lt;/requestloggingmiddleware&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;requestloggingmiddleware&gt;&lt;requestloggingmiddleware&gt;&lt;br /&gt;&lt;/requestloggingmiddleware&gt;&lt;/requestloggingmiddleware&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;u&gt;Create an Extension method:&lt;/u&gt;&lt;/i&gt;&amp;nbsp;In a separate class create an extension method&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;div&gt;public static class RequestLoggingMiddlewareExtension&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;public static IApplicationBuilder UseRequestLogging(this IApplicationBuilder builder)&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;		&lt;/span&gt;return builder.UseMiddleware&amp;lt;RequestLoggingMiddleware&amp;gt;();&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
  
  
  
  
  &lt;div&gt;&lt;i&gt;&lt;u&gt;Register Middleware:&lt;/u&gt;&lt;/i&gt; In the Startup class, register the custom middleware in the Configure method using the app.UseMiddleware&amp;lt;YourMiddlewareClass&amp;gt;() syntax.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
    
      &lt;div&gt;&lt;code&gt;
    app.UseRequestLogging();
        
            &lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
    &lt;div&gt;&lt;i&gt;&lt;u&gt;Run the Application:&lt;/u&gt;&lt;/i&gt; Build and run the application to see the middleware in action. HTTP requests will be logged as they are processed.&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The complete executable source code is available in the following link :&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://github.com/oneananda/asp_dot_net_core_projects/tree/main/003_Middleware_Request_Logging&quot;&gt;https://github.com/oneananda/asp_dot_net_core_projects/tree/main/003_Middleware_Request_Logging&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</description><link>https://code.oneananda.com/2024/07/creating-custom-middleware-in-aspnet.html</link><author>noreply@blogger.com (One-Ananda)</author><thr:total>0</thr:total></item></channel></rss>