<?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 Vidyachandrasekar on Medium]]></title>
        <description><![CDATA[Stories by Vidyachandrasekar on Medium]]></description>
        <link>https://medium.com/@vidyachandrsekar?source=rss-3db4cbf63dd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*GkT3tXm8vbBc_gid</url>
            <title>Stories by Vidyachandrasekar on Medium</title>
            <link>https://medium.com/@vidyachandrsekar?source=rss-3db4cbf63dd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 13:43:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vidyachandrsekar/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[Retention Policy for yaml pipelines to support Disaster Recovery]]></title>
            <link>https://medium.com/@vidyachandrsekar/retention-policy-for-yaml-pipelines-to-support-disaster-recovery-397abd7b3877?source=rss-3db4cbf63dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/397abd7b3877</guid>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[ci]]></category>
            <category><![CDATA[yaml]]></category>
            <category><![CDATA[azure-devops]]></category>
            <category><![CDATA[disaster-recovery]]></category>
            <dc:creator><![CDATA[Vidyachandrasekar]]></dc:creator>
            <pubDate>Mon, 27 Jan 2025 06:34:14 GMT</pubDate>
            <atom:updated>2025-01-27T06:34:14.231Z</atom:updated>
            <content:encoded><![CDATA[<p>Here are the few steps that needs to be followed in order to retain the yaml pipelines to support disaster recovery.</p><ol><li><strong>To retain the yaml pipeline for all AKS pipelines, the following step needs to be added as part of the yaml pipeline.</strong></li></ol><blockquote>task: PowerShell@2<br> condition: and(succeeded(), not(canceled()), startsWith(variables[‘Build.SourceBranch’], ‘releases/’))<br> name: RetainReleaseBuildOnSuccess<br> displayName: Retain Release Build on Success<br> inputs:<br> failOnStderr: true<br> targetType: ‘inline’<br> script: |<br> $contentType = “application/json”;<br> $headers = @{ Authorization = ‘Bearer $(System.AccessToken)’ };<br> $rawRequest = @{ daysValid = 365 * 2; definitionId = $(System.DefinitionId); ownerId = ‘User:$(Build.RequestedForId)’; protectPipeline = $false; runId = $(Build.BuildId) };<br> $request = ConvertTo-Json @($rawRequest);<br> $uri = “$(System.CollectionUri)$(System.TeamProject)/_apis/build/retention/leases?api-version=6.0-preview.1”;<br> Invoke-RestMethod -uri $uri -method POST -Headers $headers -ContentType $contentType -Body $request;</blockquote><p><strong>2. To obtain the pipeline details, the following command can be used.</strong></p><blockquote>$release = @{ daysValid = 365 * 100; definitionId = $(System.DefinitionId); ownerId = ‘User:$(Build.RequestedForId)’; protectPipeline = $false; runId = $(Build.BuildId) };<br>$request = ConvertTo-Json @($release);<br>$uri = “$(System.CollectionUri)$(System.TeamProject)/_apis/build/retention/leases?api-version=6.0-preview.1”;<br>Invoke-RestMethod -uri $uri -method POST -Headers $header -ContentType “application/json” -Body $request;<br>Write-Output “This Deployment_ID-$(Build.BuildId) is Retained Forever”</blockquote><blockquote>#Delete Old Retain CD Build<br>#Get all Builds for a Definition<br>$url = “$(System.CollectionUri)$(System.TeamProject)/_apis/build/builds?definitions=$(System.DefinitionId)&amp;api-version=6.0”;<br>$allBuildsOfDefinition = Invoke-RestMethod -Uri $url -Method Get -ContentType “application/json” -Headers $header</blockquote><blockquote>#Process each Build of Definition<br>$allBuildsOfDefinition.value | Where-Object {$_.keepForever -eq “True”}| Where-Object {$_.result -contains “succeeded”} | Where-Object {$_.sourceBranch -contains “main” -or $_.sourceBranch -contains “master” -or $_.sourceBranch -match “release”} | Sort-Object id | ForEach-Object {<br> Write-Host “CD Build Id:” $_.id “keepForever:” $_.keepForever “Branch:” $_.sourceBranch<br> #Get all Retention Leases for this Build<br> $url1 = “$(System.CollectionUri)$(System.TeamProject)/_apis/build/builds/” + $_.id + “/leases?api-version=7.1-preview.1”<br> $allLeasesOfBuild = Invoke-RestMethod -Uri $url1 -Method Get -ContentType “application/json” -Headers $header</blockquote><p><strong>3. The following condition is added to retaining only 3 latest builds and deleting the other builds created for the same branch(release/master)</strong></p><blockquote>$allBuildsOfDefinition.value | Where-Object {$_.keepForever -eq “True”}| Where-Object {$_.result -contains “succeeded”} | Where-Object {$_.sourceBranch -contains “main” -or $_.sourceBranch -contains “master” -or $_.sourceBranch -match “pbi”} | Sort-Object id -Descending | Select-Object -Skip 3 | ForEach-Object {<br> Write-Host “CI Build Id:” $_.id “keepForever:” $_.keepForever “Branch:” $_.sourceBranch<br> #Get all Retention Leases for this Build<br> $url1 = “$env:COLLECTION_URI/_apis/build/builds/” + $_.id + “/leases?api-version=7.1-preview.1”<br> $allLeasesOfBuild = Invoke-RestMethod -Uri $url1 -Method Get -ContentType “application/json” -Headers $header</blockquote><p><strong>4. This condition is added to skip deleting the latest 3 builds.</strong></p><blockquote>| Sort-Object id -Descending | Select-Object -Skip 3</blockquote><p><strong>5. This condition is used to retain the build that is succeeded and run from master/main branch</strong></p><blockquote>Where-Object {$_.result -contains “succeeded”} | Where-Object {$_.sourceBranch -contains “main” -or $_.sourceBranch -contains “master”</blockquote><p><strong>6. In order to delete the build, the lease that was created while retaining the build has to be deleted. And this can be done using the following script.</strong></p><blockquote>#Delete each Lease of Build<br> $allLeasesOfBuild.value | ForEach-Object {<br> $url2 = “$(System.CollectionUri)$(System.TeamProject)/_apis/build/retention/leases?ids=” + $_.leaseId + “&amp;api-version=7.1-preview.2”<br> Invoke-RestMethod -Uri $url2 -Method Delete -ContentType “application/json” -Headers $header<br> Write-Host “CD Lease Id:” $_.leaseId “ deleted”<br> }</blockquote><p><strong>References:</strong></p><ol><li><a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/build/run-retention?view=azure-devops&amp;tabs=powershell">Using Tasks to Retain Runs in Azure Pipelines — Azure Pipelines | Microsoft Learn</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=397abd7b3877" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Redux Overview]]></title>
            <link>https://medium.com/@vidyachandrsekar/react-redux-overview-23ac95c083d1?source=rss-3db4cbf63dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/23ac95c083d1</guid>
            <category><![CDATA[redux-toolkit]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[redux]]></category>
            <dc:creator><![CDATA[Vidyachandrasekar]]></dc:creator>
            <pubDate>Mon, 27 Jan 2025 06:33:20 GMT</pubDate>
            <atom:updated>2025-01-27T06:33:20.616Z</atom:updated>
            <content:encoded><![CDATA[<ul><li><strong>Redux </strong>is a widely used <strong>state management library</strong> that simplifies managing state in applications. React Redux is the official binding library for integrating Redux with React. <strong>Redux </strong>enables centralized state management and sharing across multiple components in a React application.</li><li><strong>Redux </strong>is <strong>framework-agnostic</strong> and can be used with any JavaScript library or framework. React Redux provides utilities to seamlessly connect Redux with React.</li></ul><p><strong>It allows React components to:</strong></p><ul><li>Read data from the Redux store.</li><li>Dispatch actions to update the store.</li><li>By centralizing state, Redux reduces <strong>prop drilling</strong> and improves code maintainability.</li></ul><p><strong>Key Features of Redux</strong></p><p>a. <strong>Centralized State Management</strong>:</p><p>Redux stores the entire application state in a single store, simplifying state access and management.</p><p>b. <strong>Predictable State Updates</strong>:</p><p>State updates occur in a predictable way through <strong>actions</strong> and <strong>reducers</strong>, ensuring consistent application behavior.</p><p>c. <strong>Component Separation</strong>:</p><p>React Redux decouples UI components from state management logic, resulting in cleaner, more maintainable code.</p><p><strong>Benefits of Redux</strong></p><ol><li><strong>Better State Management</strong>: Provides a single source of truth for application state.</li><li><strong>Debugging and Testing</strong>: Tools like Redux Dev Tools make debugging and testing easier.</li><li><strong>Improved Code Maintainability</strong>: Separates concerns, making it easier to maintain and scale the application.</li></ol><p><strong>How to Set Up React Redux</strong></p><ol><li><strong>Create a React Project</strong>:</li></ol><p>This will help you create a react project with the necessary configurations.</p><p><strong>npx create-react-app my-first-redux</strong></p><p><strong>cd my-first-redux</strong></p><ol><li><strong>Install React Redux</strong> using the following command</li></ol><p><strong>npm install redux react-redux</strong></p><p>This will install the redux related configurations. These are the following dependencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*8Woqr_63HpA6HDj4aA2KYQ.png" /></figure><p>We also use <strong>Redux Toolkit (@reduxjs/toolkit)</strong> package that wraps around redux package to include the common dependencies and configurations required for Redux app.</p><p><strong>Three Core Concepts of Redux</strong></p><ol><li><strong>Actions</strong>: Actions are plain JavaScript objects that describe what needs to happen in the application.</li><li><strong>Reducers</strong>: Functions that determine how the application’s state changes in response to an action.</li><li><strong>Store</strong>: A centralized container that holds the application’s state.</li></ol><p><strong>Primitives API</strong></p><p>Redux core is a very small and deliberately unopinionated library which provides the following Primitives API.</p><p>1. <strong>createStore</strong> — Creates a Redux Store</p><p>2. <strong>combineReducers</strong> — Combines multiple slices reduces to single large reducer</p><p>3. <strong>applyMiddleware</strong> — Combines multiple middleware into store enhancer</p><p>4. <strong>compose</strong> — combines multiple store enhancers into single store enhancer</p><p>We can understand the above concepts using the following example which will show two buttons based on which the value ‘0’ changes. Clicking on ‘+’ and increment async will increment the value and other buttons will do the vice versa.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*PJhmyr339h-ks3O7Q9b6bQ.png" /><figcaption>Application to increment the values</figcaption></figure><p>Some of the major files used in running the application</p><p>· <strong>Store.js — </strong>To create the Redux store and export it. It will also configure the Redux Dev Tools to inspect the store while developing. We need to import the reducer function from the counter slice and add it to the store. Updates will be handled by passing a parameter in the reducer which will tell the store to use this slice reducer function according to the state updates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*VXmsRMwZ7Pe3BX57B8t11A.png" /><figcaption>store.js</figcaption></figure><p>· <strong>index.js — </strong>To import the store and pass the store as a prop. This is our main application where we put the React components by putting a React-Redux <strong>&lt;Provider&gt;. </strong>This helps the rendering of application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*5hZAWWL9tXr1fjJ2mN_W7g.png" /><figcaption>index.js</figcaption></figure><p>· <strong>counterSlice.js — </strong>Import create Slice API from Redux Toolkit. To create a slice, you need a string name to identify it, an initial state value, and one or more reducer functions that specify how the state can be updated. After the slice is created, you can export the automatically generated Redux action creators along with the reducer function for the entire slice. The function below is called a <strong>thunk</strong> and allows us to perform async logic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*1NsQxsetQwD-xM18y9Oh2A.png" /></figure><p>· <strong>Counter.js — </strong>Contains the main functionality of the Application. Contains the code for the buttons which does the increment and decrement on button click. <strong>App.js</strong> imports and shows in the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*vWFLvYTcmwZSvJKoNETUnw.png" /></figure><p>· <strong>App.js- </strong>This is the frontpage of the application which is visible in the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Uw5wXXHNJaIgcm9PieGTJA.png" /></figure><p><strong>Redux state and Actions in React Components</strong></p><p>With React-Redux hooks, React components can connect to the Redux store. The <strong>useSelector </strong>hook allows components to access data from the store, while <strong>useDispatch </strong>lets them send actions. To get started, create a Counter.js file in the <strong>src/features/counter/</strong> directory with a <strong>&lt;Counter&gt;</strong> component. Then, import this component into App.js and include it within the <strong>&lt;App&gt;</strong> component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*3t2KRr_KzUu3UcUsu0rQ3w.png" /><figcaption><strong>React state</strong></figcaption></figure><p>And lastly run the commands</p><p><strong>npm run build — </strong>To identify the build errors and build the project</p><p>And the following commands to deploy to static server and run the code</p><p><strong>npm install -g serve</strong></p><p><strong>serve -s build</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*_D02uV92wFZ94JTJSrd1eA.png" /><figcaption><strong>Final Application</strong></figcaption></figure><p><strong>References</strong></p><ul><li><a href="https://www.geeksforgeeks.org/introduction-to-react-redux/">Introduction to React-Redux — GeeksforGeeks</a></li><li><a href="https://www.geeksforgeeks.org/what-are-the-3-core-concepts-of-react-redux/">What are the 3 Core Concepts of React Redux? — GeeksforGeeks</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23ac95c083d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud Design Patterns: The Bulkhead Pattern]]></title>
            <link>https://medium.com/@vidyachandrsekar/cloud-design-patterns-the-bulkhead-pattern-78dbed86e9d5?source=rss-3db4cbf63dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/78dbed86e9d5</guid>
            <category><![CDATA[cloud-design-patterns]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[bulkhead]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[Vidyachandrasekar]]></dc:creator>
            <pubDate>Fri, 06 Oct 2023 06:32:52 GMT</pubDate>
            <atom:updated>2023-10-06T06:36:15.369Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Cloud Design Patterns: The Bulkhead Pattern</strong></p><p><strong>Introduction:</strong></p><p>Cloud design patterns are essential for building robust, scalable, and secure applications in cloud environments. Among these patterns, the Bulkhead Pattern stands out as a critical component for ensuring the reliability and availability of cloud-based systems. This pattern addresses the issue of resource isolation, providing a safeguard against cascading failures and ensuring the smooth operation of applications even when some components encounter difficulties.</p><p><strong>Problem Statement:</strong></p><p>In distributed systems and cloud-based applications, multiple components or services often share common resources like thread pools, database connections, or network ports. The challenge arises when one of these components fails or becomes overloaded; it can lead to a domino effect, impacting other components and ultimately compromising the entire system’s performance and availability.</p><p><strong>Bulkhead Pattern Overview:</strong></p><p>The Bulkhead Pattern offers a solution to this problem by segregating the elements of an application into distinct pools or partitions, often referred to as “bulkheads.” This concept is akin to the watertight compartments in a ship that prevent water from flooding other sections in case of a breach. In the realm of software architecture, bulkheads ensure that the failure or overload of one component does not disrupt the operation of others.</p><p><strong>Considerations for Applying the Bulkhead Pattern:</strong></p><ol><li><strong>Resource Isolation:</strong> Begin by identifying the critical resources that require isolation, such as thread pools, database connections, or network ports. These resources should be allocated to specific groups or services to create effective bulkheads.</li><li><strong>Workload-Based Isolation:</strong> Tailor the bulkheads based on workload or importance. Critical services should have dedicated bulkheads, while less critical ones can share resources within a separate bulkhead.</li><li><strong>Scaling and Redundancy:</strong> Implement redundancy by deploying multiple instances of the same service in different containers or regions. This ensures service availability even if one instance encounters issues or is under attack.</li><li><strong>Monitoring and Alerting:</strong> Implement robust monitoring and alerting systems to promptly detect when a bulkhead becomes overloaded or experiences issues. Automated processes can then take corrective actions, such as scaling resources or isolating problematic services.</li></ol><p><strong>Example:</strong></p><p>Consider a microservices-based e-commerce platform. One service manages user authentication, while another handles product Catalog requests. Both services rely on a shared database connection pool for retrieving and updating user data and product information.</p><p>By applying the Bulkhead Pattern, you isolate the database connection pool for each service. If the user authentication service experiences a surge in traffic or database-related issues, it won’t affect the product Catalog service’s ability to serve requests. Each service maintains its dedicated pool of database connections, ensuring that failures or overloads are contained within their respective bulkheads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*QxbZrGNDPM572NAe5BRxpA.png" /></figure><p><strong>When to Use the Bulkhead Pattern:</strong></p><p>The Bulkhead Pattern is particularly useful in the following scenarios:</p><ol><li><strong>Resource Isolation:</strong> When you need to isolate resources used by consumer backend services to prevent resource contention.</li><li><strong>Critical Consumer Isolation:</strong> To shield critical consumers (services) from standard consumers, ensuring the availability and responsiveness of critical services even during peak loads or failures.</li><li><strong>Cascading Failure Protection:</strong> To safeguard your application from cascading failures that can occur when issues in one service affect others.</li></ol><p><strong>Related Patterns:</strong></p><p>The Bulkhead Pattern can be effectively combined with other cloud design patterns, including:</p><ol><li><strong>Circuit Breaker Pattern:</strong> To provide fault tolerance by preventing continuous invocations of a service experiencing issues.</li><li><strong>Retry Pattern:</strong> For implementing retry strategies within bulkheads to gracefully handle transient failures.</li><li><strong>Throttling Pattern:</strong> To control and limit the rate of incoming requests, preventing a bulkhead from becoming overwhelmed.</li></ol><p><strong>Conclusion:</strong></p><p>The Bulkhead Pattern is a crucial design pattern for building resilient cloud applications. It plays a pivotal role in isolating and safeguarding critical resources and services, ensuring that failures are contained and do not lead to system-wide outages or performance degradation. Properly applied, this pattern enhances the reliability and availability of cloud-based systems, making it a valuable tool in cloud architecture design.</p><p><strong>References</strong></p><ol><li><a href="https://learn.microsoft.com/en-us/azure/architecture/patterns/">https://learn.microsoft.com/en-us/azure/architecture/patterns/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78dbed86e9d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>