<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Bhanu partap</title>
    <description>The latest articles on DEV Community by Bhanu partap (@bhanupartap13).</description>
    <link>https://dev.to/bhanupartap13</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2631826%2Ff3ddab20-818a-4339-ad1e-e8a7d7580299.JPG</url>
      <title>DEV Community: Bhanu partap</title>
      <link>https://dev.to/bhanupartap13</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bhanupartap13"/>
    <language>en</language>
    <item>
      <title>Suppose it is late at night and you decide to order pizza from Zomato. While making the payment, Paytm shows an invalid balance because it is month end.
From your perspective, you created the order, paid, and then it got cancelled......... read :)</title>
      <dc:creator>Bhanu partap</dc:creator>
      <pubDate>Sat, 31 Oct 2026 06:55:05 +0000</pubDate>
      <link>https://dev.to/bhanupartap13/suppose-it-is-late-at-night-and-you-decide-to-order-pizza-from-zomato-while-making-the-payment-2noo</link>
      <guid>https://dev.to/bhanupartap13/suppose-it-is-late-at-night-and-you-decide-to-order-pizza-from-zomato-while-making-the-payment-2noo</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/bhanupartap13/zomato-system-design-4hml" class="crayons-story__hidden-navigation-link"&gt;Zomato - System Design&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/bhanupartap13" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2631826%2Ff3ddab20-818a-4339-ad1e-e8a7d7580299.JPG" alt="bhanupartap13 profile" class="crayons-avatar__image" width="800" height="1067"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/bhanupartap13" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Bhanu partap
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Bhanu partap
                
                
              
              &lt;div id="story-author-preview-content-4951262" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/bhanupartap13" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2631826%2Ff3ddab20-818a-4339-ad1e-e8a7d7580299.JPG" class="crayons-avatar__image" alt="" width="800" height="1067"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Bhanu partap&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/bhanupartap13/zomato-system-design-4hml" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Oct 31&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/bhanupartap13/zomato-system-design-4hml" id="article-link-4951262"&gt;
          Zomato - System Design
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/zomato"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;zomato&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/systemdesign"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;systemdesign&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/sqs"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;sqs&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/onlineordersystemdesign"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;onlineordersystemdesign&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/bhanupartap13/zomato-system-design-4hml#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              &lt;span class="hidden s:inline"&gt;Add&amp;nbsp;Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            4 min read
          &lt;/small&gt;
          
          &lt;div class="only-sidebar-menu-item trusted-visible-block print-hidden align-center"&gt;
                
                    
                
          &lt;/div&gt;

        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>architecture</category>
      <category>backend</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Zomato - System Design</title>
      <dc:creator>Bhanu partap</dc:creator>
      <pubDate>Sat, 31 Oct 2026 06:51:41 +0000</pubDate>
      <link>https://dev.to/bhanupartap13/zomato-system-design-4hml</link>
      <guid>https://dev.to/bhanupartap13/zomato-system-design-4hml</guid>
      <description>&lt;p&gt;Suppose it is late at night and you decide to order pizza from Zomato. While making the payment, Paytm shows an invalid balance because it is month end.&lt;/p&gt;

&lt;p&gt;From your perspective, you created the order, paid, and then it got cancelled.&lt;/p&gt;

&lt;p&gt;But in Zomato’s backend, there is an order service connected to SQS that is still processing events.&lt;/p&gt;

&lt;p&gt;SQS is a data structure that works like a queue. Standard SQS does not guarantee FIFO ordering. It maintains best-effort ordering and is much cheaper than FIFO queues.&lt;/p&gt;

&lt;p&gt;So there are 5 workers processing messages ahead of yours.&lt;/p&gt;

&lt;p&gt;Suppose the cancellation event reaches Chef1 first because standard SQS does not guarantee order. Chef1 sees the order was cancelled but finds nothing in the database. Then Chef2 receives the creation event and creates the order in the DB. Now you have a paid order that you never actually paid for. 😅&lt;/p&gt;

&lt;p&gt;Then you ordered the same pizza again and enjoyed a movie. 📽️&lt;/p&gt;

&lt;p&gt;Comment your favourite movie name below!&lt;/p&gt;

