<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rocco Scaramuzzi on Medium]]></title>
        <description><![CDATA[Stories by Rocco Scaramuzzi on Medium]]></description>
        <link>https://medium.com/@rocco.scaramuzzi?source=rss-f1d27c73c5fe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*r0gD_eZzJWIb4rgRNMdMZQ.jpeg</url>
            <title>Stories by Rocco Scaramuzzi on Medium</title>
            <link>https://medium.com/@rocco.scaramuzzi?source=rss-f1d27c73c5fe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 10:24:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rocco.scaramuzzi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why MACH (Microservices, API-First, Cloud Native, Headless) Still Needs Explaining — And the Simple…]]></title>
            <link>https://medium.com/rocco-scaramuzzi-tech/why-mach-microservices-api-first-cloud-native-headless-still-needs-explaining-and-the-simple-867da7dd1990?source=rss-f1d27c73c5fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/867da7dd1990</guid>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[digital-transformation]]></category>
            <dc:creator><![CDATA[Rocco Scaramuzzi]]></dc:creator>
            <pubDate>Tue, 17 Mar 2026 13:55:57 GMT</pubDate>
            <atom:updated>2026-03-17T14:23:46.576Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Why MACH (Microservices, API-First, Cloud Native, Headless) Still Needs Explaining — And the Simple Analogy That Finally Made It Clear</strong></h3><p>A few months ago, after a long day of meetings in New York, a colleague asked me a question while we walked back to the hotel:</p><p><strong>“Rocco, why do we need MACH composable?<br>Why not just take a big platform and customize it?”</strong></p><p>As a Technical Director coming from a software engineering background, my instinct was to give the architectural explanation:</p><ul><li>decoupled capabilities</li><li>independent deployments</li><li>API‑first patterns</li><li>elastic scaling</li><li>event‑driven messaging</li></ul><p>Those principles matter.<br>But I’ve learned they don’t land with everyone — especially when the question behind the question is really:</p><p><strong>“Why does this matter for the business?”</strong></p><p>So that night, back in my hotel room, I thought about how to explain MACH without using a single technical term — something grounded in a real‑life experience.</p><p>And I realized the analogy was right in front of me:</p><p><strong>the way my family actually travels.</strong></p><h3><strong>🏝️ **Two Ways to Travel: Resort vs. Airbnb</strong></h3><p>A Straightforward Model for Understanding MACH vs. Monolith**</p><p>As an Italian father of two young kids — a 1‑year‑old and a 3‑year‑old — our trips are less about “vacation” and more about “structured survival.”</p><p>And that, surprisingly, is the perfect framework for understanding modern architecture choices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ypvMec8VXmCExS6FxESC3Q.png" /></figure><h4><strong>1. The All‑Inclusive Resort (Monolithic Platform)</strong></h4><p>An all‑inclusive resort gives you:</p><ul><li>a single vendor</li><li>a single package</li><li>a single integrated experience</li></ul><p>Everything works… as long as you operate within the predefined rules:</p><ul><li>Dinner is at <em>their</em> time</li><li>Drinks come from <em>their</em> list</li><li>Activities run on <em>their</em> schedule</li></ul><p>Convenient — until your needs deviate.</p><p>Anyone who has traveled with young children knows:<br> Schedules collapse instantly.<br> Needs change by the minute.<br> Predictability is a fantasy.</p><p>The moment your requirements fall outside the resort’s template, you hit constraints:</p><ul><li>extra cost</li><li>long waiting times</li><li>or no option at all</li></ul><p>This is how a <strong>monolith</strong> operates.</p><p>It offers CMS, commerce, payments, search, CRM, OMS — bundled.<br> But the second your business needs something outside the package, flexibility drops and cost increases.</p><p>It works — but only if your business fits the vendor’s model.</p><h4><strong>2. The Airbnb‑Style Trip (MACH Architecture)</strong></h4><p>An Airbnb‑style trip is inherently composable.</p><p>You choose:</p><ul><li>your accommodation</li><li>your restaurants</li><li>your timing</li><li>your daily structure</li></ul><p>Most importantly, you adapt everything to the real needs of your family.</p><p>If my 3‑year‑old is hungry at 17:30?<br> We find food.</p><p>If my 1‑year‑old needs a nap earlier than expected?<br> We adjust.</p><p>If both need something different at the same time?<br> We accommodate that without fighting the system.</p><p>This is <strong>MACH</strong> in architectural form:</p><ul><li>independent systems</li><li>independently scalable</li><li>independently deployable</li><li>chosen based on business needs</li><li>composed into one experience layer</li></ul><p>You build the digital “trip” that fits your customers — not the one that fits the software vendor.</p><h3><strong>🧩 The Kids Are a Perfect Microservices Analogy</strong></h3><p>My two children operate on completely different rhythms:<br> different needs, different energy levels, different failure points.</p><p>They are, unintentionally, a perfect analogy for <strong>microservices</strong>:</p><ul><li>each autonomous</li><li>each with its own lifecycle</li><li>each requiring independent scaling</li><li>each reacting differently to external conditions</li></ul><p>You don’t force them into a single unified schedule — you orchestrate them.</p><p>That’s the core value of a MACH ecosystem.</p><h3><strong>🤖 AI Makes This Architectural Choice Even More Critical</strong></h3><p>In 2026, AI is no longer an optional add‑on — it’s a continuous stream of capabilities evolving faster than any monolithic vendor can keep up with.</p><p>AI today is not a single module. It’s an expanding ecosystem:</p><ul><li>generative content</li><li>recommendation models</li><li>behavioral segmentation</li><li>personalization engines</li><li>intelligent search</li><li>fraud detection</li><li>forecasting models</li><li>customer service agents</li><li>experimentation engines</li><li>compliance and governance tools</li></ul><p>Each capability improves monthly.<br> Each may come from a different vendor.<br> Each requires rapid integration.</p><p>In a monolith, your AI strategy is limited to what the vendor ships, when they ship it, and how they implemented it.</p><p>In a MACH architecture, you can:</p><ul><li>adopt AI models without replacing platforms</li><li>integrate multiple AI vendors simultaneously</li><li>upgrade individual services without major rework</li><li>keep control of your data and orchestration</li><li>innovate at the speed the business demands</li></ul><p>AI evolves in months.<br> Monolith vendors evolve in years.</p><p>That gap is now too large to ignore.</p><h3><strong>🧭 When the Resort Still Makes Sense</strong></h3><p>Not every organization needs MACH.</p><p>A monolithic platform can be a pragmatic choice for businesses with:</p><ul><li>simple digital journeys</li><li>limited differentiation</li><li>small teams</li><li>low AI ambition</li><li>stable requirements</li></ul><p>But once you operate across markets, explore personalization, manage multi‑brand complexity, or treat AI as a competitive advantage — the monolith’s constraints appear quickly.</p><p>Your architecture must reflect your ambition.</p><h3><strong>So When People Ask: “Why MACH?”</strong></h3><p>Here’s the clearest answer:</p><blockquote><strong>Because monolithic platforms are built for predictability.<br> Today’s businesses — especially those investing in AI — operate in constant evolution.</strong></blockquote><blockquote>MACH gives you the ability to adapt, integrate new capabilities, swap components, and grow without waiting for a vendor’s roadmap.</blockquote><p>It’s not about trends. It’s not about hype.</p><p>It’s about designing an architecture that fits your business as precisely as you design a family trip that works for your 1‑ and 3‑year‑old.</p><p>One size does not fit all — in travel, in life, or in digital architecture.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=867da7dd1990" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocco-scaramuzzi-tech/why-mach-microservices-api-first-cloud-native-headless-still-needs-explaining-and-the-simple-867da7dd1990">Why MACH (Microservices, API-First, Cloud Native, Headless) Still Needs Explaining — And the Simple…</a> was originally published in <a href="https://medium.com/rocco-scaramuzzi-tech">rocco.tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Domain Driven Design (DDD) for our MACH Composable Enterprise Architecture]]></title>
            <link>https://medium.com/rocco-scaramuzzi-tech/domain-driven-design-ddd-for-our-mach-composable-enterprise-architecture-4a5ec1f015c0?source=rss-f1d27c73c5fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a5ec1f015c0</guid>
            <category><![CDATA[domain-driven-design]]></category>
            <category><![CDATA[composable-architecture]]></category>
            <category><![CDATA[microservice-architecture]]></category>
            <category><![CDATA[mach]]></category>
            <dc:creator><![CDATA[Rocco Scaramuzzi]]></dc:creator>
            <pubDate>Fri, 20 Dec 2024 10:26:17 GMT</pubDate>
            <atom:updated>2024-12-29T09:21:12.364Z</atom:updated>
            <content:encoded><![CDATA[<h3>Problem</h3><p>A Composable Enterprise Architecture, built on MACH principles (Microservices, API-first, Cloud-native, and Headless), empowers organizations to drive rapid innovation and adapt their digital solutions dynamically. This approach provides the following key business and digital experience advantages:</p><ul><li>The ability to seamlessly introduce new capabilities and features through smooth evaluation, without being constrained or burdened by unnecessary functionalities often imposed by monolithic or non-composable systems.</li><li>The capacity to meet and surpass heightened customer expectations.</li><li>Enables organizations to reduce dependence on third-party providers by allowing them to develop and integrate their own tools and services within the composable architecture.</li><li>Empowers organizations to develop applications that are designed for continuous evolution, eliminating the need for full re-platforming every 3 – 4 years.</li><li>Facilitates a shift toward product- and feature-led delivery models.</li><li>Allows organizations to create unique solutions while maintaining economies of scale.</li><li>Enable true transformation, faster activation of new digital business models.</li><li>Facilitates more frequent releases with minimal disruption.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*dca8dKBggqfYHUj3eo8MoA.png" /><figcaption>Typical MACH containers architecture diagram</figcaption></figure><p>Adopting MACH Alliance SaaS services alone is insufficient to ensure that an end-to-end application fully adheres to MACH principles. Organizations must still develop frontend layers, integration microservices, and domain-specific microservices. However, if these components are not designed correctly, they can lead to architectural antipatterns, ultimately compromising MACH compliance.</p><p>While organizations often excel at adopting API-driven, Cloud-Native, and Headless principles, they frequently struggle with fully implementing the Microservices principle. This principle involves creating single-purpose services that can be independently designed, deployed, and updated, enabling faster development cycles and quicker releases.</p><p>Compliance with the Microservices principle is not simply about having “small” pieces of code running in serverless functions or Docker containers, each with its own CI/CD pipeline. True microservices must be thoughtfully designed around specific business domains, with clearly defined ownership, boundaries, and minimal dependencies. Without this careful design, organizations risk falling into the trap of creating a “distributed monolith.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*5LgLNPiP-AzTcESE.png" /><figcaption>Distributed Monolith anti-pattern</figcaption></figure><p>A distributed monolith typically refers to a system composed of multiple highly coupled services, where changes in one service often ripple across service boundaries. As a result, seemingly simple and localized changes can inadvertently disrupt other parts of the system, leading to instability and inefficiencies.</p><p>This phenomenon may not be apparent in the early stages of a project. However, as more functionalities and services are added, the issues begin to surface and grow exponentially over time, ultimately hindering scalability and maintainability.</p><p>Indicators that your architecture may not be correctly adhering to the Microservices principle include:</p><ul><li>“Fat” generic services: Examples include generic services like a “Commerce Microservice” or “Content Microservice” that handle multiple responsibilities across different domain areas, violating the principle of single responsibility.</li><li>Lack of clear ownership: When services do not have designated owners, it leads to ambiguity in accountability, hindering effective management and maintenance.</li><li>Coupled deployments: Requiring the deployment of multiple services whenever a change is made to a single service indicates tight coupling, which undermines the independence of microservices.</li><li>Excessive orchestration: The need for significant coordination to deploy multiple services simultaneously suggests tight dependencies, which contradicts the autonomy of microservices.</li><li>Excessive team coordination: Requiring extensive collaboration among teams before releasing a feature indicates tightly coupled services and a lack of clear boundaries, slowing down the development process.</li></ul><blockquote>Even when utilizing MACH SaaS services, it is essential to follow the same best practices that would be applied when designing a bespoke microservice architecture. This ensures scalability, maintainability, and adherence to core principles.</blockquote><blockquote>To facilitate easier changes, code and services should be organized around cohesive business functionalities rather than technology. Domain-Driven Design (DDD) is an effective approach to achieving this alignment by focusing on the core domains and business logic.</blockquote><h3>Solution</h3><p>Domain-Driven Design (DDD) is a software development approach that provides both strategic and tactical modeling tools to design high-quality software aligned with core business objectives.</p><p>Domain-Driven Design (DDD) is not primarily about technology. At its core, DDD focuses on discussion, active listening, understanding, discovery, and delivering business value, all with the goal of centralizing and refining domain knowledge.</p><p>In Domain-Driven Design, the business domain becomes the primary driver of system architecture. This approach not only simplifies making changes but also enables better alignment of teams around the business domain, fostering efficiency and collaboration.</p><p>Domain-Driven Design (DDD) offers a wide range of tools and techniques, spanning from strategic to tactical modeling. However, when designing a MACH composable architecture, it is not necessary to adopt all of them. Instead, it is crucial to focus on gathering just enough information about the domain model to identify and understand the dependencies between various subdomains.</p><p>A domain typically consists of multiple subdomains, each of which is encapsulated within a Bounded Context. The Bounded Context represents the physical system or service responsible for managing one or more subdomains. Ideally, each Bounded Context should own a single subdomain to maintain clear boundaries and responsibilities.</p><p>For instance, in the context of a commerce system, the domain may include the following primary subdomains:</p><p>•	Product</p><p>•	Catalogue</p><p>•	Orders</p><p>•	Inventory</p><p>•	Invoicing</p><p>•	Shipping</p><p>Each subdomain should be managed within its own Bounded Context to ensure modularity and scalability.</p><p>A “just enough” domain model focuses on defining the relationships between Bounded Contexts, ensuring they align with the interactions between subdomains within the organization. This approach provides clarity on dependencies and collaboration points without overcomplicating the design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_IeU1YKrojVp_ATq7OvyUA.png" /><figcaption>Bounded context diagram, typical for an e-commerce domain</figcaption></figure><p>Bounded Contexts provide an excellent foundation for defining microservice boundaries. This “just enough” domain model can be applied to both greenfield projects and the decomposition of monolithic systems, ensuring clear separation of responsibilities and alignment with business domains.</p><p>One of the most effective ways to develop a domain model is through Event Storming workshops. Invented by Alberto Brandolini, Event Storming is a collaborative exercise that brings together technical and non-technical stakeholders to define a shared domain model.</p><p>This method adopts a bottom-up approach:</p><p>1.	<strong>Define Domain Events</strong>: Participants identify and document “Domain Events,” which represent significant occurrences within the system.</p><p>2.	<strong>Group into Aggregates</strong>: These events are then organized into aggregates, which represent clusters of related events.</p><p>3.	<strong>Establish Bounded Contexts</strong>: Aggregates are further grouped into Bounded Contexts, defining the boundaries for different parts of the system.</p><p>This process fosters alignment, ensures a shared understanding of the domain, and provides a solid foundation for designing a scalable, modular architecture.</p><p>The core advantage of Event Storming is its collaborative nature, enabling participants to collectively define the domain model. The outcome is not just the domain model itself but also a shared understanding of the model among all stakeholders, ensuring alignment and clarity across teams.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WReACikQQB6Er8aZ7Ng0tA.png" /><figcaption>Event Storming timeline example</figcaption></figure><h3>Conclusions</h3><blockquote>Conway’s Law states: “Any organization that designs a system will inevitably produce a design whose structure mirrors the organization’s communication structure.” Domain-Driven Design (DDD) addresses these communication constraints by aligning system architecture with business domains, enabling better decoupling and fostering a more composable and scalable architecture.</blockquote><p>To design a Composable MACH architecture aligned with Domain-Driven Design (DDD), ensure the following artifacts are leveraged to support the architecture design:</p><ul><li>Event storming timeline</li><li>Bounded context diagram</li><li>High Level Logical architecture diagram</li></ul><p>In the upcoming articles, I will delve into the practical aspects of Domain-Driven Design (DDD), including a detailed guide on adopting Event Storming. Stay tuned!</p><h4>References</h4><ul><li>MACH Alliance <a href="https://machalliance.org/">https://machalliance.org/</a></li><li>Monolith to Microservice book (Sam Newman)</li><li>Implementing Domain-Driven-Design book (Vaughn Vernon)</li><li>Event Storming <a href="https://www.eventstorming.com/">https://www.eventstorming.com/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a5ec1f015c0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocco-scaramuzzi-tech/domain-driven-design-ddd-for-our-mach-composable-enterprise-architecture-4a5ec1f015c0">Domain Driven Design (DDD) for our MACH Composable Enterprise Architecture</a> was originally published in <a href="https://medium.com/rocco-scaramuzzi-tech">rocco.tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Host a .NET & C# Containerized API in GKE Autopilot on GCP — Step by Step]]></title>
            <link>https://medium.com/rocco-scaramuzzi-tech/host-a-net-c-containerized-api-in-gke-autopilot-on-gcp-step-by-step-1f5dae0c0f4a?source=rss-f1d27c73c5fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f5dae0c0f4a</guid>
            <category><![CDATA[dotnet-core]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[autopilot]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Rocco Scaramuzzi]]></dc:creator>
            <pubDate>Fri, 01 Jul 2022 14:19:34 GMT</pubDate>
            <atom:updated>2022-07-01T14:19:34.459Z</atom:updated>
            <content:encoded><![CDATA[<h3>Host a .NET &amp; C# Containerized API in GKE Autopilot on GCP — Step by Step</h3><h3>Introduction</h3><p>The open-source .NET Core version has opened a lot of possibility such as running applications in Linux containers. In turn, this has facilitated the hosting of our .NET applications in the managed computing services of non-Azure cloud providers.</p><p>Here at <a href="http://na-kd.com/">NA-KD</a>, our tech stack is mainly Microsoft-focused. Although we are keeping .NET as the default framework, we are exploring the use of Google Cloud Platform (GCP) as the default cloud provider for our containerized microservices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*P3X0gdTkSyTkH6rr1GzAmw.png" /><figcaption>GCP + .NET</figcaption></figure><p>Recently, NA-KD has chosen to host our containerized microservices in a Kubernetes (k8s) Managed Service (called Google Kubernetes Engine in GCP). In principle, GKE is the equivalent of AKS (Azure Kubernetes Service) in Azure and EKS (Elastic Kubernetes Service) in AWS.</p><p>Although the cloud providers offer Kubernetes as managed service, manual management and configuration such as sizing the nodes of the Kubernetes Cluster are still needed. GCP also offers GKE Autopilot, this reduces further management and configuration of Kubernetes by making the work of the developer easier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/0*A68OJJ6oPvppYnfy" /><figcaption>GKE Autopilot</figcaption></figure><p>GKE Autopilot is still a GKE cluster, with built-in configurations that aid in the production of security and scaling. One feature of Autopilot is that there is no need to size the nodes upfront. For more details about GKE standard vs Autopilot mode, please refer to the <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview">Google documentation</a>.</p><p>It is still not common to host Microsoft stack applications in GCP and therefore there are not many guides on the web about hosting a .NET application in GCP (especially for GKE Autopilot). The purpose of this article is to provide step-by-step instructions on how to deploy a .NET application example in GKE Autopilot.</p><p>Before continuing, please be sure to view the list of prerequisites below for a better understanding of the remaining aspects of this article:</p><ul><li>Basic knowledge of Docker containers</li><li>Basic knowledge of Kubernetes (k8s)</li><li>Experience with C# and .NET framework</li><li>Have GCP account with a project available</li></ul><p>Here a summary of the steps:</p><ul><li><strong>Example Project</strong></li><li><strong>Configure Google Cloud CLI</strong></li><li><strong>Provisioning GKE Autopilot Cluster</strong></li><li><strong>Pushing Docker Image to the Artifact Registry</strong></li><li><strong>Deploy Image to the GKE Autopilot</strong></li></ul><h3>Example Project</h3><p>For this example, I will be using a simple .NET API project which contains a GET endpoint. I will be using the <em>WeatherForecast in this </em>example. This is found when creating a Web API project via Visual Studio.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KlsQp2NX0dPssR5BifUA9w.png" /><figcaption>.NET API example scaffolded via Visual Studio</figcaption></figure><p>The project has been scaffolded by enabling Docker at the creation time. In this way, the API gets containerized from the beginning without the need to create the <em>Dockerfile </em>manually. The <em>manifest.yml</em> is the only file that I had to create manually to deploy the API in Kubernetes (this will be covered in more detail in the following paragraphs).</p><p>If you would like additional practice, you can view my project example at <a href="https://github.com/rocco-scaramuzzi/ContainerizedDotNetApi.git">Github public repo</a>.</p><p>Although Visual Studio has a built-in ability to run out the application as a Docker container, I believe it is beneficial to be familiar with the Docker concepts by running the key commands to build an image and run the container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QEmAkI9ou7q6tSZ3NCRdqQ.png" /><figcaption>Run Docker container in Visual Studio</figcaption></figure><p>Please review below, the relevant Docker commands to build and run the application on our local machine.</p><pre>//build the image<br><strong>docker build -t custom-weather-api-img .</strong></pre><pre>//list the existing docker images<br><strong>docker images</strong></pre><pre>//run the container from the created image<br><strong>docker run -d -p 5000:80 --name custom-weather-api custom-weather-api-img</strong></pre><pre>//list the containers<br><strong>docker ps -all<br></strong></pre><p>Once executed all the above Docker commands, our API should be running on <a href="http://localhost:5000/WeatherForecast/">http://localhost:5000/WeatherForecast/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JC38CNFFs7PqggYAkrkoUQ.png" /><figcaption>Response from localhost</figcaption></figure><h3>Configure Google Cloud CLI</h3><p>Assuming you already have a GCP project created, you now need to create a service account for running the application from our local machine. Next, be sure to install and configure gcloud CLI on your machine (this is done to manage the GCP resources).</p><ol><li>Create a Service Account</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-hvWjp7jWUmzwyEdpwd5tA.png" /><figcaption>create a service account</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e1bjLgBA8nDOMKGdbMviMQ.png" /><figcaption>Add a secret key</figcaption></figure><p>2. Generate a key for the service account.Download it and set the path of the json file to the <em>GOOGLE_APPLICATION_CREDENTIALS</em><strong> </strong>environment variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bpj_1N0nQi_kM59kX1Irag.png" /><figcaption>download the generated key</figcaption></figure><pre>//example for Windows<br><strong>set GOOGLE_APPLICATION_CREDENTIALS=&lt;folders_path&gt;/&lt;service_account_file_name&gt;.json&quot;</strong></pre><p>3. After creating the service account, you can then configure gcloud CLI to interact with our project by running the following commands:</p><pre>//authentication with your GCP account<br><strong>gcloud auth login</strong></pre><pre>//get the list of all available projects<br><strong>gcloud projects list</strong></pre><pre>//select the project you want to working on (architecture-pocs in my example)<br><strong>gcloud config set project architecture-pocs</strong></pre><h3>Provisioning GKE Autopilot Cluster</h3><p>From the GCP console, select “Create Cluster” from Kubernetes Engine. While selecting this option, if you have not already enabled the Kubernetes Engine API, you will be asked to enable the “Kubernetes Engine API”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*90MrHGqzjkSP4trPMKUorA.png" /><figcaption>Enable Kubernetes API</figcaption></figure><p>At the Cluster creation, you should select the “Autopilot” configuration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jCFUWm8zG94iC7WONGRneg.png" /><figcaption>Create GKE Cluster as Autopilot mode</figcaption></figure><p>Just set the base settings by ignoring networking and advanced options:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ogrCSD8QUc8lVMDoLIfYWQ.png" /><figcaption>Basic settings for GKE Autopilot</figcaption></figure><p>It usually takes about 5–10 minutes to create the cluster:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GuK0d7DdE33EHX22CwEkUA.png" /><figcaption>List of GKE Clusters created</figcaption></figure><p>The cluster will be available via the gcloud CLI as well:</p><pre>//get list of clusters<br><strong>gcloud container clusters list</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*NaB1qKRuypRGvFOM1p7Q_g.png" /><figcaption>GKE clusters list via gcloud</figcaption></figure><p>As next thing, you need to configure the Kubectl which is the command line utility to interact with a Kubernetes cluster. Assuming you have Kubectl installed on your local, you need to configure it to interact with the GKE cluster just created. GKE provide to us the command for that configuration by clicking on <em>Actions →Connect:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gP7BSrbnduUh-2LgyLND7w.png" /><figcaption>Access the GKE connection string for kubectl</figcaption></figure><p>Then just copy the command and run in your cmd:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UzFdILEeh0-PgQQLE0mbAQ.png" /><figcaption>Copy the he GKE connection string for kubectl</figcaption></figure><pre>//configure kubectl for the GKE cluster<br><strong>gcloud container clusters get-credentials autopilot-cluster-architecture-poc --region europe-central2 --project architecture-pocs</strong></pre><p>In order to test the configuration, let’s run the command to get the list of nodes.</p><pre>//get list of cluster&#39;s nodes<br><strong>kubectl get nodes</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*l0UxzcVDtFW0SndRqLDWCQ.png" /><figcaption>List of nodes created by Autopilot</figcaption></figure><p>From the above screenshot, you can see Autopilot in action which has created automatically two nodes for our GKE cluster.</p><h3>Pushing Docker Image to the Artifact Registry</h3><p>To deploy the Docker image to the GKE cluster, we need to upload it into a Docker images library like Docker Hub. GCP has an image library that contains two options: <em>Artifact Registry</em> (which allows storing other types of packages line npm, NuGet), and <em>Container Registry</em>. As recommended by Google, we will be using Artifact Registry.</p><p>Before beginning, the Artifact Registry API needs to be enabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UnrU0_XUQNUzDmVbD9dsCw.png" /><figcaption>Enable Artifact Registry API</figcaption></figure><p>After that, we can create a repository for Dockers images:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6WmoNsCgg04KxORykRhqPQ.png" /><figcaption>Create a Docker repository in Artifact Registry</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ilO2C3VK2LNJidq1ynlNyw.png" /><figcaption>List for repositories created</figcaption></figure><p>Before you can push the images, you need to configure Docker on your machine to use gcloud CLI to authenticate requests to Artifact Registry:</p><pre>//set up authentication to Docker repositories in the region<strong> </strong>europe-west1<br><strong>gcloud auth configure-docker europe-west1-docker.pkg.dev</strong></pre><p>Before pushing the Docker image to Artifact Registry, you <em>must </em>tag it with the repository name:</p><pre>//tag the image, where the &quot;architecture-pocs&quot; is the project Id<br><strong>docker tag custom-weather-api-img europe-west1-docker.pkg.dev/architecture-pocs/poc-docker-repo-we/custom-weather-api-img:v1</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QXFiGy7IAvIB4shEvooHtg.png" /><figcaption>Result of tagged image</figcaption></figure><p>And finally you can push your image be running the following command:</p><pre>//push the image, where the &quot;architecture-pocs&quot; is the project Id<br><strong>docker push europe-west1-docker.pkg.dev/architecture-pocs/poc-docker-repo-we/custom-weather-api-img:v1</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OVGhBrxQI-bsU67XnDy2Zw.png" /><figcaption>Result of the image uploaded to the Artifact Registry</figcaption></figure><h3><strong>Deploy Image to the GKE Autopilot</strong></h3><p>At this point, we already have the Kubernetes deployment object in the <a href="https://github.com/rocco-scaramuzzi/ContainerizedDotNetApi/blob/master/manifest.yml">manifest.yml</a>. Next, you will need to replace the image URL with the one from the “pull” tab of your image saved in the container registry:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Zu5y6gYALJ36VRIY74XGg.png" /><figcaption>Get image URI</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i9J6yt27K4NIIsu_g2XKsg.png" /><figcaption>Set image URI to the manifest.yml</figcaption></figure><p>To deploy the image, go the the root folder of the project and run the kubectl command:</p><pre>//publish the manifest.yml<br><strong>kubectl create -f manifest.yml</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9KAQ2faimwceymQQxYsPvA.png" /><figcaption>Results of Kubernetes deployment object created</figcaption></figure><p>Now you can run the following kubectl commands to check the status of the deployment:</p><pre>//get list the deployment<br><strong>kubectl get deploy</strong></pre><pre>//get list the pods<br><strong>kubectl get po</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*y1uVWYHJTbd4kXhtUbFZlw.png" /><figcaption>Deploy status — None of the two pods have been deployed yet</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*GAhG33CdTEjwTKlp2jbXVg.png" /><figcaption>Pods Status — One pod had been deployed and running, the other one is under container creation</figcaption></figure><p>Once the deployed has been completed the results of the commands will be like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*jA6eTqit3_P5gMWsxHvEuw.png" /><figcaption>Deploy &amp; Pods status</figcaption></figure><p>In order to get the IP where hosted our API application, we should use the LoadBalancer external IP by running the following command:</p><pre>//get list of the services<br><strong>kubectl get svc</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*b3YTsdyTVxLptC4mr3gkqw.png" /><figcaption>List of Kubernetes Serivices</figcaption></figure><p>Here it is <a href="http://34.116.180.179/WeatherForecast/">http://34.116.180.179/WeatherForecast/</a> our .NET API deployed in GKE Autopilot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2UFwyn1gxSA2xH6TIpdSvw.png" /><figcaption>Response from the API hosted in GKE</figcaption></figure><h3>Conclusion</h3><p>From this article, we have learned how to deploy a containerized .NET API in GKE Autopilot mode. This cluster is already optimized for production via a hands-off experience for the developer. Autopilot can be seen as something between the standard GKE and a serverless service.</p><p>Please note, that the purpose of the step-by-step instructions is to help with getting started in GKE Autopilot. It is important to remember that in a production context, all of these “manual steps” discussed should be automated via Infrastructure As Code like Terraform.</p><h3>References</h3><ul><li><a href="https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview">Autopilot overview | Kubernetes Engine Documentation | Google Cloud</a></li><li><a href="https://cloud.google.com/artifact-registry/docs/docker/store-docker-container-images#console">Quickstart: Store Docker container images in Artifact Registry | Artifact Registry documentation | Google Cloud</a></li><li><a href="https://medium.com/bb-tutorials-and-thoughts/gcp-deploying-angular-app-with-net-web-api-on-gke-autopilot-b87cd2db022">GCP — Deploying Angular App with .NET Web API on GKE Autopilot</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f5dae0c0f4a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocco-scaramuzzi-tech/host-a-net-c-containerized-api-in-gke-autopilot-on-gcp-step-by-step-1f5dae0c0f4a">Host a .NET &amp; C# Containerized API in GKE Autopilot on GCP — Step by Step</a> was originally published in <a href="https://medium.com/rocco-scaramuzzi-tech">rocco.tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Event-Driven Microservice Architecture, don’t use only events but use commands too!]]></title>
            <link>https://medium.com/rocco-scaramuzzi-tech/event-driven-microservice-architecture-dont-use-only-events-but-use-commands-too-b8694d370436?source=rss-f1d27c73c5fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8694d370436</guid>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[digital-transformation]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[event-driven-architecture]]></category>
            <dc:creator><![CDATA[Rocco Scaramuzzi]]></dc:creator>
            <pubDate>Fri, 01 Jul 2022 13:29:10 GMT</pubDate>
            <atom:updated>2022-07-12T08:47:27.664Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Microservice architecture is the baseline for the development of a competitive software platform, based on loosely coupled services which are easy to change, deploy, scale-out, while also minimize the risk of changing and deploying.</p><p>Compared to REST synch calls, the event-driven is the intra-services communication which should avoid coupling between services. But, if we are not careful with our design, we could still develop microservices that are highly coupled by using events. This would result in building a distributed monolithic which is much worse than a pure monolith architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*JTshhCNHxfhV1Sld9K2nSQ.png" /><figcaption>Distributed monolith antipattern</figcaption></figure><p>Event notification is quite natural because it implies a low level of coupling and is pretty simple to set up. In general, the solution is manageable when having a few microservices interacting with one another, but it can become problematic when the number of microservices increases.</p><p>Listed below are the two common problems that occur when basing our event-driven architecture on events <strong>only</strong>:</p><ol><li>When there is a logical flow that runs over various events it can be difficult to differentiate such a flow as it is not explicit in any program text. This can create challenges in the modification and the debugging of the flow. Therefore, the only way to understand the flow is through monitoring a live system.</li><li>The “<em>microservice A</em>” expects the “<em>microservice B</em>” to act as part of “<em>microservice A</em>” business logic. If this is developed by having “<em>microservice A</em>” raising an event and then “<em>microservice</em> <em>B</em>”<em> </em>subscribing to the event, we are kind of spreading and coupling the business logic belonging to “<em>microservice A”</em> into the “<em>microservice B”</em>.</li></ol><p>The main issue is that, very often, there is no distinction between <strong>events </strong>and <strong>commands </strong>message in an event-driven architecture. Most of the time, events are overused when compared to commands. Below are the listed differences between <strong>events</strong> and <strong>commands</strong>.</p><ul><li><strong>Commands</strong>: the purpose is to invoke a behavior related to a business logic within a specific boundary. Commands have a single consumer. They are represented by a verb (SendEmail, PlaceOrder, ReservePayment, etc.).</li><li><strong>Events</strong>: the purpose is to alert other parts of a system that something occurred under a specific boundary. An event can be the result of command completion. Events have multiple consumers who reside under different boundaries. Events are represented in the past tense (EmailSent, OrderPlaced, PaymentReserved, etc.).</li></ul><p>These two types of messages should be used properly and a good architecture should have the right balance between events and commands.</p><p>There are many event-driven architecture examples on the web using events much more than commands. In the following section, an example will be shown from which we adopted commands for a specific microservice here at <a href="https://www.na-kd.com/en">NA-KD</a>.</p><h3>Use Case of Event-Driven via commands</h3><p>As part of the platform modernization journey at NA-KD eCommerce, there has been a gradual movement towards a microservice architecture in order to enable certain business goals. We developed the “Global Notification Service” microservice, which aims to centralize, improve, and manage the sending of emails requested by multiple services of many subdomains. The goal is to leverage this service for sending emails for user password reset, order confirmation, shipment confirmation, back-to-stock notifications, etc.</p><p>Taking for granted that for these types of use cases is advantageous to send the notifications in async, the “simple” solution would “apparently” be to have the Global Notification Service to subscribe to the different events published by all the services which want to send a notification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iUBEvI959hILXTQ2B5CzvQ.png" /><figcaption>Global Notification Service based on events</figcaption></figure><p>Let’s see why an approach based on events is not the best solution in this context:</p><ul><li>In the NA-KD domain, sending an email is part of the business logic within a subdomain. For example, in the order service, it is important to know if the email was sent to the customer when the payment reservation fails.</li><li>Having a solution purely based on events is the coupling of a notification service to many different subdomains. For example, the notification service needs to be aware that an email must be sent when an order is summited and when it is updated.</li><li>Applying a change to the notification service must occur every time there is a new service which requires to send a notification.</li></ul><p>Using events for the Global Notification Service, it raises exactly the two problems described in the above paragraph. Instead, a more scalable and loosely coupled approach should be leveraged on <strong>commands</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X4rDpQCvcQmyYCXhVGinMg.png" /><figcaption>Global Notification Service based on commands</figcaption></figure><p>By using commands:</p><ul><li>All the services that require an email to be sent are in control of business logic.</li><li>The notification service is only responsible to send and manage emails. It is agnostic to the business logic related to the other subdomains.</li></ul><h3>Conclusion</h3><p>The microservice architecture is relatively new and all engineers are learning it better every day. The danger is that’s very easy to make potential decoupled systems by using events, without realizing that we’re losing sight of that larger-scale flow and this can set ourselves up for trouble in future years.</p><p>If we are not careful, the system can evolve into a distributed-monolith antipattern.</p><p>Like most engineering problems, there is not a single solution that works in every context. Instead, we need to evaluate each situation to see if a <strong>command</strong> or an <strong>event</strong> can solve the issue. Please find below a summary about differences between events and commands which we can crosscheck whenever we need to decide which type of message to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*CfzUB3IjZ0-ZjdoOF9pjtg.png" /><figcaption>Commands vs Events</figcaption></figure><p>It is important to remember that an excellent event-driven architecture strikes a balance between <strong>events</strong> and <strong>commands</strong>.</p><h4>References</h4><ul><li><a href="https://martinfowler.com/articles/201701-event-driven.html">https://martinfowler.com/articles/201701-event-driven.html</a></li><li><a href="https://codeopinion.com/commands-events-whats-the-difference/">https://codeopinion.com/commands-events-whats-the-difference/</a></li><li><a href="https://vimeo.com/362507687">https://vimeo.com/362507687</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8694d370436" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocco-scaramuzzi-tech/event-driven-microservice-architecture-dont-use-only-events-but-use-commands-too-b8694d370436">Event-Driven Microservice Architecture, don’t use only events but use commands too!</a> was originally published in <a href="https://medium.com/rocco-scaramuzzi-tech">rocco.tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NoSQL vs SQL is like saying Warehouse vs Hotel]]></title>
            <link>https://medium.com/rocco-scaramuzzi-tech/nosql-vs-sql-is-like-saying-warehouse-vs-hotel-f4db0fac1142?source=rss-f1d27c73c5fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4db0fac1142</guid>
            <category><![CDATA[azure-cosmos-db]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[nosql]]></category>
            <category><![CDATA[azure-sql-database]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Rocco Scaramuzzi]]></dc:creator>
            <pubDate>Thu, 02 Jul 2020 21:24:43 GMT</pubDate>
            <atom:updated>2022-06-28T17:39:52.966Z</atom:updated>
            <content:encoded><![CDATA[<p>I am writing this article while trying to find an analogy for NoSQL (non-relational) and SQL (relational) databases to facilitate a discussion with a client to explain why particular data storage fits better for a specific requirement. I want to share this, as it might be useful for others as well so that people will stop saying things like “SQL db. is more secure than a NoSQL”, “ NoSQL is more expensive than a SQL”, “SQL is much better than NoSQL or vice-versa”, “You don’t need a NoSQL because you are not developing a big-data application” etc.</p><p>Both kinds of storages have their peculiarities and the difference is in the way the two are designed and built, the type of information stored, and how it is stored. Therefore, I came up with this analogy:</p><blockquote>A NoSQL is a Warehouse as a SQL is a Hotel</blockquote><p>(Note: I am positive that this analogy was previously created, however, a thorough Google search failed to locate any such similar quotes. My apologies if someone came up with this similar analogy and I failed to cite them:-) )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*tM7qaiHN_izeaRz3gEgqSw.png" /><figcaption>Hotel — Warehouse</figcaption></figure><p>The point that I want to make is that you cannot blandly compare a Warehouse with a Hotel; both of them are capable of containing “things” but probably different ones with different constraints and different needs. We cannot say that a hotel is better than a warehouse and vice-versa; it all depends on the purpose intended.</p><p>Examples:</p><p><em>If I have persons to be hosted somewhere, I could probably host them in a warehouse, but I would recommend a hotel for the following reasons:</em></p><p>1) A hotel provides specific rooms with a well-defined number of beds so that persons are accommodated based on the type of relationships between the persons in the group. (Things like rigid and structured data in SQL).</p><p>2) A hotel provides a set of mandatory services/equipment for each room, which are needed for each host, things like heating/air conditioners, showers, toilets, etc. Each of these services/equipment has its own complexity and need to be associated to different rooms. (Things like normalization and relations in SQL).</p><p>3) A hotel provides a 24-hour check-in and checkout mechanism so that persons can arrive and depart at any time with certainty. Therefore, the check-in process should be just as reliable as the checkout process. (Things like ACID transactions in SQL).</p><p><em>If you need to store generic items, I could probably store these in a hotel room but I would prefer to store them in a warehouse for the following reasons:</em></p><p>1) The warehouse rooms/areas have a simple, flexible structure and space, which allows for the storage of items that might change the size and shape often over time. (Things like free-schema data structure in NoSQL).</p><p>2) The warehouse can provide different and flexible policies in terms of check-in (write) and checkout (read). For example, I can store items only between certain hours (8 am to 8 pm) but withdraw items at any time. (Things like optimized read/write and eventual consistency in NoSQL).</p><p>3) The warehouse allows an easier way to scale the allocated areas in instances of growth of items over time. (Things like elastic scale and partitions in NoSQL).</p><p>These are just a few examples, but I am sure your imagination can come up with many more examples, which can depict the differences between the use of a warehouse versus a hotel and vice-versa. Based on the above examples, you can imagine the warehouse and hotel being designed in different ways, so that they satisfy the different users’ needs. This is the same for NoSQL and SQL data storage.</p><h3>SQL</h3><p>A relational database is designed to store rigid and structured data. It consists of multiple tables with rows and columns. Each table has columns, and every row in a table has the same set of columns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VGBU0qQ1QsoqDBYfcMqNXw.png" /><figcaption>SQL Table examples</figcaption></figure><p>To have an efficient relational database, the data should be structured and organized. A well-designed schema minimizes data redundancies and keeps them synchronized. Indeed, a SQL database is very useful when strong consistency guarantees are important, where all changes are atomic and transactions always leave the data in a consistent state. The ACID (Atomic, Consistent, Isolated, Durable) feature is extremely important for business requirements that have sensitive data like financial transactions and personal information. However, this feature is not designed to scale out by distributing storage and processing across machines. Also, the normalization process can lead to inefficiencies, because of the need to disassemble logical entities into rows in separate tables, and then reassemble the data when running queries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/115/1*AJiIajkODKnMx6-I_6AYsA.png" /><figcaption>Azure SQL database</figcaption></figure><p>In Azure world, Azure SQL server is the most common relational database.</p><h3>NoSQL</h3><p>A NoSQL database is designed to store unstructured data. Instead of tables, the NoSQL database can be key-values, documents, and is graphs oriented. The common factor of the NoSQL database is the flexibility it provides when dealing with data.</p><p>The document-oriented is the most common NoSQL database, and this simply means that non-structured data can be stored in a single document, which can be easily found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*oiq2gpIqyc5yAJES5UellQ.png" /><figcaption>Document database example</figcaption></figure><p>Typically, a document contains the entire data for an entity, which has a structure specific for the application. For example, an entity should contain the details of a customer, an asset, or a combination of both. Usually, a single document may contain information that would be spread across several relational tables in a relational database. For example, if as a requirement we have to retrieve customer details every time we query a property, it is more efficient to have all the data in one document, instead of having to query across multiple SQL tables.</p><p>A document store does not require that all documents should have the same structure. This free-schema approach provides a great deal of flexibility; it facilitates rapid software development, applications can store different data in documents as business requirements change.</p><p>In addition, a NoSQL store can be extremely scalable, as the data store can easily distribute data across multiple nodes on separate machines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/113/1*8JQ63m85EsDhiGs3642WpQ.png" /><figcaption>Azure Cosmos DB</figcaption></figure><p>In Azure world, Cosmos DB is the offered non-relational database.</p><h3>Conclusion</h3><p>The fundamental difference between the two technologies is that a relational database has a pre-defined and well-defined structure, while a non-relational database is unstructured and can store data of any form. Both have their advantages and disadvantages but none is better than the other. The selection chosen depends on the requirements, for example, the type of data that is to be processed.</p><p>In modern application, especially with Microservice Architecture, a <em>Polyglot Persistence Approach</em> is utilized where it is common to store different types of data in different data stores, each focused toward a specific workload or usage pattern.</p><h4>References:</h4><p><a href="https://docs.microsoft.com/en-us/azure/architecture/guide/technology-choices/data-store-overview">Choose the right data store - Azure Application Architecture Guide</a></p><p><a href="https://datawarehouseinfo.com/sql-vs-nosql-which-database-approach-is-better/">https://datawarehouseinfo.com/sql-vs-nosql-which-database-approach-is-better</a>/</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4db0fac1142" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocco-scaramuzzi-tech/nosql-vs-sql-is-like-saying-warehouse-vs-hotel-f4db0fac1142">NoSQL vs SQL is like saying Warehouse vs Hotel</a> was originally published in <a href="https://medium.com/rocco-scaramuzzi-tech">rocco.tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[.NET Core local development — How to store secrets?]]></title>
            <link>https://medium.com/rocco-scaramuzzi-tech/net-core-local-development-how-to-store-secrets-495c1c36d974?source=rss-f1d27c73c5fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/495c1c36d974</guid>
            <category><![CDATA[microsoft-azure]]></category>
            <category><![CDATA[azure-key-vault]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[dotnet-core]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Rocco Scaramuzzi]]></dc:creator>
            <pubDate>Sat, 20 Jun 2020 15:43:27 GMT</pubDate>
            <atom:updated>2020-06-20T15:51:12.096Z</atom:updated>
            <content:encoded><![CDATA[<h3>.NET Core local development — How to store secrets?</h3><p>I have seen a lot of projects where database connections strings, service bus, blob storage access keys are stored in the appsettings.json for local development purpose and all this breaches basic security best practices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GGBK4smSJIeLqtYHtF24Bw.png" /><figcaption>appsettings.json example</figcaption></figure><h3>Why is it a problem?</h3><p>The appsettings.json will be stored in version control and this open possible security breaches:</p><ul><li>Anyone who has access or clone the repository will have access to those secrets.</li><li>Version control is designed to preserve history. So passwords will still be retrievable, even if we remove the password from the current version.</li><li>Having sensitive data in the source means that we need to take extra care when sharing the code.</li></ul><p>A possible mitigation adopted by several developers is to create appsettings.Development.json but this is not any better unless this file is being added to the .gitignore file. I have seen appsettings.Development.json containing Azure resources secretes and being pushed in git:-( .</p><h3>Solution — Secret Manager Tool</h3><p>The solution consists to have our appsettings.json containing all the possible secrets as empty strings and then using the Secret Manager tool to store sensitive data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eX_eQ8R7Sop5KwL-.png" /><figcaption>appsettings.json with no secrets</figcaption></figure><p>The Secret Manager tool abstracts the implementation details, in terms of how and where to store values. The values are stored in a JSON configuration file in a system-protected user profile folder on the local machine:</p><p>%APPDATA%\Microsoft\UserSecrets\&lt;user_secrets_id&gt;\secrets.json</p><p>In this way the app secrets are not checked in the source control.</p><p>Let’s see how to use Secret Manager to populate our two secrets. One way is to use .NET Core SDK commands, by executing the following steps:</p><ol><li>initialize:</li></ol><pre>dotnet user-secrets init</pre><p>2. set first secrets:</p><pre>dotnet user-secrets set &quot;ConnectionStrings:DefaultConnection&quot; &quot;Server=tcp:mydb.database.windows.net,1433;Initial Catalog=mydb;Persist Security Info=False;User ID=myuser;Password=mypassword;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;&quot;</pre><p>3. set second secrets:</p><pre>dotnet user-secrets set &quot;AzureStorage:ConnectionString&quot; &quot;DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=myKey+xxxxxxxx+yyyyyyyyy==;EndpointSuffix=core.windows.net&quot;</pre><p>An alternative to the command line is to use directly Visual Studio, by right-clicking on the project and then selecting “Manage User Secrets”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u2Kh6kMYpVV3rMV2B-l-tg.png" /><figcaption>Set Secrets via Visual Studio</figcaption></figure><h3>Conclusion</h3><ul><li>Please note that the secrets will be loaded by the secret manager if your app is running on your local with ASPNETCORE_ENVIRONMENT = Development.</li><li>About production, the secrets should not be deployed with the app but instead those should be set as environment variables or even better via Azure Key Vault. This is a common best practice, accordingly to the 12-factor guidelines <a href="https://12factor.net/config">https://12factor.net/config</a>.</li></ul><p><em>Resources</em>:</p><p><a href="https://docs.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-3.1&amp;tabs=windows">Safe storage of app secrets in development in ASP.NET Core</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=495c1c36d974" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocco-scaramuzzi-tech/net-core-local-development-how-to-store-secrets-495c1c36d974">.NET Core local development — How to store secrets?</a> was originally published in <a href="https://medium.com/rocco-scaramuzzi-tech">rocco.tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure SLA for Virtual Machines]]></title>
            <link>https://medium.com/rocco-scaramuzzi-tech/azure-sla-for-virtual-machines-f2e808fd0365?source=rss-f1d27c73c5fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2e808fd0365</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[service-level-agreement]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[azure-virtual-machines]]></category>
            <category><![CDATA[azure-kubernetes-service]]></category>
            <dc:creator><![CDATA[Rocco Scaramuzzi]]></dc:creator>
            <pubDate>Tue, 31 Dec 2019 11:21:43 GMT</pubDate>
            <atom:updated>2019-12-31T14:09:31.845Z</atom:updated>
            <content:encoded><![CDATA[<p>Virtual Machines (VM) are the infrastructure as a service (IaaS) offered by Azure. You can deploy VM in Azure with different Operating Systems (Windows Server, Ubuntu Linux, and Windows Desktop) and you don’t need to manage the underlying physical server.</p><p>Why are we concerned about Azure Virtual Machine at the era of Serverless services such as Azure Function or fully managed service as App Service? In case distributed systems with micro-services like architecture, App Service or Azure Function don’t give us container orchestrator functionality. Instead, a better choice will be AKS (Azure Kubernetes Service). AKS simplifies the deployment, the management and the operations of Kubernetes. Kubernetes is an open-source container-orchestration system for automating application deployment, scaling and management. Azure Kubernetes Service makes it quick and easy to deploy and manage containerized applications without container orchestration expertise. <em>When setting up an AKS cluster, the AKS nodes will basically be running on Azure Virtual Machine</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*RrnpVaiwt21nuW-IaLif6w.png" /><figcaption>Azure Kubernetes Service</figcaption></figure><p>Because of AKS’s growing popularity, I think it’s important to understand the SLA (Service Level Agreement) provided for the VMs which will then affect the SLA of your application when hosted via AKS.</p><p>In Azure, there are different SLAs for Virtual Machine.</p><ul><li><strong>99.9%</strong> — This is the SLA for a single instance Virtual Machine. Azure guarantees 99.9% connectivity for a single VM for all operating system disk and data disk.</li><li><strong>99.95%</strong> — Azure guarantees connectivity of at least 99.95% for all virtual machines that have two or more instances deployed in the same Availability Set.</li><li><strong>99.99%</strong> — Azure guarantees connectivity of at least 99.99% for all virtual machines that have two or more instances deployed across two or more Availability Zones in the same Azure Region.</li></ul><p>Availability Set and Availability Zones configurations allow reducing as much as possible the VM’s downtime. A VM’s downtime can be related to reboots (planned or unplanned to patch installation) or incidents such as power supply issues, network issues, storage issues etc.</p><p>Let’s see in more details Availability Set and Availability Zones.</p><h3>Availability Sets — 99.95% SLA</h3><p>Azure configures Availability sets VMs in “Fault Domains” and “Update Domains”. A fault domain is essentially a rack of servers and each of them is connected to a different network and power supply. Instead, an update domain is a logical unit of deployment. The fault domain is useful to mitigate hardware failures and the updated domain to mitigate downtime during VM’s maintenance. For each region, Azure provides a maximum of 3 fault domains and a maximum of 20 update domains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BlpY6VWpap-YusBwG1TSmQ.png" /><figcaption>Fault Domains and Update Domains</figcaption></figure><p>How Azure distributes the VMs inside an Availability Set?</p><p>Let’s assume we want to deploy our application in Availability Sets of 2 VMs, one VM will be deployed against the fault domain 0, the other one inside fault domain 1. Each VM will also be assigned to a different update domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*618A5oOEvVq-VfWUXh1rGA.png" /><figcaption>Availability Sets — VMs distribution</figcaption></figure><p>Let’s see what happens in the case of a hardware failure and a reboot due to VM maintenance from Microsoft.</p><p><strong>Hardware failure</strong> <em>— </em>If there is an issue with the hardware from fault domain 0, it will only impact that domain and our application will still be running because there is a replica VM running in fault domain 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wrO-mSMDiDG4NK5-qxtdgA.png" /><figcaption>Availability Sets — FD0 failure</figcaption></figure><p><strong>VM reboot</strong><em> — </em>If Microsoft needs to reboot the VMs to do a security patch installation, they reboot one update domain at a time. So they reboot all the VMs under updated domain 0, when they are all up and running, they will then reboot the VMs under Update domain 1 and so on.</p><p>So with the combination of 3 fault domains and 20 update domains, Microsoft tries to reduce as much as possible the downtime due to hardware failures or security patch installation.</p><h3>Availability Zones — 99.99% SLA</h3><p>With Availability Zones, we can deploy our VMs across multiple data-center of the same region. For example, if we have our application running 3 VMs, we can decide to deploy one VM in zone 1, one in zone 2 and another in zone 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HxlehpoSxvh0GihN-yMhFQ.png" /><figcaption>Availability Zones</figcaption></figure><p>In this way, we make our application more reliable if one of the data-center goes down.</p><p>Availability Zones can be used to provide a higher level of availability to an application deployed in AKS, where the clusters can be distributed across availability zones. When the cluster components are distributed across multiple zones, your AKS cluster is able to tolerate failure in one of those zones. In this way, our applications and management operations continue to be available even if one entire datacentre has a problem.</p><h3>References</h3><ul><li><a href="https://docs.microsoft.com/en-us/azure/aks/availability-zones?view=azure-cli-latest">Use Availability Zones in Azure Kubernetes Service (AKS)</a></li><li><a href="https://blogs.technet.microsoft.com/bulentozkir/2015/02/06/azure-concepts-update-domain-vs-fault-domain-in-availability-sets-simply-explained/">Azure concepts - Update Domain vs Fault Domain in Availability Sets - simply explained</a></li><li><a href="https://www.udemy.com/course/az-102-azure-administrator-certification-transition/">Exam AZ-300: Microsoft Azure Architect Technologies</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2e808fd0365" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocco-scaramuzzi-tech/azure-sla-for-virtual-machines-f2e808fd0365">Azure SLA for Virtual Machines</a> was originally published in <a href="https://medium.com/rocco-scaramuzzi-tech">rocco.tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure Blob Storage Access]]></title>
            <link>https://medium.com/rocco-scaramuzzi-tech/azure-blob-storage-access-c368b0b14f47?source=rss-f1d27c73c5fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/c368b0b14f47</guid>
            <category><![CDATA[storage-account]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[blob-storage]]></category>
            <dc:creator><![CDATA[Rocco Scaramuzzi]]></dc:creator>
            <pubDate>Tue, 31 Dec 2019 10:48:05 GMT</pubDate>
            <atom:updated>2019-12-31T10:48:05.056Z</atom:updated>
            <content:encoded><![CDATA[<p>Azure Blob Storage is one of the most common services used in the Azure Storage account. As you might already know, Blob Storage is mainly used to store object type data such as images, videos, spreadsheet etc. Please find additional details in one of my previous articles <a href="https://medium.com/rocco-scaramuzzi-tech/azure-storage-account-4e71d8c17040">here</a>.</p><p>When working with Blob, we should first create a container that is like a high-level folder and each container can have its own access level. There are three possible access levels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jJ25ZcMl0k24Zz-3jPzzbw.png" /><figcaption>Container access level</figcaption></figure><ol><li>Private (no anonymous access)</li><li>Blob (anonymous read access for blobs only): it means the single blob has got a URL publicly accessible.</li><li>Container (anonymous read access for container and blobs): it means the single blob has got a URL publicly accessible and an anonymous user can also list the container content.</li></ol><p>Generally speaking, it is always a good practice to create your container with a private access level and have your trusted application access the blob via the “Access Keys”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xvy96Qx0UUwrJ_OEAonZ9w.png" /><figcaption>Storage account — Access Keys</figcaption></figure><p>We have two access keys for security purposes and Microsoft recommends regenerating the access keys regularly. We have two access keys so that we can maintain connections using one key while regenerating the other.</p><p>Access keys are just one level of security that gives access to the entire storage account. There is also SAS (Shared Access Signatures) which is a more secure way to provide access to our storage account.</p><p>We can set two types of SAS:</p><ul><li>Account-level — it sets the access to all service types in an account</li><li>Service level — Blob, queue, table, file.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IvGlndGSYZkLCqwSkwtaHQ.png" /><figcaption>SAS — Account level</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4c4XW8dW2nmB6PQMchgt-Q.png" /><figcaption>SAS — Service level</figcaption></figure><p>As you can notice from the above pictures, we can set start/end time and IP addresses to add additional restrictions for the access.</p><p>As a bit of general advice, whenever an application needs to access your storage account, unless it’s your trusted internal application, please avoid using the “Access Keys”.</p><h3>References</h3><p><a href="https://www.udemy.com/course/az-102-azure-administrator-certification-transition/">Exam AZ-300: Microsoft Azure Architect Technologies</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c368b0b14f47" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocco-scaramuzzi-tech/azure-blob-storage-access-c368b0b14f47">Azure Blob Storage Access</a> was originally published in <a href="https://medium.com/rocco-scaramuzzi-tech">rocco.tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure Storage Account]]></title>
            <link>https://medium.com/rocco-scaramuzzi-tech/azure-storage-account-4e71d8c17040?source=rss-f1d27c73c5fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e71d8c17040</guid>
            <category><![CDATA[azure-table-storage]]></category>
            <category><![CDATA[blob-storage]]></category>
            <category><![CDATA[azure-storage]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[queue]]></category>
            <dc:creator><![CDATA[Rocco Scaramuzzi]]></dc:creator>
            <pubDate>Sun, 17 Nov 2019 10:19:30 GMT</pubDate>
            <atom:updated>2019-12-31T10:49:52.578Z</atom:updated>
            <content:encoded><![CDATA[<p>If you have an application running Azure Virtual Machine or in a PaaS (Platform as a service) component and this application needs to store files then Azure Storage is your best solution. Even if your application is running in a virtual machine, it’s not a good practice to store files inside the disk for several reasons such as cost, coupling and scalability.</p><p>These are the two main advantages of using Azure storage accounts:</p><ul><li>Decoupling: we don’t have one single point of failure. For example, the assets in your Azure Storage will still be available even if your application fails to run.</li><li>Scalability: Azure storage is a service designed to scale.</li></ul><p>The objective of this article is to help you to decide which storage service to utilize and how to select the right settings in terms of performance, access and replication.</p><h4>Storage Services</h4><p>Azure Storage provides four types of services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*py1fnASEj767jWRgnOii7Q.png" /><figcaption>Azure Storage services</figcaption></figure><ol><li><em>Blob Container storage</em>: it’s mainly used to store object type data such as images, videos, spreadsheets, etc.</li><li><em>File storage</em>: this is used as a shared file place. This is accessible via the industry standard Server Message Block (SMB) protocol and you can mount the file storage from your Windows, Linux, macOS machine.</li><li><em>Table storage</em>: this is NoSQL key-value storage mainly used to store very simple structure data such as operation logs, user access information which needs to have really quick access.</li><li><em>Queue storage</em>: this is the simplest asynchronous message queuing in Azure used to exchange information between different components.</li></ol><h4>Storage Accounts</h4><p>When setting up an Azure storage account, you can choose between four types of Accounts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UEFJSuRAAIkD7asU9f5LAQ.png" /><figcaption>Azure storage account</figcaption></figure><ol><li><em>Block Blob storage accounts</em>: only used to store Blob objects with premium performance characteristics. Recommended for scenarios with high transaction rates, using smaller objects, or requiring consistently low storage latency.</li><li><em>File Storage storage accounts</em>: only used to store files with premium performance characteristics. Recommended for enterprise or high-performance scale applications.</li><li><em>General Purpose v1</em>: this allows us to use the Blob, File, Queue and Table service. This is a legacy account, instead please use general-purpose v2 accounts when possible.</li><li><em>General Purpose v2</em>: this allows us to use the Blob, File, Queue and Table service.</li></ol><h4>Performance Tiers</h4><p>Azure storage provides two performance tiers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tEEMUu-H0RUDg0Y38bwvlQ.png" /><figcaption>Azure storage performance tier</figcaption></figure><ol><li><em>Standard</em>: this allows storage of blobs, files, tables, queues and Azure virtual machine disks.</li><li><em>Premium</em>: this allows storage of unmanaged virtual machine disks only.</li></ol><p>So, most of the time we should be using the Standard option unless we want to use the storage to create an unmanaged disk for virtual machines.</p><h4>Access Tiers</h4><p>Azure storage provides two main access tiers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-_u5UqlHfZGzxLRqqRC2wQ.png" /><figcaption>Azure storage access tier</figcaption></figure><ol><li><em>Hot</em>: This is ideal for frequently accessed data. The cost for this tier is higher for storage but it’s lower for the access.</li><li><em>Cool</em>: this is ideal for infrequently accessed data. The cost for this tier is lower for storage but it’s higher for the access.</li></ol><p>Please note there is a third access tier named “<em>Archived</em>” which can be set at the blob level. This is mainly used to archive data and here the storage costs are lower than the cool tier and the access costs are higher than the cool or hot tier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9uVYkPwHxuMUIxUq1zSk2A.png" /><figcaption>Azure storage Archive access tier</figcaption></figure><p>If we select an “Archive” access tier then the blob won’t be enabled until we revert the access tier to hot or cool and this operation might take several hours.</p><h4>Replication</h4><p>Azure storage provides four replication options. I am excluding two additional ones which are still in “preview” mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FtozUxNR-5L4vNl4CwbnDw.png" /><figcaption>Azure storage replication</figcaption></figure><ol><li>Locally-redundant storage (LRS)</li><li>Zone-redundant storage (ZRS)</li><li>Geo-redundant storage (GRS)</li><li>Read-access geo-redundant storage (RA-GRS)</li></ol><p>Let’s see in more details each option.</p><blockquote>Locally-redundant storage (LRS)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*HCvTDRF-vxW6TxSWMqlT2A.png" /><figcaption>Azure storage replication LRS</figcaption></figure><p>This is the basic option and also the most cost-effective one; by default the data are physically replicated in three different storage, belonging to the same data-center for a given region. The advantage is that if one storage goes down then we can still have access to our data via the other two storage. Data is replicated synchronously three times within the same data-center.</p><blockquote>Zone-redundant storage (ZRS)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*xe3yUcw2zRjeMmXztm9Z5Q.png" /><figcaption>Azure storage replication ZRS</figcaption></figure><p>With this option, our data are stored in three different data-centers, so if one data-center goes down then our data are still accessible from the other two data-centers. Data is replicated synchronously across three Azure availability zones.</p><blockquote>Geo-redundant storage (GRS)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*c7xO7VptVsSFel6nOP1PcA.png" /><figcaption>Azure Storage replication GRS</figcaption></figure><p>The data are stored in two different data-centers from different regions. The data is only accessible from the master storage and only when the master goes down then Azure will redirect the access to the data from the other region. Data is replicated synchronously three times in the master region, then replicated asynchronously to the secondary region. This is the most reliable and also the most expensive option.</p><blockquote>Read-access geo-redundant storage (RA-GRS)</blockquote><p>This is very similar to the GRS option but with RA-GRS data can be read from master or secondary region as well.</p><h4>References</h4><ul><li><a href="https://docs.microsoft.com/en-us/azure/storage/common/storage-account-overview">Storage account overview - Azure Storage</a></li><li><a href="https://www.udemy.com/course/az-102-azure-administrator-certification-transition/">Exam AZ-300: Microsoft Azure Architect Technologies</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e71d8c17040" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocco-scaramuzzi-tech/azure-storage-account-4e71d8c17040">Azure Storage Account</a> was originally published in <a href="https://medium.com/rocco-scaramuzzi-tech">rocco.tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microsoft Azure Functions —  Overview]]></title>
            <link>https://medium.com/rocco-scaramuzzi-tech/microsoft-azure-functions-overview-b8448c9e2f97?source=rss-f1d27c73c5fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8448c9e2f97</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[azure-functions]]></category>
            <dc:creator><![CDATA[Rocco Scaramuzzi]]></dc:creator>
            <pubDate>Tue, 10 Sep 2019 20:55:33 GMT</pubDate>
            <atom:updated>2019-12-02T11:52:19.026Z</atom:updated>
            <content:encoded><![CDATA[<h3>Microsoft Azure Functions — Overview</h3><h3>What is it?</h3><p>Azure Functions is a Serverless computing service hosted in Microsoft Azure cloud. Azure function is designed to accelerate and simplify the development of applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5A8Z1_etL7c9s42qymKqXg.png" /></figure><p>Serverless computing, known as a function as well as a service, is a cloud-computing execution model in which the cloud provider runs the server and dynamically manages the allocation of machine resources.</p><p>With Serverless, a developer can simply develop and upload code, and then define triggers or events that will execute the code. Scaling, capacity planning and maintenance operations may be hidden from the developer.</p><p>Regarding pricing, instead of paying for pre-purchased resources each month, with Serverless computing the price is generally based on the actual amount of resources consumed by the application.</p><p>Azure Functions is formed by event and code. Several built-in events belong to these main categories:</p><ul><li>Web-based — trigger function on an HTTP request or web-hook</li><li>Time-based — trigger function on a regular schedule</li><li>Data based — trigger function on a message in a queue or new item in a Cosmos DB etc</li></ul><p>About coding, Azure Functions supports several programming languages such as C#, F#, Node.js, Python and PHP. The code can be written either via a classic IDE or directly within the Azure Portal.</p><h4>Why Using Azure Functions?</h4><ul><li>Rapid and simple development — your team can focus more on code development</li><li>Cost-effective pricing — pay for what you use</li><li>No servers to maintain — Automatic scaling</li></ul><h4>Azure Functions Use Cases</h4><ul><li>Decomposing or extending monolithic applications</li><li>Adapters for integrating systems</li><li>Experiments and prototyping</li><li>Independent scaling</li></ul><h4>My Real-World Use Case</h4><p><em>Problem</em></p><p>Our customer has asked to build an MVP for their house repair appointment system. The project aims to build a uniform appointment system that allows the booking of a time slot for different contractors. Each contractor exposes its APIs (for getting availability and booking an appointment) and then our uniform appointment system selects the specific API for the right contractor based on the request details.</p><p><em>Solution</em></p><ul><li>Back-end: C# with .net core</li><li>Front-end: React</li><li>Cloud: <strong>Azure Functions</strong>, Cosmos DB, Key Vault</li><li>CI: Azure DevOps</li><li>Domain-Driven Design</li></ul><p><em>Advantages in hosting the application in Azure Functions</em></p><ul><li>Not much effort is required to set up the infrastructure. The team has mainly focused on developing the MVP business logic in a short period of time.</li><li>Have something deployed and up and running on the cloud from the end of sprint 1.</li><li>Solutions that are scaled automatically based on the users’ load.</li></ul><p>References:</p><p>searchcloudcomputing.techtarget.com</p><p>https://azure.microsoft.com/en-gb/services/functions/</p><p><a href="https://en.wikipedia.org/wiki/Serverless_computing">https://en.wikipedia.org/wiki/Serverless_computing</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8448c9e2f97" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rocco-scaramuzzi-tech/microsoft-azure-functions-overview-b8448c9e2f97">Microsoft Azure Functions —  Overview</a> was originally published in <a href="https://medium.com/rocco-scaramuzzi-tech">rocco.tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>