Products›🛒 E-Commerce›Amazon
🛒

Amazon

The everything store at planetary scale — handling Black Friday rushes

99.99%
SLA
20
SERVICES
15
NODES
REQ/SEC0
LATENCY0ms
ERROR RATE0%
CACHE HIT95%
ACTIVE CONNS0
QUEUE DEPTH0

Amazon Architecture Blueprint

Click ▶ RUN to animate active particle streams across microservices

client
gateway
service
database
cache
queue
cdn
storage
SYSTEM ARCHITECTURE WALKTHROUGH

How Traffic Flows Through Amazon

EDGE TIER01

1. Ingress & Edge Routing

User requests arrive at the edge network. Global CDNs cache static assets and media. API Gateways terminate TLS, validate JWT authentication tokens, enforce token-bucket rate limits, and scrub malicious bot traffic before forwarding to internal services.

User ClientCloudFront CDNAPI Gateway & WAFApplication Load Balancer
APPLICATION TIER02

2. Microservice Processing

Stateless domain services execute core business logic. Microservices communicate via high-performance internal gRPC/REST APIs and autoscaling worker pods, ensuring that high load on one domain never exhausts compute resources of another.

Product Catalog ServiceSearch & DiscoveryShopping Cart ServiceOrder Orchestrator (Saga)
DATA TIER03

3. In-Memory Caching & Storage

Read-heavy traffic is served from in-memory Redis clusters with sub-millisecond latencies, protecting primary databases. Persistent databases (PostgreSQL, Cassandra, DynamoDB) maintain ACID consistency for financial ledgers, user accounts, and immutable state records.

DynamoDB ClusterElastiCache (Redis)
MESSAGING TIER04

4. Asynchronous Event Streams

Heavy operations (notifications, audit logging, analytics, ML training, fan-out delivery) are decoupled into durable event logs like Kafka and SQS. This prevents user-facing requests from blocking on slow external networks.

SQS / EventBridge
📖 SYSTEM DESIGN WHITE PAPERS & LOW-LEVEL SPECIFICATIONS

Study Amazon's database schemas, capacity math & production contracts

Beyond the visual blueprint, explore the exhaustive 7-section engineering whitepaper with real DDL schemas, API endpoints, failure mitigation matrices, and 45-minute FAANG interview scripts.

🏆 #1 HARDEST SYSTEM CHALLENGE

Preventing Inventory Overselling During 100x Black Friday Spikes

⚠️The Engineering Bottleneck

Traditional relational databases use pessimistic row locks (`SELECT ... FOR UPDATE`). When 50,000 shoppers compete for 500 limited flash sale items simultaneously, pessimistic locks cause massive thread deadlocks and server crashes.

💡The Winning Architectural Solution

Amazon pioneered optimistic concurrency control with DynamoDB conditional writes: `SET stock = stock - 1 WHERE stock > 0 AND version = current_version`. Only the first 500 requests successfully decrement the counter; remaining requests fail gracefully and receive "Item Sold Out" without database locks.

SCALE & PRODUCTION METRICS:Zero overselling across hundreds of millions of items during Black Friday / Prime Day sales.

⚖️ Architectural Trade-Offs & Decisions

Why the engineering team chose this specific stack over competing alternatives

Why the Distributed Saga Pattern instead of Two-Phase Commit (2PC)?
CHOSEN:✓ Distributed Saga Patternvs Two-Phase Commit (2PC), Monolithic Transaction

Two-Phase Commit requires all participating microservices (Payment, Inventory, Shipping) to hold database locks until every service acknowledges readiness. If one service is slow, the entire checkout pipeline freezes. Saga uses asynchronous local transactions with automated compensating rollbacks if any step fails.

Why DynamoDB instead of MySQL/PostgreSQL for product inventory?
CHOSEN:✓ Amazon DynamoDBvs MySQL Shards, PostgreSQL, Oracle RAC

DynamoDB partitions data across storage nodes using consistent hashing on primary keys. Read and write latencies remain strictly under 10ms whether the database stores 1,000 items or 1 billion items, making it impervious to holiday traffic spikes.

🚨 REAL-WORLD POST-MORTEM

Prime Day 2018 Homepage & Cart Crash

The Incident

Within minutes of Prime Day 2018 launching, Amazon's homepage crashed, displaying photos of employee dogs ("Dogs of Amazon"), and checkout buttons failed globally.

Root Cause Analysis

A global internal service dependency (Sable document store) was saturated by excessive read traffic from the personalized homepage recommendation widget, cascading into API gateway timeouts.

How They Re-Architected It

Amazon adopted strict Cell-Based Architecture where services are partitioned into isolated "cells". If one cell experiences high load, it cannot cascade to other customers, and non-essential widgets are automatically shed during peak traffic.

📋 Complete Microservice Specifications

Every service in the Amazon ecosystem with production tech stacks and failure impact

ComponentTier / LayerTech StackProduction FunctionStatus / Chaos
User ClientCLIENT
ReactMobileAlexa
Web, iOS, Android, and Alexa consumers shopping and purchasing items
CloudFront CDNCDN
AWS CloudFront
Global edge CDN caching product images, CSS/JS bundles, and static catalog pages
API Gateway & WAFGATEWAY
API GWAWS WAF
AWS API Gateway protected by AWS WAF for bot mitigation and rate limiting
Application Load BalancerLB
AWS ALB
Layer 7 ALB routing traffic across multiple Availability Zones
Product Catalog ServiceSERVICE
JavaDynamoDB
Manages product metadata, descriptions, specifications, and seller listings
Search & DiscoverySERVICE
ElasticsearchLucene
Elasticsearch search cluster powering typo-tolerant autocomplete and filters
Shopping Cart ServiceSERVICE
JavaRedis
High-availability cart service storing active shopping sessions in ElastiCache
Order Orchestrator (Saga)SERVICE
JavaAWS Step Functions
Orchestrates distributed Saga pattern across payment, inventory, and fulfillment
Payment ServiceSERVICE
JavaPCI-DSS
Payment gateway integrating credit cards, Amazon Pay, gift cards, and BNPL
Inventory ServiceSERVICE
JavaDynamoDB
Maintains real-time stock levels across fulfillment centers with optimistic locks
Fulfillment & ShippingSERVICE
JavaSQS
Routes orders to nearest Amazon Fulfillment Center with available inventory
Notification ServiceSERVICE
SESSNS
Dispatches order confirmation emails, delivery tracking SMS, and app notifications
DynamoDB ClusterDATABASE
Amazon DynamoDB
Planetary NoSQL database invented at Amazon for low-latency predictable scaling
SQS / EventBridgeQUEUE
AWS SQSEventBridge
Decoupled event streaming bus connecting order orchestration to background workers
ElastiCache (Redis)CACHE
Redis
Distributed in-memory cache for shopping carts, user sessions, and hot products