&lt;p&gt;Meanwhile the finance team tells engineers to stop vibe coding and fix this mess. You have until Monday. What do you do?&lt;/p&gt;

&lt;p&gt;A) Switch to SQS FIFO plus MessageGroupId per order_id and let AWS handle ordering per order.&lt;br&gt;
B) Keep standard SQS, add a sequence number plus reorder buffer in the consumer, and hold out-of-order events until earlier ones arrive.&lt;br&gt;
C) Replace the event stream with a Saga where each step waits for the previous step’s completion signal before firing the next.&lt;br&gt;
D) Add an event version or timestamp and make the state machine idempotent plus order-agnostic by rejecting stale transitions and accepting any arrival order.&lt;/p&gt;

&lt;p&gt;All four are patterns I have seen in real production systems. Only one actually fits this problem. One of them is the trap that catches senior engineers on the whiteboard.&lt;/p&gt;

&lt;p&gt;Pick one, A, B, C, or D, and tell me why. Full breakdown in the comments.&lt;/p&gt;

&lt;p&gt;Drop your answer 👇&lt;/p&gt;

&lt;p&gt;Explanation&lt;/p&gt;

&lt;p&gt;SQS Standard vs FIFO&lt;/p&gt;

&lt;p&gt;Standard SQS is like a normal line where people can sometimes get slightly out of order. It gives best-effort ordering, meaning 99% of the time the sequence is correct but 1% of the time messages may arrive out of order. It is cheap and very fast.&lt;/p&gt;

&lt;p&gt;FIFO SQS is a strict line. Whoever comes first gets served first. But it is slower and more expensive.&lt;/p&gt;

&lt;p&gt;Consumers and Workers&lt;/p&gt;

&lt;p&gt;These are background programs that pick messages from the queue and update the database. In this scenario, 5 workers are processing messages in parallel.&lt;/p&gt;

&lt;p&gt;State Machine&lt;/p&gt;

&lt;p&gt;This is a strict set of rules. For example, it says “I will only accept a Cancelled state if a Created state already exists.” This prevents data corruption.&lt;/p&gt;

&lt;p&gt;Decoding the Options&lt;/p&gt;

&lt;p&gt;Now let us fix this problem by looking at each option.&lt;/p&gt;

&lt;p&gt;Option A: Switch to SQS FIFO plus MessageGroupId per order_id ❌ (The Senior Engineer Trap)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2589hzsf61ctheocg9lg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2589hzsf61ctheocg9lg.png" alt="FIFO concept, while the order will processs seuqntially" width="799" height="576"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You replace the standard queue with a FIFO queue. MessageGroupId ensures all messages for one order_id stay in the same line.&lt;/p&gt;

&lt;p&gt;AWS will guarantee that Created processes first, then Paid, then Cancelled.&lt;/p&gt;

&lt;p&gt;But here is the trap. FIFO queues have much lower throughput than standard queues, around 3000 messages per second per group. If you have 2000 orders per minute with 3 messages each, the FIFO queue becomes a bottleneck. The system slows down. This is a band-aid solution, not a permanent fix.&lt;/p&gt;

&lt;p&gt;Option B: Add a sequence number plus reorder buffer in the consumer ⚠️ (Too Complex)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fopy7sfz2k10f7rdjc5an.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fopy7sfz2k10f7rdjc5an.png" alt="Sequence Ordering for SQS, taht can become too heavy" width="800" height="855"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You send a sequence number with every message and keep a buffer in the consumer. If Cancelled arrives first, you store it in the buffer and wait for Created to arrive.&lt;/p&gt;

&lt;p&gt;But this is very hard to implement correctly. If the Created message never arrives due to a network issue, the Cancelled message stays stuck in the buffer forever causing memory leaks or deadlocks. Distributed systems avoid such complex buffers.&lt;/p&gt;

&lt;p&gt;Option C: Replace the event stream with a Saga ❌ (Wrong Use Case)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2xv7ou3wvb148dh5jdag.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2xv7ou3wvb148dh5jdag.png" alt="SAGA Archiectecture" width="800" height="551"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Saga pattern is used when you have multiple microservices like Order Service, Payment Service, and Inventory Service and need to manage distributed transactions between them.&lt;/p&gt;

