AlgoMaster Logo

Design Online Shopping System like Amazon

Ashish

Ashish Pratap Singh

hard

An Online Shopping System is a large-scale e-commerce platform that enables users to browse, search, and purchase products from a wide range of categories, all from the convenience of a digital interface.

Amazon

Products are often sold by multiple sellers, with the platform acting as a central hub for managing listings, payments, logistics, and order fulfillment.

In this chapter, we will explore the low-level design of online shopping system like Amazon in detail.

Let's start by clarifying the requirements:

1. Clarifying Requirements

Before starting the design, it's important to ask thoughtful questions to uncover hidden assumptions and better define the scope of the system.

Here is an example of how a conversation between the candidate and the interviewer might unfold:

After gathering the details, we can summarize the key system requirements.

1.1 Functional Requirements

  • Allow users to browse and search products with filters (category, price, brand, rating)
  • Enable users to view product details (title, description, price, availability)
  • Support adding and removing items in a shopping cart
  • Allow users to place orders from items in the cart
  • Validate inventory before confirming orders and update stock upon purchase
  • Allow users to view their past orders and order details
  • Support user authentication (login, registration, logout)
  • Provide a unique order ID for each successful transaction

1.2 Non-Functional Requirements

  • Modularity: The system should include well-separated components such as CatalogService, CartService, OrderService, and UserService
  • Scalability: The system should support high volumes of product listings, concurrent users, and transactions
  • Extensibility: The design should allow for future features like seller dashboards, product reviews, wishlists, and delivery tracking
  • Availability: The core services (catalog browsing, cart, order placement) should be highly available
  • Consistency: Inventory and order placement should be transactionally consistent to avoid overselling
  • Maintainability: The code should be organized, testable, and easy to extend
  • Security: User data (profile, order history) should be access-controlled and securely stored

2. Identifying Core Entities

Premium Content

This content is for premium members only.