Design Warehouse Management System for Swiggy Instamart

Difficulty: MEDIUMCategory: HLDFrequency: 1Asked On 2025-02-14

Problem Statement

Design a scalable and efficient warehouse management system for Swiggy Instamart that manages inventory, tracks orders, optimizes picking/packing, and integrates with delivery operations. Focus on high-level components, APIs, and scalability considerations.


Functional Requirements (FR)


Inventory Management


•Track stock levels of products in real-time.
•Support multiple warehouses and locations.
•Manage product attributes: name, SKU, category, expiry date, batch number.
•Automatically update inventory upon receiving stock or dispatching orders.


Order Fulfillment


•Process customer orders efficiently: picking → packing → dispatch.
•Support batch processing of multiple orders.
•Prioritize urgent or perishable orders.


Warehouse Operations


•Map warehouse layout (shelves, bins, sections) for efficient picking.
•Track item location within warehouse.
•Optimize pick routes for staff.


Replenishment & Alerts


•Auto-generate low-stock alerts.
•Suggest restocking orders based on historical demand and trends.


Integration with Delivery & Retail Systems


•Provide real-time inventory availability to Swiggy Instamart app.
•Sync order status with delivery management systems.


Non-Functional Requirements (NFR)


•Scalability → Support multiple warehouses and millions of SKUs.
•Performance → Real-time inventory updates and fast order processing.
•Reliability → Ensure no stock inconsistencies or lost orders.
•Extensibility → Support new warehouses, product categories, or automation (robots, IoT).
•Security → Protect sensitive inventory and order data.


Core Entities & Attributes


Product


•productId, name, SKU, category, quantity, expiryDate, warehouseId, location


Warehouse


•warehouseId, name, location, shelves[], capacity


Shelf / Bin


•shelfId, location, capacity, storedProducts[]


Order


•orderId, customerId, productList[], status (Pending, Picking, Packed, Dispatched)


Staff / Picker (Optional)


•staffId, name, role, assignedTasks[]


High-Level Components


InventoryService


•Track stock levels, updates, and product locations.
•Handle stock replenishment and low-stock alerts.


OrderManagementService


•Process incoming orders.
•Assign picking and packing tasks.
•Update order status in real-time.


WarehouseLayoutManager


•Maintain warehouse structure (shelves, bins).
•Optimize item locations for picking efficiency.


DeliveryIntegrationService


•Sync orders with delivery systems.
•Provide real-time stock availability to customer apps.


Analytics & Reporting


•Generate reports on stock trends, order fulfillment, and warehouse efficiency.


APIs / Operations


Inventory APIs


•addProduct(product)
•updateStock(productId, quantity)
•getStock(productId)
•getLowStockProducts()


Order APIs


•createOrder(customerId, productList)
•updateOrderStatus(orderId, status)
•getOrderDetails(orderId)


Warehouse APIs


•getProductLocation(productId)
•optimizePickRoute(orderId)


Design Considerations


•Data Storage → Use relational DB for product metadata, NoSQL for real-time inventory and order queues.
•Caching → Cache frequently accessed stock levels for faster lookups.
•Concurrency Handling → Ensure atomic updates for stock levels and order processing.
•Scalability → Partition data by warehouse or product category; support microservices for each core component.
•Integration → Use message queues for communication between WMS and delivery systems.


Solution

Comments