&lt;p&gt;But here the problem is queue ordering, not distributed transactions. Saga is overkill for this situation.&lt;/p&gt;

&lt;p&gt;Option D: Add event version or timestamp and make the state machine idempotent plus order-agnostic ✅ (The Winner)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs78uprovxesxmj5kr2bj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs78uprovxesxmj5kr2bj.png" alt="Ordeer Agnostic and Idempotent" width="800" height="799"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You make your state machine smarter and more flexible.&lt;/p&gt;

&lt;p&gt;Order-agnostic means the state machine does not care about event arrival order. If Cancelled arrives first, it accepts it and sets the order directly to Cancelled state even if Created comes later.&lt;/p&gt;

&lt;p&gt;Idempotent means even if the same event arrives 10 times, the result stays the same.&lt;/p&gt;

&lt;p&gt;You fixed the root cause which was a fragile state machine. Now you can use standard SQS for high throughput without worrying about out-of-order messages crashing the system.&lt;/p&gt;

&lt;p&gt;The Correct Answer and Logic&lt;/p&gt;

&lt;p&gt;Correct Answer: D) Add an event version or timestamp and make the state machine idempotent plus order-agnostic.&lt;/p&gt;

&lt;p&gt;The logic is simple. There is a golden rule in distributed systems: Never trust the network. The network can delay messages or deliver them out of order at any time.&lt;/p&gt;

&lt;p&gt;If your state machine is so strict that it rejects out-of-order messages, your system will always be fragile.&lt;/p&gt;

&lt;p&gt;:))))))))))))))))) SUBSCRIBE :))))))))))))))))))))))))))&lt;/p&gt;

</description>
      <category>zomato</category>
      <category>systemdesign</category>
      <category>sqs</category>
      <category>onlineordersystemdesign</category>
    </item>
    <item>
      <title>You went to bathroom.... and got crashed</title>
      <dc:creator>Bhanu partap</dc:creator>
      <pubDate>Fri, 30 Oct 2026 05:33:08 +0000</pubDate>
      <link>https://dev.to/bhanupartap13/you-went-to-bathroom-and-got-crashed-4cp</link>
      <guid>https://dev.to/bhanupartap13/you-went-to-bathroom-and-got-crashed-4cp</guid>
      <description>&lt;p&gt;Imagine you are in a bathroom with a 5 minute timer. &lt;/p&gt;

&lt;p&gt;You go in but crash at minute 3. The lock is still on for 2 more minutes. &lt;/p&gt;

&lt;p&gt;Your friend arrives at minute 3 and just stands outside waiting even though the bathroom is empty.&lt;/p&gt;

&lt;p&gt;That wasted time is exactly what happens in software when a process dies but the Redis lock stays alive.&lt;/p&gt;

&lt;p&gt;Now imagine three servers behind a load balancer. Every 5 minutes a cron job fires to generate a daily report and all three try to grab it. You use Redis SETNX with a 5 minute TTL. Instance A wins and thinks it owns the bathroom. But then it gets OOM killed at minute 3. The lock remains. No report runs for 2 more minutes. Then another instance grabs it. But wait, the first instance restarted and also thinks it still owns the bathroom. Now both are writing to the same output. Data corruption. 💥&lt;/p&gt;

&lt;p&gt;This is the split brain problem. Redis cannot tell if a client is working or just frozen.&lt;/p&gt;

&lt;p&gt;So what is the right pattern here?&lt;/p&gt;

&lt;p&gt;A) Redis SETNX plus short TTL plus fencing token&lt;br&gt;
B) Redlock across 5 independent Redis nodes&lt;br&gt;
C) Database pessimistic lock using SELECT FOR UPDATE&lt;br&gt;
D) Optimistic concurrency with unique key inserts&lt;/p&gt;

&lt;p&gt;All four are real patterns engineers ship. But only one survives this exact failure mode. One of them is what Martin Kleppmann publicly tore apart 8 years ago and people still argue about it today.&lt;/p&gt;

&lt;p&gt;Firstly, What would you pick? Drop your answer below. 👇&lt;/p&gt;

&lt;p&gt;Let us break it down simply.&lt;/p&gt;

