SYSTEM DESIGN - EX3

1. Amazon's sales rank by category feature

1.1. Requirement & scope

// Use cases
User: views lwmppbc
Service: calculates lwmppbc (last week's most popular products by category)
Service: high availability

// Out of scope
other e-commerce components
// Assumptions
Not even traffic
Items can be in multiple categories
Items cannot change categories

no subcategories
updated hourly / frequently update for more popular products

1.2. Calculation

5B created_at

8B product_id

4B categry_id

8B seller_id

8B buyer_id

4B quantity

5B total_price

total size ~ 40B

1.3. Design

1.4. Core

1.4.1 Use case: Service calculates lwmppbc

save Sales API server log files on S3

1.4.2 Use case: User views lwmppbc

1.5. Scale

2. Scales to millions of users on AWS

2.1. Requirement & scope

2.2. Calculation

2.3. Design

Autoscaling groups not shown to reduce clutter

2.4. Core

2.4.1 User makes a read or write request

(1) Step 1

(2) Step 2

MySQL DB takes more and more memory and CPU resources; no disk space.

(3) Step 3

Slow web server

(4) Step 4

read-heavy (100:1 with writes) & poor DB performance

(5) Step 5

heavy load in office time => autoscaling

(6) Step 6

continue

Last updated

Was this helpful?