<?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 Chirag Shetty on Medium]]></title>
        <description><![CDATA[Stories by Chirag Shetty on Medium]]></description>
        <link>https://medium.com/@chiragshetty98?source=rss-6be0044ad5d2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sYssofJxgy8xhXrL4SBT2Q.jpeg</url>
            <title>Stories by Chirag Shetty on Medium</title>
            <link>https://medium.com/@chiragshetty98?source=rss-6be0044ad5d2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 18:12:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chiragshetty98/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[How Beckn is shaping the future of e-commerce ?]]></title>
            <link>https://medium.com/@chiragshetty98/how-beckn-is-shaping-the-future-of-e-commerce-d243cdfaf104?source=rss-6be0044ad5d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/d243cdfaf104</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[india]]></category>
            <dc:creator><![CDATA[Chirag Shetty]]></dc:creator>
            <pubDate>Sat, 21 Oct 2023 04:56:32 GMT</pubDate>
            <atom:updated>2023-10-21T06:22:31.330Z</atom:updated>
            <content:encoded><![CDATA[<h3>How Beckn is shaping the future of e-commerce ?</h3><p><strong>A behind the scenes look at the next UPI like revolution from India</strong></p><p>Over the past decade, we’ve witnessed a remarkable transformation in India, transitioning from traditional methods to a digital economy, thanks to milestones like the introduction of Aadhar. The COVID-19 pandemic further accelerated this shift, driving us towards a more digital-centric existence, which has proven to be a significant improvement. If you’ve been even remotely connected to the world, you can’t help but acknowledge the transformative impact of the Unified Payment Interface (UPI) in our lives. UPI singlehandedly propelled us into the realm of being the <a href="https://timesofindia.indiatimes.com/gadgets-news/india-tops-world-ranking-in-digital-payments-beats-china-by-huge-margin-report/articleshow/100944643.cms">world’s largest digital payments nation</a>.</p><p>While much has been discussed regarding UPI’s architecture, scale, and economic significance, we are left pondering: What’s on the horizon for India? In this discussion, we will explore the potential for the next major digital revolution in India. Just as UPI revolutionised payments, a similar transformation could be in store for e-commerce through the <a href="https://ondc.org/">Open Network for Digital Commerce</a> (ONDC). While I don’t possess the intention or expertise to delve into its economic impact, what captivates me is the underlying technology that could facilitate this impending shift. ONDC represents a visionary network proposal built on the foundation of an open specification known as <a href="https://becknprotocol.io/">Beckn</a>, and it holds the promise of reshaping the digital landscape in India.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*XNL4XYUE4xMpuUmFwAKtkw.gif" /><figcaption>Simple visualisation of proposed ONDC network</figcaption></figure><h3>What is Beckn ?</h3><p>The Beckn protocol represents a comprehensive suite of specifications encompassing APIs, data models, reference architecture, transaction mechanisms, and global standards. When embraced by digital platforms, these specifications empower the establishment of decentralized networks. In simpler terms, think of Beckn as a universally accepted set of communication rules agreed upon by multiple platforms. These rules enable users to seamlessly engage in discovery, ordering, fulfilment, and post-fulfilment activities in a standardised manner.</p><p>To draw an analogy, consider the broader internet itself. It operates on a foundation of protocols and specifications such as HTTP (Hypertext Transfer Protocol) or SMTP (Simple Mail Transfer Protocol) for emails. In a similar vein, Beckn provides a standardised framework for digital platforms to interact and transact.</p><h3>What Beckn is Not ?</h3><p>It’s crucial to clarify that Beckn, including its current implementation, ONDC, is not an application designed to replace existing e-commerce systems. Rather, these are open specifications and standards aimed at fostering interoperability. To illustrate, think of the Unified Payment Interface (UPI), which serves as the underlying interface for interoperability among various stakeholders. UPI did not replace the banks; it simply enabled them to work more seamlessly with third-party payment apps and innovate continuously.</p><p>Similarly, ONDC aspires to be the underlying network that specialized players and e-commerce giants can integrate into their operations, leveraging the standardised protocols to enhance the e-commerce ecosystem without replacing it.</p><h3>How Does Beckn Work ?</h3><p>Let’s dive into the mechanics of the Beckn protocol by exploring its application in the context of a food delivery service like Swiggy or Zomato. The current food delivery ecosystem involves multiple stakeholders, each playing a vital role:</p><ol><li>The Restaurant (Service Provider): Restaurants utilise platforms like Swiggy or Zomato to showcase their menus, prices, operating hours, delivery areas, and more.</li><li>The Consumer (End User): Customers place orders, provide delivery addresses, and explore available options in their vicinity through the Swiggy or Zomato customer app.</li><li>The Delivery Rider: Responsible for collecting orders from the restaurant and delivering them to the customer. These riders rely on apps specifically designed for this purpose.</li><li>Swiggy / Zomato (Platform): These platforms serve as the hub for discovering service providers and managing the entire ordering experience, including transactions. They are also responsible for recruiting riders in various areas to ensure efficient service.</li></ol><p>This centralised approach places a significant burden and power to exploit on the platform, as it serves as the primary point of contact for discovery and transaction management. Every restaurant must register with each platform, and dedicated apps are required for delivery riders, making it platform-specific. This is a similar state in which digital transaction where a few years back with every player like Paytm / Google Pay having their own set of wallets with which transaction could happen within their apps and not across the apps.</p><h4>Food Delivery reimagined using Beckn</h4><p>Beckn simplifies every transaction to have fixed set of entities.</p><p><strong>Service Provider</strong>: Service providers register with a Registry, a central authority responsible for listing various service providers. In the scenario, the restaurants are service providers who register themselves in the registry. The service providers interface to the network happens via a platform called as <strong>Beckon Providers Platforms</strong> (BPP). Once registered, service providers can BPPs to respond to various service requests. There is no locking into any specific BPP any provider can use any of the compliant BPP apps to be a part of the network.</p><p><strong>Registry</strong>: Registries are maintained at local, national, and root levels ensuring location specific discoverability. Unlike the current scenario, these Centralised registries are not owned by specific platforms like Swiggy or Zomato but are administered by a central authority or institute. Think of them as similar to DNS registries that manage domain names.</p><p><strong>Consumer</strong>: End users use applications developed by anyone like Swiggy or Zomato, to express their intent to consume a service which in this case is ordering food. These applications are known as <strong>Beckon Application Platforms</strong> (BAPs). These applications also don’t have any lock ins and an end user can make use of any of the compliant apps to consume services of these ecosystem.</p><p><strong>Beckon Gateways (BG)</strong>: When a user creates an intent using a BAP, Beckon Gateways step in. They are responsible for identifying relevant BPPs using the registry and broadcasts these intents to the providers. Once the BPPs receive the intent, these BPPs then individually respond directly to the BAP regarding the services they offer. The BAP can then filter and present the information to the user as per their interface. These gateways are independent networks which communicate to the BAPs and BPPs using the specifications. The responsibility of the gateways is limited to provide a high throughput network without worrying about the presentation layer.</p><p>Once a user selects a specific BPP, a direct connection is established between the BAP and BPP to facilitate the rest of the transaction. Because all applications adhere to the same set of specifications and use a central registry, a restaurant registered once is accessible on all platforms.</p><p>A similar process is followed for the delivery aspect as well. We can have a dedicated Gateway for logistics. The same BAPs which was used for the retails aspect can request services such as pickup dedicated gateway. In this case the riders becomes the Service provider with their own BPPs and can respond to the discovery request and provide the service, ensuring a seamless and interoperable experience for both service providers and end users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kyNzzh9rHW9gexsC.png" /><figcaption>Single BAP used for dealing with multiple kind of BPPs</figcaption></figure><p>Now that we understand what it is, and how can it be used, let’s try to understand what are the different specifications ?</p><h3>What are the components of the beckn framework ?</h3><p>As a protocol, Beckn is multi-layered, with layer structure and organization resembling that of HTTP. The architecture of the Beckn ecosystem has five layers (from top to bottom)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vcxHvLJ89LWO4ud-.png" /><figcaption>Each of these layers have clearly defined roles and functions</figcaption></figure><p>For the ease of understanding, one can draw a parallel of these layer with the familiar HTTP protocol layers</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hQ6-RwSv4_qe51OQ.png" /></figure><p>The bottom two layers — the Specification and Support layer and the Certification layer — provide all the resources and support required to implement the network, to test for compliance and to become certified to join the network.</p><p>The top two layers are the actual run-time of the specification in the form of the Application layer which constitutes the consumer and the provider interfaces, and the Network and Transaction layer which has the server-side applications and the routing infrastructure.</p><p>In the very middle is the Infrastructure and Security layer. This layer holds the underlying infrastructure that transforms the Beckn-compliant platforms into actual live transacting entities on an open network. The layer comprises of open registries which list the various platforms and makes them this discoverable by other platforms — a role similar to that of the domain name system (DNS) in HTTP.</p><p>Each of these layers has undergone unique independent evolution in terms of complexity and scale. Together, they all work in concert to create the ecosystem of Beckn. You can read more about each of the layers in details <a href="https://developers.becknprotocol.io/docs/introduction/introduction/">here</a></p><h3>When will we see Beckn in action ?</h3><p>ONDC at this point in its initial onboarding phase, looking for people to be a part of the network and for platforms to build BPPs / BAPs or become a BG. The signs look positive with major players like <a href="https://www.livemint.com/companies/news/amazon-to-join-india-s-ondc-network-11677226685771.html">Amazon showing interest to leverage the ONDC network</a>. <a href="https://economictimes.indiatimes.com/tech/startups/ola-joins-ondc-with-food-delivery-plugin/articleshow/103285742.cms?from=mdr">OLA has already launched their own food app on top of ONDC network</a>, which I live now for everyone to use.</p><p>A relatively more adopted implementation of beckn is seen in the project of <a href="https://openkochi.net/">Kochi Open Mobility Network (KOMN)</a>. Which now has a network of over 5,000 drivers, the app completed 1,80,000 trips and enabled drivers to earn over ₹4.5 crore, without having to pay commission. There are <a href="https://www.thehindu.com/news/national/kerala/kerala-open-mobility-network-to-integrate-public-transport-modes/article67289726.ece">plans to integrate even the public transport</a> like buses to the same network as well.</p><p>The Beckn protocol is poised to redefine how we perceive e-commerce today. In the realm of mobility, food delivery, and traditional commerce, we’ve witnessed the dominance of established giants. Beckn, however, introduces a concept that not only enhances convenience for various stakeholders but also lowers the barriers for new entrants looking to develop user-facing applications, even without the extensive distribution networks that these industry leaders have meticulously crafted.</p><p>For established leaders this protocol has the unique potential to provide a smoother market entry for existing players, particularly in cities where their presence is currently limited. By fostering collaborations with local bodies and government entities, the groundwork for these expanded networks can be laid.</p><p>Now, the stage is set for a profound shift in the e-commerce landscape with Beckn and ONDC. But here’s the question: Can they replicate the groundbreaking disruption that UPI achieved in the world of digital transactions? I would love to hear your thoughts on the potential of Beckn and ONDC. Do you believe they can usher in a new era of e-commerce and transform the way we shop and interact in the digital age?</p><p>References:</p><ul><li><a href="https://ondc.org/">ONDC | Open Network for Digital Commerce</a></li><li><a href="https://becknprotocol.io/">Home - Beckn protocol</a></li><li><a href="https://openkochi.net/">Openkochi</a></li><li><a href="https://fide.org/">FIDE</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d243cdfaf104" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Demystifying Cloudflare’s Waiting Room]]></title>
            <link>https://medium.com/@chiragshetty98/demystifying-cloudflares-waiting-room-db589f2be6f6?source=rss-6be0044ad5d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/db589f2be6f6</guid>
            <category><![CDATA[scalability]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[cloudflare]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[bookmyshow]]></category>
            <dc:creator><![CDATA[Chirag Shetty]]></dc:creator>
            <pubDate>Mon, 02 Oct 2023 06:27:03 GMT</pubDate>
            <atom:updated>2023-10-02T06:27:03.281Z</atom:updated>
            <content:encoded><![CDATA[<h3>A behind the scenes understanding of BookMyShow’s dreaded you are in queue page</h3><p>In the midst of the nation’s excitement over the upcoming Cricket World Cup, it wasn’t too long ago when frustrations ran high, and BookMyShow was in the spotlight for all the wrong reasons. Long waiting queues, driven by the overwhelming demand for tickets, had cricket enthusiasts venting their frustration on Twitter, sharing screenshots of their agonizing wait times.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CEt8Oy9fTun1AJ5Uuk-QAA.jpeg" /><figcaption>Desperate attempts to get a ticket by passionate cricket fans 😅</figcaption></figure><p>While most of us were lamenting our inability to secure tickets, the software engineer in me couldn’t help but wonder how this queueing system was actually implemented. A quick dive into the browser developer tools and a peek at the request headers revealed that <a href="http://cloudflare.com/application-services/products/waiting-room">Cloudflare</a> was at the heart of the operation. Some time into my search later, I’m here to shed light on the intricate workings of the system.</p><p>Let’s set the stage: BookMyShow is gearing up to sell tickets for the highly anticipated India vs. Pakistan match in the ICC World Cup. With approximately 45,000* seats up for grabs and the expectation of millions of eager fans trying to snag them as soon as they become available, the challenge is immense. Considering server capacity and other downstream service limitations, they can realistically handle only around 10,000* concurrent users at any given moment.</p><h3>How do they ensure that the sudden spike in traffic doesn’t lead to catastrophe ?</h3><p>The fundamental principle of designing a resilient system is to prepare for your maximum expected usage, not just for everyday traffic but also for those unpredictable spikes in demand. Neglecting to address these spikes can result in missed opportunities and frustrated customers. To tackle this challenge, BookMyShow employs Cloudflare’s waiting room feature, configured to accommodate a maximum of 10,000 concurrent users.</p><p>Picture this: The clock strikes 8 PM, and like clockwork, hundreds of thousands of new users flood the platform with ticket requests. This is where Cloudflare’s waiting rooms step in as the heroes of the hour.</p><p>Every user request heading to BookMyShow passes through Cloudflare’s infrastructure. As long as the requests remain within the predefined limits (in our example, 10,000 users), Cloudflare allows the traffic to flow seamlessly to BookMyShow, almost as if Cloudflare didn’t exist. However, when the number of users exceeds the limit set by BookMyShow, Cloudflare takes action. It redirects users to a waiting room, effectively preventing the full impact of the traffic spike from reaching BookMyShow’s servers. This ensures that those who are already on the website have the opportunity to complete their transactions without interruption. So, you might be wondering, how does Cloudflare manage to handle this sudden spike in traffic ?</p><h3>How does Cloudflare handle the sudden spike ? why won’t it go down ?</h3><p>The key lies in the concept of Edge Computing, which Cloudflare refers to as <a href="https://workers.cloudflare.com/">Workers</a>. Rather than relying on a single entry point that could potentially become overwhelmed, Cloudflare’s approach is to divide and conquer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6PXsHZbKAdGXzREA7DcO0w.png" /><figcaption>These Workers are independent entities, working on their own</figcaption></figure><p>Here’s how it works: Cloudflare boasts a <a href="https://www.cloudflare.com/network/">network of multiple data centres</a> scattered around the globe, including locations within India in Ahmedabad, Mumbai, Kolkata, Bangalore, and more. When users from different parts of the country start inundating BookMyShow with requests, Cloudflare works its magic by intelligently routing them to the nearest geographically located edge nodes.</p><p>This approach offers two significant advantages:</p><ol><li>Traffic Distribution: By routing requests to the closest edge nodes, Cloudflare effectively divides the surge in traffic among multiple data centres. This ensures that no single data centre is burdened with the full brunt of the traffic spike, preventing potential overloads and downtime.</li><li>Reduced Latency: Additionally, directing users to nearby edge nodes reduces the latency or round-trip time for each request. This means that users experience faster response times, enhancing the overall user experience.</li></ol><p>But that’s not all. Within each data centre, Cloudflare dynamically scales its “Workers” in response to the increasing demand. These edge worker then based on the threshold values set by the BookMyShow decides whether your request should be let into the target website directly or be redirected on the waiting rooms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m6QOjlZ4Pqmn3kvFh6lQHw.png" /></figure><p>But let’s pause for a moment…</p><h3>How does the edge worker know how many people to let it in, considering there are multiple working in parallel across Data Centres ?</h3><p>A straight forward solution to this problem could have been maintaining a central data store which has a list of all the different worker nodes and the number of people its letting through. But wait, it’s not that easy is it ?</p><ul><li>This data store would have to be maintained in some central place so the total turnaround time for lookup would be too much.</li><li>This data store would end up becoming a single point of failure considering the sheer amount of request each edge node would be making to central entity.</li></ul><p>So, if not this conventional approach, then what?</p><p>Here enters the realm of algorithmic prowess. Banking on the knowledge of historical traffic data, the strategy is to assign fixed numbers of “slots” to each data centre. These slots empower the edge workers with autonomous decision-making capabilities. To illustrate this concept, let’s delve into an example:</p><p>Imagine it’s 7:59 PM, just a minute before the much-anticipated ticket sales go live. At this critical juncture, a snapshot of traffic distribution reveals that 20% of the BookMyShow (BMS) traffic hails from Mumbai, another 10% from Bangalore, with the remainder scattered across various zones. <br>Then from the total available slots, available slots will be reserved for each data centre in the said ratio.</p><p>Assuming currently there are ~2000 users already. The Central controller of the room publishes the slots for the remaining seats to all the data centres</p><pre>{<br>  &quot;mumbai&quot;: 1600, // 20% of 8000<br>  &quot;banglore&quot;: 800, // 10% of 8000<br>  &quot;anywhere&quot;: 5600 // All the remaining slots<br>}</pre><p>With these data centre level slots known for the given time interval,<br>At each of the data centre a data centre level counter is maintained with these slot value. When a worker in one of these data centers handles a request, it can instantaneously cross-reference against the localized counter. Since the lookup is within the data centre the time required for the lookup is very less.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ZXhTi0t4m15NFyLOvKGOQ.png" /><figcaption>DC Counter are used for distribution among worker nodes of a single dc, so even in case of uneven traffic between workers there isn’t false queuing</figcaption></figure><p>In case of all slots of a region gets used up or a new data centre(for which slots aren’t allocated) gets request, The worker can look up against the central data stores, which might have more latency but this is a trade off which is worth taking than queueing the user unnecessarily due no local slots. As we will see later this lookup happens only once per user / request hence the central lookup for that particular iteration works out.</p><p>Now, the question of recalibration arises. These slots are periodically recalculated and published at fixed intervals. This dynamic approach ensures that the system remains responsive to changing demands, guaranteeing optimal traffic distribution even during extended periods of high demand.</p><p>Now that we know how the edge decides whether to let the user through or move to waiting room, let’s see what happens next.</p><h3>How does Cloudflare maintain this queue ?</h3><p>Every request which reaches the worker node based on the slots either is let through or is put in waiting room. The waiting room, essentially a static page, diligently retries the original request at regular intervals. Here arises a crucial question: How does Cloudflare distinguish between users who are already queued and those who are new arrivals?</p><p>The answer lies in a clever mechanism: When a request reaches a worker for the first time, the worker not only decides whether to grant access but also issues an encrypted value in the form of a cookie. Think of it as a ticket received after registering at a concert. This cookie serves as a unique identifier, ensuring that all subsequent requests made by the user can be swiftly validated at the edge using the issued cookie, without the need for any time-consuming lookups.</p><p>Here are the content inside the encrypted cookie</p><pre>{<br>  &quot;bucketId&quot;: &quot;Wed, 26 Sep 2023 19:51:00 IST&quot;,<br>  &quot;lastCheckInTime&quot;: &quot;Wed, 26 Sep 2023 20:01:13 IST&quot;,<br>  &quot;acceptedAt&quot;: &quot;Wed, 26 Sep 2023 20:01:13 IST&quot;,<br> }</pre><ul><li>bucketId: The bucketId is the cluster the ticket is assigned to. This tracks the position in the queue. (More on this in a bit)</li><li>acceptedAt: The time when the user got accepted to the web application for the first time.</li><li>lastCheckInTime: The time when the user was last seen in the waiting room or the web application.</li></ul><p>Once you are let into the slot, Your cookies acceptedAt gets populated and then, the worker node directly lets you through without verifying anything else.</p><p>While a user is allocated a slot an expiry time is set to the cookies after which it’s not longer valid. Remember the “You have approximately 4 minutes to complete the transaction” prompt in BookMyShow ?<br>After the cookie expires the next request you makes would be considered as a new request and evaluated by worker again.</p><h3><strong>What happens with folks who have a cookies and been moved to waiting room ? How are they given a first come first serve kind of entry ?</strong></h3><p>Now rather than tracking each and every request, to make it easier requests are tracked in batches. This is where the bucketId key comes into play. The data centre then just maintains a counter of number of people it issued cookie for the said bucketId.</p><p>Example counter in Mumbai:</p><pre>activeUsers: 7000,<br>buckets: <br>[<br>  {<br>    key: &quot;Wed, 26 Sep 2023 20:01:00 IST&quot;,<br>    data: <br>    {<br>      waiting: 500,<br>    },<br>  },  <br>  {<br>    key: &quot;Wed, 26 Sep 2023 20:02:00 IST&quot;,<br>    data: <br>    {<br>      waiting: 10000,<br>    }<br>  },<br>  {<br>    key: &quot;Wed, 26 Sep 2023 20:03:00 IST&quot;,<br>    data: <br>    {<br>      waiting: 20000,<br>    }<br>  }<br>]</pre><p>There is a similar counter maintained even at Bangalore:</p><pre>activeUsers: 3000,<br>buckets: <br>[ <br>  {<br>    key: &quot;Wed, 26 Sep 2023 20:02:00 IST&quot;,<br>    data: <br>    {<br>      waiting: 5000,<br>    }<br>  },<br>  {<br>    key: &quot;Wed, 26 Sep 2023 20:03:00 IST&quot;,<br>    data: <br>    {<br>      waiting: 7000,<br>    }<br>  }<br>]</pre><p>This information from data centres are reported in the background to central service and aggregated to form a combined data structure.</p><pre>activeUsers: 10000, // 7000(Mumbai) + 3000(Banglore)<br>buckets: <br>[<br>  {<br>    key: &quot;Wed, 26 Sep 2023 20:01:00 IST&quot;,<br>    data: <br>    {<br>      waiting: 500,<br>    }<br>  },<br>  {<br>    key: &quot;Wed, 26 Sep 2023 20:02:00 IST&quot;,<br>    data: <br>    {<br>      waiting: 15000, // 10000 users from Mumbai and 5000 from Banglore<br>    }<br>  }<br>  {<br>    key: &quot;Wed, 26 Sep 2023 20:03:00 IST&quot;, <br>    data: <br>    {<br>      waiting: 27000,<br>    }<br>  }<br>]</pre><p>The data structure above is a sorted list of all the bucketIds in the waiting room. Within this structure, we find two crucial fields: “waiting” and “activeUsers.”</p><p>The “waiting” field keeps track of the number of individuals waiting within a specific bucketId across all data centres, providing a clear overview of the queue’s composition. Meanwhile, the “activeUsers” field provides insight into the current number of users actively engaged with the web application.<br>As per their configuration only 10,000 customers can be at the web application at any time. So at this point in time, no one can go in and users get queued.</p><p>Now, let’s consider a scenario in which some users conclude their sessions, reducing the count of activeUsers to 8,000. In this context, there are now 2,000 available slots for new users. These slots are allocated to the users who have been waiting the longest, ensuring fairness in the queue. This allocation process prioritizes the oldest buckets in the queue.</p><p>So we first let in the 500 users waiting under the bucket “Wed, 26 Sep 2023 20:01:00 IST.” These users, being the longest in the queue, are granted the first opportunity to enter the application.</p><p>However, when it comes to the remaining 1,500 slots things get intresting since a total of 15,000 contenders from both Bangalore and Mumbai are waiting. In such cases, Cloudflare employs a ratio based on past traffic from each data centre to determine how many users from each location can gain access. This approach ensures a balanced and fair distribution of slots, considering the historical traffic patterns of each data centre.</p><pre>activeUsers: 10000, // 7000(Mumbai) + 3000(Banglore)<br>buckets: <br>[<br>  {<br>    key: &quot;Wed, 26 Sep 2023 20:01:00 IST&quot;,<br>    data: <br>    {<br>      waiting: 500,<br>      eligibleSlots: 500<br>    }<br>  },<br>  {<br>    key: &quot;Wed, 26 Sep 2023 20:02:00 IST&quot;,<br>    data: <br>    {<br>      waiting: 15000, // 10000 users from Mumbai and 5000 from Banglore<br>      eligibleSlots: 1500<br>    }<br>  }<br>  {<br>    key: &quot;Wed, 26 Sep 2023 20:03:00 IST&quot;, <br>    data: <br>    {<br>      waiting: 2700,<br>      eligibleSlots: 0<br>    }<br>  }<br>]</pre><p>So as per current traffic send the subset of user from each DC</p><pre>Wed, 26 Sep 2023 20:02:00 IST: <br>{<br>  Mumbai: 0.7, // 0.7 * 1500 = 1050 eligibleSlots<br>  Banglore: 0.3  // 0.3 * 1500 = 450 eligibleSlots<br>}</pre><p>And corresponding values are then sent to each of the DC’s and then based on these slots and bucketIds the edge nodes do the magic again while deciding what to do with a particular request as it get retried again in few seconds.<br>The amount of time in queue also is something which Cloudflare calculates based on number of people in queue before you and rate at which users are getting allocated slots. You can read more about it <a href="https://blog.cloudflare.com/building-waiting-room-on-workers-and-durable-objects/">here</a>.</p><p>In summary, the process that unfolds behind the scenes, resulting in the notorious “You are in queue” screen, is a complex orchestration of multiple elements. While the actual implementation has more nuances and consideration, the attempt here is to explain in a super simplified manner. If you want to read more about the same from the folks who have built this I have attached the relevant reference.</p><p>Hope that you find this writeup interesting and easy to understand. Let me know what you think about it in the comments!</p><p>*All the numbers in these articles are just assumptions in order to provide an end to end example for better understanding</p><p>References:</p><ul><li><a href="https://blog.cloudflare.com/building-waiting-room-on-workers-and-durable-objects/">Building Waiting Room on Workers and Durable Objects</a></li><li><a href="https://blog.cloudflare.com/how-waiting-room-queues/">How Waiting Room makes queueing decisions on Cloudflare&#39;s highly distributed network</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db589f2be6f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Non Functional Requirements for Software Engineers]]></title>
            <link>https://medium.com/@chiragshetty98/non-functional-requirements-for-software-engineers-e413dd33721b?source=rss-6be0044ad5d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/e413dd33721b</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[growth-mindset]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Chirag Shetty]]></dc:creator>
            <pubDate>Tue, 05 Sep 2023 15:59:01 GMT</pubDate>
            <atom:updated>2023-09-05T15:59:01.088Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I celebrated my 3-year anniversary at <a href="https://www.browserstack.com/">Browserstack</a>. The past three years have been nothing short of a roller coaster ride, during which I gained significant exposure and learning experiences.</p><p>In my first couple of years, I worked on an existing product <a href="http://browserstack.com/app-automate">App Automate</a>, which already had thousands of customers. This experience taught me a lot about customer obsession and business continuity. In the last year or so, I have been a part of building a new product called <a href="https://browserstack.com/test-observability">Test Observability</a>. We started from scratch, ideating on the problems that users face, and have now gone on to acquire our initial paying customers and more.</p><p>Remaining true to the agile practice, I decided to reflect on my past 3 years. While many of the insights from this exercise are personal and specific to the type of work I do, there are certain lessons that, had I been aware of them three years ago when I was fresh out of college, things might have turned out differently for the better. Here is my attempt to share a few of these insights with others out there.</p><h3>Learn to pick your battles — maximise impact</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nD2klruRLBK0-7aS3vkQrg.jpeg" /><figcaption>Make good choices</figcaption></figure><p>In your work life, not every day will be the same, so adaptability is crucial. There will be times during the year when you’ll be working on long-term projects, and on those days, it’s perfectly fine to manage your work within your allocated time and call it a day.</p><p>What truly sets you apart is how you respond to situations where you’re given a task with a tight deadline, along with the pressure of an account renewal pending. In such cases, it’s essential to go above and beyond the usual responsibilities to deliver results.</p><p>On the other end of the spectrum, it’s important to recognise that engineering and product development are more of a marathon than a sprint. Not every day should be about pushing yourself to the limit, as this can lead to burnout. Balance is key, and understanding when to give that extra effort and when to pace yourself is a skill that can greatly benefit your career.</p><h3>Build opinions and express them shamelessly — increase participation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-69VlM92rHoF4gadTgQ1jQ.jpeg" /><figcaption>Dots connect</figcaption></figure><p>Frequently, you’ll find yourself in group discussions where you’re only involved in a portion of the conversation. Instead of tuning out during the parts that don’t directly concern you, make an effort to capitalise on the opportunity and gather as much context as possible. Don’t hesitate to ask what may seem like “silly” questions.</p><p>Although it may appear irrelevant in the moment, these seemingly disconnected pieces of information eventually come together. There will be a time when having this knowledge will prove invaluable and make your work much more manageable. In the grand scheme of things, taking an active interest in understanding the broader context can be a game-changer.</p><h3>Always ask why — normalise pushback</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VPxx9YZpyRy4d36gCTjGdQ.jpeg" /><figcaption>Asking “why” is the antidote to “just-because”, “that’s the way it is”, and “because that’s the way we have always done it”</figcaption></figure><p>A common occurrence in larger organisations is that product managers and stakeholders present requirements, and as developers, we often try to execute them blindly. What’s important is to always question why we’re doing a particular task. Ask stakeholders how it impacts the business and the customer. Inquire about the alternative solutions that were considered.</p><p>This approach serves multiple purposes. Firstly, it deepens your understanding of the importance of the feature you’re working on, aiding in the prioritisation process. Secondly, it contributes to your growth as an engineer by giving you insight into the business side of things. It’s crucial to grasp that, ultimately, you’re always solving problems for the business, and having this awareness can lead to more effective decision-making and better alignment with overall goals.</p><h3>Perfection is the enemy of progress — embrace tradeoffs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*REGhSrPGk9ShqDY4VZjZPA.jpeg" /><figcaption>Balance is the key</figcaption></figure><p>While engineers are often driven by the desire to solve challenging problems efficiently, the reality is more complex. When dealing with issues in production, it’s not always possible to start from scratch and build solutions from first principles. Instead, everything becomes a tradeoff, and a cost-benefit analysis is essential. This cost analysis doesn’t just consider actual infrastructure costs but also factors in execution time.</p><p>Sometimes, a good enough solution that provides immediate relief in a matter of weeks is much more effective than pursuing a perfect solution that would take months to implement. These insights are typically something only engineers can provide, and it becomes the engineers’ responsibility to present these options to stakeholders. Being able to communicate the tradeoffs and make informed decisions that balance efficiency and perfection is a valuable skill in the world of engineering and problem-solving.</p><h3>Act like you own it — take ownership</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ehggqIB8lJNSCyaPGh0kg.jpeg" /><figcaption>Whosoever holds this hammer, if he be worthy, shall possess the power of Thor.</figcaption></figure><p>A common misconception among engineers is that our job is limited to coding solutions once a requirement is presented. In reality, being a good engineer involves a more comprehensive role. It means taking responsibility for the entire lifecycle of a feature, from its inception in the requirements phase to ensuring its successful delivery through QA and release, and even taking ownership of it post-deployment.</p><p>This broader responsibility includes defending and advocating for the feature, working to make it the best possible version. When you take on this proactive role, it not only eases the burden on your leadership and stakeholders but also builds trust within the organisation. It creates a virtuous cycle where showing responsibility leads to earning more responsibility, which ultimately benefits both you and the organisation as a whole.</p><h3>Idea is only as good as your ability to present it — effective communication</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KBiUA6_LC6yKIA48fwv-KA.jpeg" /><figcaption>Effectively communicating the idea does half your work in aligning people</figcaption></figure><p>The image of a solitary coder in a hoodie building an entire product in isolation is a popular trope in movies, but it couldn’t be further from the truth. In reality, the life of a software engineer is marked by collaboration with team members, including fellow developers, team leads, product managers, and stakeholders. In such a collaborative environment, effectively communicating your ideas is just as critical as having brilliant ideas in the first place.</p><p>You may indeed have outstanding ideas, but how you articulate and present them plays an equally important role in selling your idea to others. Whether it’s during meetings, discussions, or through communication channels like Jira, Slack, or email, being able to clearly and persuasively convey your thoughts is a key skill in the world of software engineering. Effective communication fosters collaboration, aligns team members, and ultimately contributes to the success of projects and products.</p><h3>Mystery of estimation — on point estimation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A-WU49nomnP1k_1J9NtQEQ.jpeg" /><figcaption>Account for all possibilities and spend sufficient time on estimating</figcaption></figure><p>Estimating the effort or story points required for a deliverable is a crucial aspect of engineering at various levels, and skilled developers often possess an innate ability to make accurate estimates.</p><p>Unfortunately, some people tend to underestimate the importance of this task. However, getting estimates right can essentially cut your workload in half by ensuring that you don’t find yourself rushing as deadlines approach. This approach allows you to maintain both the quality of your work and a balanced life.</p><p>When dealing with open-ended scopes, it’s perfectly acceptable to invest time in defining a closed scope and then estimating before starting the work. This strategy enables you to address the next set of tasks in the following iteration, thus preventing scope creep and allowing you to manage projects more effectively.</p><p>While there are countless other attributes and skills that one can work on, these are some of the common traits I’ve observed in awesome individuals I’ve had the privilege to work with. I’m actively striving to integrate them into my work life.</p><p>In college, the emphasis is often on acquiring hard skills necessary to become a proficient coder, but that’s only part of the equation. These soft skills are equally essential for becoming a well-rounded and effective software engineer. Balancing technical expertise with qualities like effective communication, adaptability, responsibility, and the ability to work collaboratively can truly set you apart in your career and contribute to your overall success.</p><p>Illustration credits: <a href="https://ideogram.ai/">https://ideogram.ai/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e413dd33721b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>