&lt;p&gt;Option B, Redlock&lt;/p&gt;

&lt;p&gt;This sounds bulletproof. Acquire locks on 5 separate Redis nodes and proceed only if majority agree. But Martin Kleppmann proved that if system clocks drift even slightly, two instances can get the lock simultaneously. It is complex, fragile, and usually over-engineering for most teams. This is the trap.&lt;/p&gt;

&lt;p&gt;Option C, Database Pessimistic Lock&lt;/p&gt;

&lt;p&gt;You lock the row in your jobs table until the transaction completes. If Instance B dies, the connection drops and the lock releases automatically. Safe? Yes. But heavy. Holding a database connection open for a long running report job is bad practice. Your database becomes the bottleneck instead of your compute.&lt;/p&gt;

&lt;p&gt;Option D, Optimistic Concurrency&lt;/p&gt;

&lt;p&gt;No locks at all. Each instance generates the full report and tries to insert it with a unique key. Database rejects duplicates. Sounds elegant until you realize both instances just wasted 10 minutes of compute generating a report that gets thrown away. For heavy jobs, this is pure waste.&lt;/p&gt;

&lt;p&gt;Option A, Fencing Token&lt;/p&gt;

&lt;p&gt;This is your winner. Think of it like a ticket number at a government office. Every time someone gets the lock, they receive a monotonically increasing number. Token 101, then 102, then 103.&lt;/p&gt;

&lt;p&gt;When Instance B comes back from its GC pause with Token 101 and tries to write, the storage layer checks: “Current valid token is 103. You have 101. Your lock is stale. Rejected.”&lt;/p&gt;

&lt;p&gt;Instance C with Token 103 writes safely. No corruption. No wasted compute. No clock dependency.&lt;/p&gt;

&lt;p&gt;The fencing token makes the downstream resource the source of truth, not Redis. Redis just hands out tickets. The storage layer enforces order.&lt;/p&gt;

&lt;p&gt;The lesson here is simple. Distributed locks are not about preventing two workers from starting. They are about preventing a zombie worker from writing after it should be dead. TTL alone cannot do that. You need a monotonic guarantee.&lt;/p&gt;

&lt;p&gt;If your team has ever argued about Redlock versus SETNX at 3am, share this with them. The debate itself is the learning.&lt;/p&gt;

&lt;h1&gt;
  
  
  SystemDesign #DistributedSystems #Redis #BackendEngineering #shortTTL #longTTL #dailyupdates
&lt;/h1&gt;

</description>
      <category>systemdesign</category>
      <category>redis</category>
      <category>ttl</category>
      <category>distributedsystems</category>
    </item>
    <item>
      <title>Black Friday Sale: System Design</title>
      <dc:creator>Bhanu partap</dc:creator>
      <pubDate>Thu, 29 Oct 2026 06:53:11 +0000</pubDate>
      <link>https://dev.to/bhanupartap13/black-friday-sale-system-design-284h</link>
      <guid>https://dev.to/bhanupartap13/black-friday-sale-system-design-284h</guid>
      <description>&lt;p&gt;Imagine, there are 4 database sharding strategies with 4 completely different outcomes. Pick the wrong one and your primary database melts on Black Friday.&lt;/p&gt;

&lt;p&gt;Your Postgres orders table just hit 500 million rows. Queries that used to take 40ms are now crawling at 800ms. Vertical scaling is dead. You have to shard.&lt;/p&gt;

&lt;p&gt;But before you pick a strategy, look at your actual workload.&lt;/p&gt;

&lt;p&gt;80% of reads are customers checking their own order history from the last 30 days.&lt;br&gt;
15% are analytics queries on date ranges.&lt;br&gt;
Only 5% are new writes, around 400 requests per second, doubling on sale days.&lt;/p&gt;

&lt;p&gt;So which sharding strategy do you choose?&lt;/p&gt;

&lt;p&gt;A) Hash sharding on order_id&lt;br&gt;
B) Range sharding on created_at&lt;br&gt;
C) Directory based sharding&lt;br&gt;
D) Consistent hashing with virtual nodes&lt;/p&gt;

&lt;p&gt;What would you pick? Drop your answer below. 👇&lt;/p&gt;

