<?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 Mayank on Medium]]></title>
        <description><![CDATA[Stories by Mayank on Medium]]></description>
        <link>https://medium.com/@mayank04111998?source=rss-f67ebf253fc2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*iOeY_KHmnat3Ifnj</url>
            <title>Stories by Mayank on Medium</title>
            <link>https://medium.com/@mayank04111998?source=rss-f67ebf253fc2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 14:16:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mayank04111998/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[Midnight laughs & Lifelong friendships]]></title>
            <link>https://medium.com/@mayank04111998/midnight-laughs-lifelong-friendships-49edf12de68c?source=rss-f67ebf253fc2------2</link>
            <guid isPermaLink="false">https://medium.com/p/49edf12de68c</guid>
            <category><![CDATA[friends]]></category>
            <category><![CDATA[time]]></category>
            <category><![CDATA[fun]]></category>
            <category><![CDATA[friendship]]></category>
            <category><![CDATA[memories]]></category>
            <dc:creator><![CDATA[Mayank]]></dc:creator>
            <pubDate>Mon, 03 Mar 2025 18:15:59 GMT</pubDate>
            <atom:updated>2025-03-03T18:18:29.920Z</atom:updated>
            <content:encoded><![CDATA[<p>Friendships that span over a decade are rare, and the memories they create are even rarer. This is a story about one such night — an unplanned adventure with two of my closest friends.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kYW47BVtoywXVbQHWrWD8A.jpeg" /></figure><p>I landed in Chandigarh from Chennai at 11:50 PM. My school friend, whom I’ve known for 14 years, was supposed to pick me up at 11:10 PM. But knowing him, I had a feeling he hadn’t even left home yet. Sure enough, when my flight got delayed by 40 minutes, he was still nowhere in sight. By the time I collected my luggage and stepped out, he had just arrived — perfect timing, in his own way.</p><p>Despite being exhausted from the journey, all my tiredness vanished the moment I saw him. It had been a while, but we picked up right where we had left off — our last trip together to Kashmir. The night was young, and I had no intention of resting. I convinced him that we should do something crazy instead. Soon, our third friend joined us, and the brainstorming began — Kasauli? A night out? Clubbing? A party?</p><h3>The Madness Begins</h3><p>Kasauli was out of the question due to landslides, and nightclubs were either closed or ridiculously expensive for stag entry. Just when we decided to get a hotel room, the universe had other plans — our left front tire was punctured. So, there we were, at 2 or 3 AM, all dressed up, crouched on the side of the road, changing a tire — something none of us had ever done before. The absurdity of the situation had us laughing, making this night even more memorable.</p><p>With the tire finally fixed, we decided to spend the night in the car, having drinks and talking about life. We parked at 3B2, a lively spot buzzing with energy. Everything seemed great — until a fight broke out nearby. Out of nowhere, someone threw a garden chair that landed right on our car! Instead of panicking, we rolled with it, driving off with the chair still on our bonnet. Our reaction changed the whole vibe — people burst into laughter. Eventually, the owner came to reclaim his chair, shaking his head at the ridiculousness of it all.</p><h3>Selling Ice Cream at 4 AM</h3><p>The night was far from over. Craving ice cream, we found a street vendor who, for some reason, handed over his cart to us. And just like that, we became ice cream sellers at 4 AM, pedaling around, offering treats to random strangers. The sight of three well-dressed guys playing street vendors had everyone around us in splits.</p><p>Amid all this madness, my school friend dropped a bombshell — he was getting married. The first one in our group! I was ecstatic for him, but at the same time, the words I had read earlier on my Indigo flight echoed in my mind: Time flies. Life was changing, and a part of me wondered if things would ever be the same again. But I pushed the thought away and focused on celebrating the moment.</p><h3>Sunrise at Sukhna Lake</h3><p>By now, the city was beginning to wake up, but we weren’t ready to call it a night. Around 6 AM, we decided to witness the sunrise at Sukhna Lake. The cool breeze, the shimmering water, and the golden hues of the rising sun made everything feel surreal. We even had a mini race among ourselves — one that I proudly won (haha!).</p><p>We spent time talking to random strangers — an artist sketching by the lake, a man brushing his teeth with a natural twig, cyclists, and even students campaigning for tuberculosis awareness. We jokingly suggested leading their campaign, making them laugh with our ridiculous ideas.</p><h3>The End of another moment</h3><p>As the city fully woke up, our energy finally began to fade. On our way back, my school friend started feeling sick, I somehow dozed off at a red traffic light, and our third friend couldn’t stop laughing at both of us. It was the perfect ending to a night that we never wanted to end.</p><p>Some friendships are like that — they heal you, energize you, and remind you what it means to truly live. Moments like these don’t last forever, but they become the stories we cherish for a lifetime.</p><blockquote>Because time flies. And the old us should never regret not having lived enough.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49edf12de68c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[System Design — Key considerations for a horizontally scaled solution]]></title>
            <link>https://medium.com/@mayank04111998/system-design-key-considerations-for-a-horizontally-scaled-solution-673d6edadc45?source=rss-f67ebf253fc2------2</link>
            <guid isPermaLink="false">https://medium.com/p/673d6edadc45</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Mayank]]></dc:creator>
            <pubDate>Sun, 15 Dec 2024 19:18:31 GMT</pubDate>
            <atom:updated>2024-12-17T20:22:58.117Z</atom:updated>
            <content:encoded><![CDATA[<h3>System Design — Key considerations for a horizontally scaled solution</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1-pYMiEDc1dWsBtvTjsh9Q.png" /></figure><p>Non members can read this article <a href="https://medium.com/@mayank04111998/system-design-key-considerations-for-a-horizontally-scaled-solution-673d6edadc45?sk=95a5ffd8a903e56db0b8c227d7c46f3a">here</a> for free.</p><p>Most of the system design problems or real world software architecture requires one to build scalable solution. <strong>Horizontal scaling</strong>, or scaling out, is one of the most effective ways to handle increased demand, by adding more instances or nodes to a system. While it offers several advantages, horizontal scaling comes with its own set of challenges that need to be carefully managed.</p><h3>What Does Scaling mean in System Design?</h3><p>In system design, “scaling” refers to the ability of a system to handle an increased load by efficiently utilizing resources. This can involve scaling up (increasing the capacity of existing resources) or scaling out (adding more instances or components). Effective scaling ensures that the system remains reliable, cost-efficient, and responsive under heavy loads.</p><p>There are two primary scaling types to consider:</p><ul><li><strong>Vertical Scaling (Scaling Up):</strong> Adding more power (CPU, RAM, storage) to existing machines or resources.</li><li><strong>Horizontal Scaling (Scaling Out):</strong> Adding more instances or machines to handle additional load, distributing the workload across multiple nodes.</li></ul><p>In this article, we will focus on advantages and challenges with horizontal scaling.</p><h3>Why Scalability Matters in System Design</h3><p>Scalability ensures that as demand grows, the system can continue to perform well without compromising on speed, reliability, or availability. Without proper scalability, systems may experience performance degradation, downtime, or even failure when subjected to high loads.</p><p>For example, imagine an e-commerce platform that experiences a surge in traffic during Black Friday sales. A system that is not designed to scale will likely experience slowdowns, service outages, or crashes. Conversely, a well-scaled system can handle such surges, providing a seamless experience for users.</p><h3>Key challenges of Horizontal Scaling</h3><ol><li><strong>Data Consistency</strong></li><li><strong>Data Distribution &amp; Load Balancing</strong></li><li><strong>Fault Tolerance and High Availability</strong></li><li><strong>State Management and Session Persistence</strong></li></ol><h3>Data Consistency</h3><p>Data consistency is primarily a concern when managing databases. In the context of database or storage systems data is replicated across multiple nodes for ensuring high availability and fault tolerance . Hence, it’s crucial to ensure that changes to the data are reflected consistently across all replicas or instances.</p><p>Mechanisms are required to ensure that each replica reflects the latest updates. Without these mechanisms, you can run into issues like:</p><ul><li><strong>Stale data</strong>: When a user reads data that hasn’t yet been updated across all replicas.</li><li><strong>Data conflicts</strong>: When different replicas have conflicting updates, making it unclear which version of the data should be considered the “correct” one.</li></ul><h4><strong>Solution</strong></h4><ul><li><strong>Consistency Models </strong>: Understanding the tradeoffs between consistency, and availability. Some systems may opt for <strong>eventual consistency</strong>, while others may prioritize <strong>strong consistency</strong>, depending on the application’s needs. Quorum consensus can guarantee consistency for both read and write operations. It is a concept used in distributed systems to ensure that a majority of nodes in a system agree on a decision or the state of the system. By adjusting the size of the quorum, systems can prioritize consistency (e.g., by requiring a larger quorum) or availability (e.g., by allowing a smaller quorum), depending on the requirements of the application.</li><li><strong>Vector version : </strong>A <strong>vector version</strong> is a technique used in distributed databases to manage and resolve data conflicts that arise due to concurrent updates across multiple nodes. It is a version control system where each piece of data has a <strong>vector clock</strong> associated with it. The vector clock tracks the version history of a particular item or record by associating it with timestamps for each node or replica that has modified it.</li></ul><h3><strong>Data Distribution &amp; Load Balancing</strong></h3><p>As the number of nodes increases in a horizontally scaled system, efficient load balancing becomes crucial. Improper load balancing can lead to situations where some servers are overloaded while others remain under-utilized, resulting in performance bottlenecks.</p><h4>Solution</h4><ul><li><strong>Load balancing algorithms</strong>: Use algorithms like round-robin, least connections, or weighted load balancing to ensure that traffic is evenly distributed across all available nodes.</li><li><strong>Auto-scaling</strong>: Implement auto-scaling mechanisms that automatically adjust the number of active nodes based on real-time demand. Cloud providers like AWS, Google Cloud, and Azure offer auto-scaling services that help manage traffic spikes and optimize resource utilization.</li></ul><p>In context of storage systems, load balancing often involves partitioning data across multiple nodes (this is called sharding or data partitioning). This helps ensure that no single node becomes a bottleneck by evenly distributing the data load. There are two challenges with data partitioning.</p><ul><li>Distribute data across multiple servers evenly.</li><li>Minimize data movement when nodes are added or removed.</li></ul><h4><strong>Solution</strong></h4><ul><li><strong>Consistent hashing — </strong>It is a technique which helps achieve an even distribution of data across partitions. It ensures that when a new partition is added, only a small subset of the data needs to be redistributed, minimizing the load on existing nodes.</li></ul><h3><strong>Fault Tolerance and High Availability</strong></h3><p>In a distributed system, failures are not only inevitable but common. Hence, it is important to ensure fault tolerance and high availability. Primary challenges with horizontal scaling is to ensure -</p><ul><li><strong>System availability in case of node failures</strong>: When availability is desired, node failures shouldn’t cause any significant downtime.</li><li><strong>Recovery from failures</strong>: The ability to automatically detect failures and quickly recover without significant downtime is vital for ensuring a seamless user experience.</li></ul><h4><strong>Solution</strong></h4><ul><li><strong>Replication</strong>: Data replication across multiple nodes ensures that even if one node fails, there is another copy of the data available. This is especially important for databases, where data consistency must be maintained.</li><li><strong>Failover mechanisms</strong>: Implementing failover protocols ensures that traffic is rerouted to healthy nodes when failures occur. These protocols often work in conjunction with health checks and monitoring systems to detect and address issues proactively.</li><li><strong>Sloppy Quorum and Hinted handoff : </strong>In case of databases, instead of enforcing quorum requirement, system ignores offline server and chooses healthy servers. When the server is up, changes will be pushed back to achieve data consistency which is known as hinted handoff.</li></ul><h3><strong>State Management and Session Persistence</strong></h3><p>Maintaining session state across multiple nodes can be a tricky issue in horizontally scaled systems. When a user interacts with one instance of the system, and that session needs to be preserved across different instances, session management becomes critical.</p><h4>Solution</h4><ul><li><strong>Stateless design</strong>: Aim for stateless applications wherever possible. In stateless designs, each request is independent, and the system does not maintain information between requests. This reduces the need for complicated state synchronization.</li><li><strong>External session stores</strong>: If maintaining state is necessary, consider using external session storage solutions like Redis to store session data. This ensures that any node can retrieve session information, regardless of which node the request is routed to.</li></ul><p>Thank You! 😇</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=673d6edadc45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with Amazon Bedrock]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@mayank04111998/getting-started-with-amazon-bedrock-0265dffafc59?source=rss-f67ebf253fc2------2"><img src="https://cdn-images-1.medium.com/max/1710/1*ZS9wBIeIFsuBhPNqxDejYQ.png" width="1710"></a></p><p class="medium-feed-snippet">Understand key concepts and bedrock components interaction</p><p class="medium-feed-link"><a href="https://medium.com/@mayank04111998/getting-started-with-amazon-bedrock-0265dffafc59?source=rss-f67ebf253fc2------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@mayank04111998/getting-started-with-amazon-bedrock-0265dffafc59?source=rss-f67ebf253fc2------2</link>
            <guid isPermaLink="false">https://medium.com/p/0265dffafc59</guid>
            <category><![CDATA[bedrock]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Mayank]]></dc:creator>
            <pubDate>Thu, 19 Sep 2024 12:08:34 GMT</pubDate>
            <atom:updated>2024-09-19T12:10:20.254Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Shortest Path Graph Algorithms]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@mayank04111998/shortest-path-graph-algorithms-5b7a5f6ae757?source=rss-f67ebf253fc2------2"><img src="https://cdn-images-1.medium.com/max/613/1*Bt8KKH5Fybnxgzi71khaxg.png" width="613"></a></p><p class="medium-feed-snippet">Algorithms and intutions behind them</p><p class="medium-feed-link"><a href="https://medium.com/@mayank04111998/shortest-path-graph-algorithms-5b7a5f6ae757?source=rss-f67ebf253fc2------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@mayank04111998/shortest-path-graph-algorithms-5b7a5f6ae757?source=rss-f67ebf253fc2------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b7a5f6ae757</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[dijkstra]]></category>
            <category><![CDATA[dfs]]></category>
            <category><![CDATA[graph]]></category>
            <category><![CDATA[bellman-ford-algorithm]]></category>
            <dc:creator><![CDATA[Mayank]]></dc:creator>
            <pubDate>Tue, 17 Sep 2024 18:53:04 GMT</pubDate>
            <atom:updated>2024-11-18T14:01:17.650Z</atom:updated>
        </item>
    </channel>
</rss>