Urgent.News

What's breaking now, across thousands of outlets.

Tech

How Amazon Handles Millions of Orders on Sale Day - The Engineering Behind It

It's Amazon Great Indian Sale. Midnight strikes. Millions of people hit refresh simultaneously. Your internet slows down. The app feels laggy. You're frantically trying to add that phone to your cart before it goes out of stock. And somehow Amazon doesn't crash. Millions of orders. Milliseconds apart. Payments processing. Inventory updating. Warehouses getting notified. Delivery partners being…

Amazon's Great Indian Sale is a monumental event where millions of people attempt to purchase items all at once. This overwhelming demand places immense pressure on Amazon's systems to process orders, payments, and inventory updates simultaneously. In this report, we explore how Amazon handles this massive task through its unique engineering solutions.

Amazon Prime Day 2024 witnessed over 200 million items sold in just 48 hours, translating to approximately 1.4 million items per minute and 23,000 items per second at peak times. Each order involves multiple critical steps, including inventory checks, payment processing, stock updates, warehouse notifications, delivery scheduling, confirmation emails, and updating the seller dashboard.

At a rate of 23,000 orders per second, a normal web application would quickly become a bottleneck, leading to potential crashes and downtime.

To avoid these catastrophic failures, Amazon utilizes a robust microservices architecture. Rather than relying on a single large application, Amazon breaks down its system into hundreds of small, independent services. Each service has a specific function, such as managing inventory, creating orders, processing payments, sending notifications, handling recommendations, and facilitating search queries.

By running these services independently, each can scale according to its needs, ensuring that a failure in one service does not bring down the entire system.

One of the key challenges Amazon faces during sale day is the cart problem. When a user adds an item to their cart, Amazon uses the concept of eventual consistency. This means that the addition of an item to the cart is instantaneous and always successful. However, the real inventory check occurs at checkout when the user proceeds to pay. This approach allows for faster browsing experiences for millions of users during peak times, as the initial cart addition does not rely on live inventory data.

To ensure that orders are not lost during the processing, Amazon employs message queues. When an order is placed, it is placed into a queue rather than being processed synchronously. Users receive immediate confirmation of their order, while the system works in the background to handle various aspects, such as warehouse notifications, payment processing, email confirmations, and more.

Each step in the queue is processed in order, ensuring that no orders are overlooked or skipped. If one service is temporarily slow, the queue holds the work until that service catches up, preventing any loss of orders.

Another critical aspect of Amazon's architecture is database sharding. A single database cannot handle millions of reads and writes per second during a sale event. To address this, Amazon divides its databases into smaller pieces called shards. Each shard contains a portion of the products, such as electronics, clothing, or books.

When a user checks the stock for a specific item, only the relevant shard for that category is queried. This distribution of the load across multiple shards prevents any single database from becoming overwhelmed and ensures smooth operation during high traffic periods.

To provide fast loading times for users, Amazon utilizes Content Delivery Networks (CDNs). When a user accesses Amazon, product images, CSS files, and JavaScript are not fetched from the main servers in Mumbai and Chennai. Instead, they are retrieved from the nearest edge location in the CDN. These edge locations are strategically placed across India and the world, minimizing the physical distance between the user and the server.

This proximity significantly reduces latency and speeds up the loading of Amazon's website for users worldwide.

Amazon's payment processing system is another crucial component that must remain flawless during sale day. When a user clicks "Pay Now," the payment is routed through a highly available system with multiple payment processors on standby. If one payment processor fails, another takes its place instantly, ensuring uninterrupted processing.

The payment data is encrypted end-to-end, adhering to the strictest security standards, such as PCI DSS, to protect user information. Additionally, transactions are designed to be idempotent, meaning that if a user accidentally clicks "Pay" twice, the second click is recognized as a duplicate, and only a single payment is processed.

Lastly, Amazon's warehouses play a vital role in fulfilling orders placed during sale day. The company employs various technologies to optimize the fulfillment process. Kiva robots move entire shelves of products to human pickers, reducing the time workers spend searching for items. Computer vision systems identify products, verify their accuracy, and check for any damages.

Conveyor systems automatically sort packages and route them to the appropriate shipping carriers. Real-time tracking technology enables users to monitor the status of their orders, from "Out for Delivery" notifications to updates on delivery status, all through their mobile devices.

In summary, Amazon's ability to handle millions of orders during its Great Indian Sale is a testament to its innovative engineering solutions. By leveraging microservices architecture, eventual consistency, message queues, database sharding, content delivery networks, secure payment processing, and advanced warehouse automation, Amazon can efficiently process orders, payments, and inventory updates simultaneously.

These strategies ensure that even during peak times, when millions of users attempt to purchase items simultaneously, the Amazon system remains robust, scalable, and reliable, delivering a seamless shopping experience to customers around the world.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Two vLLM servers on one GPU: the startup check that bites, and the fix

Someone asked on the vLLM tracker how to run a small embedding model next to a chat model on one GPU, so the card isn't half idle.

  • Two vLLM servers run on single RTX 3090 GPU
  • Embedding server set to 10% GPU memory, chat server to 70%
  • Allocated 3% memory utilization for embedding server to succeed

How a Web-Based 3D Product Configurator Works: Models, Rules and Pricing

If you've ever wondered what's behind a 3D product configurator, the kind that lets you change a sofa's fabric and see the price update, here's the architecture in plain terms. 1.

  • 3D asset converted to glTF/GLB for web use
  • Option model defines configurable aspects of product
  • Rules prevent impossible combinations during customization

Turning Google Maps results into a CSV for a small outreach project

I recently helped a friend who runs a small web design studio build a list of local businesses to contact. The goal was simple: every bakery and cafe in two neighbourhoods, with phone, website and…

  • A web design studio aimed to compile local businesses for outreach.
  • GMB Scraper extension exported Google Maps data to CSV format.
  • Filtered for businesses without websites to identify potential clients.

The Anatomy of CVE-2024-4577: Why You Shouldn’t Abandon PHP Over a CGI Best-Fit Code Page Exploit

When a critical Remote Code Execution (RCE) vulnerability hits a language that powers a large share of the web, the headlines predictably declare the death of the ecosystem.

  • CVE-2024-4577 is a PHP RCE vulnerability, not a flaw in modern PHP language.
  • Windows character-encoding mechanics and legacy CGI execution cause the exploit.
  • Upgrade to PHP 8.1.29+, 8.2.20+, or 8.3.8+; migrate from legacy CGI to PHP-FPM.

I planted 370 SEO defects in a fake 400-page site to test an auditor

Everything below uses a site I generated. These are test results, not results from anyone's real website. The idea A crawl of your own site already holds most of what an SEO metadata audit needs…

  • Fake 400-page site planted with 370 SEO defects for auditor testing
  • Auditor detected 370 issues across 54 rule codes, including 50 errors
  • Site scored 94 (grade A) with 333 pages graded A and 67 graded B

More from Saturday 24 October →