&lt;p&gt;All four are real production strategies. But only one fits this specific e-commerce pattern. One of these is the senior engineer trap that looks smart in tutorials but will destroy your latency in reality.&lt;/p&gt;

&lt;p&gt;Let us break it down like we are explaining it to a friend over chai.&lt;/p&gt;

&lt;p&gt;English Breakdown: &lt;/p&gt;

&lt;p&gt;Option A, Hash Sharding on Order ID&lt;/p&gt;

&lt;p&gt;This sounds perfect because it distributes data evenly. No hotspots. But here is the problem. When a customer logs in and asks for their last 30 days of orders, their data is scattered across every single shard. Your app has to query all shards and stitch results together. This is called scatter-gather and it is painfully slow for user-facing queries. This is the trap. YouTube loves it, but your users will hate it.&lt;/p&gt;

&lt;p&gt;Option B, Range Sharding on Date&lt;/p&gt;

&lt;p&gt;Great for analytics, terrible for sales. On Black Friday, every new order hits the current month shard while older shards sit idle. That one shard gets crushed under double traffic and crashes. The rest of your infrastructure watches helplessly. This is how you melt a primary database during peak revenue moments.&lt;/p&gt;

&lt;p&gt;Option D, Consistent Hashing&lt;/p&gt;

&lt;p&gt;Amazing for rebalancing when adding servers. Terrible for customer-centric queries. Same scatter-gather problem as Option A. Your customers do not care about your elegant ring topology. They care about seeing their order history instantly.&lt;/p&gt;

&lt;p&gt;Option C, Directory Based Sharding&lt;/p&gt;

&lt;p&gt;This is your winner. Think of it like a phone directory. You maintain a fast lookup service that maps each customer to their specific shard. When Customer X asks for their orders, you check the directory, go directly to Shard 5, and return results in milliseconds. No scattering. No gathering. Just direct access.&lt;/p&gt;

&lt;p&gt;Yes, the directory itself can become a bottleneck. But you solve that by caching it in Redis with replication. High availability, low latency, perfect fit for 80% customer-centric reads.&lt;/p&gt;

&lt;p&gt;The lesson here is simple. Do not pick a sharding strategy because it sounds sophisticated. Pick it because it matches your actual query patterns. Numbers tell stories. Listen to them.&lt;/p&gt;

&lt;p&gt;If your team is debating a database migration right now, share this with them. Someone is about to make an expensive mistake.&lt;/p&gt;

&lt;p&gt;Hinglish:&lt;/p&gt;

&lt;p&gt;Step 1: Terms Ko Simple Bhasha Mein Samjho&lt;br&gt;
Question mein likha hai: "80% reads... 15% reads... 5% writes..."&lt;br&gt;
Yeh kya matlab hai?&lt;/p&gt;

&lt;p&gt;Supermarket (Database)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Reads (Padhna/Dekhna):&lt;br&gt;
Jab customer shelf par jaakar dekhta hai ki "Mere liye kya product available hai?" ya "Mera purana bill kya tha?" — Yeh Read operation hai.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Writes (Likhna/Change karna):&lt;br&gt;
Jab customer counter par jaakar naya saman khareedta hai aur cashier usse bill mein add karta hai — Yeh Write operation hai.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;RPS (Requests Per Second):&lt;br&gt;
Har second kitne log server ko hit kar rahe hain.&lt;br&gt;
400 RPS: Matlab har second 400 naye orders aa rahe hain. Sale ke din yeh double (800) ho jata hai.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sharding (Baantna):&lt;br&gt;
Ab tumhara Supermarket (Database) itna bada ho gaya hai ki ek hi building mein saara maal rakhna mushkil ho raha hai.&lt;br&gt;
Sharding ka matlab hai: Tum apne pure database ko chhote-chhote tukdon (Shards) mein baant do aur alag-alag servers par rakh do.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Real Question: &lt;br&gt;
Tumhare paas 50 Crore (500M) orders hain.&lt;br&gt;
Pehle jab orders kam the, toh search karna 40ms (milliseconds) leta tha.&lt;br&gt;
Ab itna data hai ki search karte waqt database ko poora table scan karna padta hai, jo 800ms le raha hai. User ko lagta hai app hang ho gayi hai! &lt;/p&gt;

&lt;p&gt;Tumhe ab decide karna hai ki in 50 Crore orders ko kaise baantein (Shard kaise karein) taaki user ko apna order history turant mile.&lt;br&gt;
Workload Yaad Rakho:&lt;/p&gt;

&lt;p&gt;80% Queries: "Customer X ke pichle 30 din ke orders dikhao." (Yeh customer-centric hai).&lt;br&gt;
15% Queries: Analytics (Date range wale).&lt;br&gt;
5% Writes: Naye orders.&lt;br&gt;
Step 3: Options Ko Decode Karein (Why &amp;amp; Where)&lt;br&gt;
Chaliye har option ko simple example se samajhte hain:&lt;/p&gt;

&lt;p&gt;Option A: Hash Sharding on order_id&lt;br&gt;
Kya hai? Computer ek mathematical formula (Hash Function) use karta hai order_id par. Jaise order_id = 101 shayad Shard 1 par jaye, aur order_id = 102 Shard 5 par.&lt;br&gt;
Fayda: Data bilkul barabar (evenly) distribute ho jata hai. Koi ek shard overload nahi hota.&lt;br&gt;
Nuksan (The Trap): Agar mujhe "Customer X" ke saare orders dhundhne hain, toh mujhe pata nahi ki uske orders kis-kis shard par bikhre hain. Mujhe saare shards ko query karna padega (Scatter-Gather problem). Yeh slow ho jayega.&lt;/p&gt;

&lt;p&gt;Option B: Range Sharding on created_at (Date)&lt;br&gt;
Kya hai? Data ko date ke hisaab se baanta hai.&lt;br&gt;
Shard 1: Jan-Mar 2023 ke orders.&lt;br&gt;
Shard 2: Apr-Jun 2023 ke orders.&lt;br&gt;
Fayda: Agar analytics team puche "Pichle mahine kitne sale hue?", toh wo sirf ek specific shard ko query karegi. Very fast for analytics.&lt;br&gt;
Nuksan (Hotspot Problem): Black Friday ya Sale ke din, naye orders sirf "Current Month" wale shard par aayenge. Baaki shards khali padenge. Current shard par load badh jayega aur wo "melt" (crash) ho sakta hai. Ise Hotspotting kehte hain.&lt;/p&gt;

&lt;p&gt;Option C: Directory-based Sharding (Lookup Table)&lt;br&gt;
Kya hai? Ek alag se "Phone Directory" (Lookup Service) hota hai.&lt;br&gt;
Jab request aati hai "Customer X ke orders lao", pehle Directory se pucha jata hai: "Bhai, Customer X kis Shard par hai?"&lt;br&gt;
Directory batata hai: "Wo Shard 3 par hai."&lt;br&gt;
Phir direct Shard 3 se data fetch kiya jata hai.&lt;br&gt;
Fayda: Yeh exactly wahi karta hai jo humein chahiye. Kyunki 80% queries Customer-Centric hain, hum directly usi shard par ja sakte hain jahan wo customer ka data hai. No need to search everywhere.&lt;br&gt;
Nuksan: Directory service khud ek single point of failure ban sakti hai (agar wo down ho gayi toh koi kuch nahi dhundh payega), lekin ise cache karke manage kiya ja sakta hai.&lt;/p&gt;

&lt;p&gt;Option D: Consistent Hashing with Virtual Nodes&lt;br&gt;
Kya hai? Yeh Option A (Hashing) ka hi advanced version hai. Isme servers ko ring ki tarah arrange kiya jata hai taaki agar ek server add/remove ho, toh poora data reshuffle na karna pade.&lt;br&gt;
Fayda: Scaling aur rebalancing bahut aasaan hai.&lt;br&gt;
Nuksan: Yeh bhi hashing hi hai. Agar maine order_id par hash kiya, toh wahi Scatter-Gather problem aayegi. Customer ke saare orders alag-alag jagah bikhre honge.&lt;/p&gt;

&lt;p&gt;Subscribe :)&lt;/p&gt;

&lt;h1&gt;
  
  
  SystemDesign #Databases #PostgreSQL #BackendEngineering #SystemDesignInterview #SystemDesignBlog #Redis #Sharding #BlackFridaySystemDesign
&lt;/h1&gt;

</description>
      <category>blackfridaysystemdesign</category>
      <category>systemdesignhinglish</category>
      <category>redis</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Your Smartphone can now deliver best gaming graphics, run AI directly on the device - Qualcomm's Snapdragon 8 Elite</title>
      <dc:creator>Bhanu partap</dc:creator>
      <pubDate>Sat, 10 Oct 2026 06:42:43 +0000</pubDate>
      <link>https://dev.to/bhanupartap13/your-smartphone-can-now-deliver-best-gaming-graphics-run-ai-directly-on-the-device-qualcomms-n0g</link>
      <guid>https://dev.to/bhanupartap13/your-smartphone-can-now-deliver-best-gaming-graphics-run-ai-directly-on-the-device-qualcomms-n0g</guid>
      <description>&lt;p&gt;&lt;em&gt;We first need to understand the challenges with previous mobile platforms.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Mobile devices have limited power and cooling capacity. When a game renders complex graphics at high frame rates, the GPU has to perform more work. This can increase power consumption and heat, which may cause performance to drop during long gaming sessions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AI introduces another challenge. Running AI models directly on a smartphone requires sufficient computing power and memory. Some AI features also depend on cloud servers, which can introduce network delays and require an internet connection.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The challenge is not simply to make a smartphone faster. It is to improve performance, graphics, and AI capabilities while managing power consumption and heat.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;What Has Qualcomm Added?&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Qualcomm is improving three important parts of the mobile architecture: the CPU, GPU, and NPU.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;First, the CPU, powered by Qualcomm’s custom Oryon architecture, handles general computing, application logic, and system tasks. Improvements here are designed to support faster processing and smoother application performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Second, the Adreno GPU handles graphics rendering for games and other visual applications.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the key additions is Adreno Neural Fusion. It combines AI-assisted graphics techniques, including super resolution and frame generation, within a unified graphics pipeline.&lt;/p&gt;

&lt;p&gt;Super resolution uses AI to reconstruct a higher-resolution image from a lower-resolution input. Frame generation creates additional frames between rendered frames to make motion appear smoother.&lt;/p&gt;

&lt;p&gt;Qualcomm has also introduced Adreno matrix cores for AI-related GPU workloads. For game developers, these capabilities create new opportunities to improve visual quality without requiring every graphical detail to be rendered in the traditional way.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Third, the Hexagon NPU is designed to accelerate AI workloads. Instead of relying entirely on the CPU, applications can use dedicated AI hardware for supported operations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This helps enable on-device AI, where supported models and tasks can run directly on the smartphone instead of always sending requests to cloud servers.&lt;/p&gt;

&lt;p&gt;Qualcomm is also advancing mobile imaging through Intelligent Pixel Control and Advanced Professional Video support on the Extreme platform.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;What Will Be the Results?&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For gamers, these technologies could deliver sharper graphics and smoother gameplay, depending on game support and device performance.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;For game developers, AI-assisted rendering creates more options to improve visual quality while managing the processing demands of mobile hardware.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For AI developers, on-device processing can support responsive AI features with reduced dependence on remote servers. However, the actual benefits depend on model size, memory, software optimisation, and the workload.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For content creators, improvements in image processing and video capabilities could support better mobile photography and more advanced video workflows.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The final experience will still depend on the smartphone’s cooling system, software, game-engine integration, and how developers implement these technologies.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Closing&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The biggest change is not simply a faster processor. It is the closer integration of traditional computing, graphics processing, and artificial intelligence.&lt;/p&gt;

&lt;p&gt;Qualcomm is giving developers more tools to build advanced mobile experiences.&lt;/p&gt;

&lt;p&gt;The real test, however, is how well smartphone manufacturers and developers turn these hardware capabilities into features that people can actually use.&lt;/p&gt;

&lt;p&gt;Bhanu Partap,&lt;br&gt;
&lt;a href="mailto:partapbhanu516@gmail.com"&gt;partapbhanu516@gmail.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>snapdragon</category>
      <category>qualcomm</category>
      <category>chips</category>
      <category>imc2026</category>
    </item>
  </channel>
</rss>
