SlideShare a Scribd company logo
1 of 8
Download to read offline
Methodology
1. 5 Step Process
1.1. Use cases, assumptions, constraints
1.2. Back of envelope calculations
1.3. Design core components
1.4. High level design
1.5. Scale the design
Amazon Recently Viewed Items
Step 1a: Use Cases
● Functional requirements (use cases)
○ Service calculates the past week's most popular products
by category
○ User views recently viewed items
● Nonfunctional requirements
○ High availability
Amazon Recently Viewed Items
Step 1b: Assumptions / Constraints
● Uneven traffic
● 1 million products
● 100 categories
● 1 billion write transactions/month
● 50 billion write transactions/month
○ 50:1 read-write (read heavy)
Amazon Recently Viewed Items
Step 2a: Back of envelope calculations
● Database design
○ Users table: ~50 bytes
○ Products table: ~50 bytes
○ Categories table: ~50 bytes
○ Transactions table: ~50 bytes
Amazon Recently Viewed Items
Step 2b: Back of envelope calculations
● Daily Traffic
○ 1 billion write transactions/month
■ ~380 write/s
○ 50 billion write transactions/month
■ ~19,000 read/s
● Storage
○ Size per transaction per month
■ 50 GB writes/mo = 50 bytes * 1 billion writes/month
■ 250 GB reads/mo = 50 bytes * 50 billion reads/month
Amazon Recently Viewed Items
Step 3: Design core components
● Use case#1: Service for popular products by category
○ Write API gathers raw rank data
○ Rank service using MapReduce for data
● Use case #2: Users view latest products
○ Read API views data in SQL
Amazon Recently Viewed Items
Step 4: High Level Design
Amazon Recently Viewed Items
Step 5: Scale Design
● 250 billion read transactions/month (read heavy)

More Related Content

Similar to Amazon Products Category Ranking System Design

Web_Intelligence_Activity_Workbook_Sample
Web_Intelligence_Activity_Workbook_SampleWeb_Intelligence_Activity_Workbook_Sample
Web_Intelligence_Activity_Workbook_Sample
Ronald Ciampi
 
Big data @ uber vu (1)
Big data @ uber vu (1)Big data @ uber vu (1)
Big data @ uber vu (1)
Mihnea Giurgea
 

Similar to Amazon Products Category Ranking System Design (8)

Facebook Messenger/Whatsapp System Design
Facebook Messenger/Whatsapp System DesignFacebook Messenger/Whatsapp System Design
Facebook Messenger/Whatsapp System Design
 
Web_Intelligence_Activity_Workbook_Sample
Web_Intelligence_Activity_Workbook_SampleWeb_Intelligence_Activity_Workbook_Sample
Web_Intelligence_Activity_Workbook_Sample
 
WebCamp:Front-end Developers Day. Алексей Ященко, Сергей Руденко "Фронтенд-мо...
WebCamp:Front-end Developers Day. Алексей Ященко, Сергей Руденко "Фронтенд-мо...WebCamp:Front-end Developers Day. Алексей Ященко, Сергей Руденко "Фронтенд-мо...
WebCamp:Front-end Developers Day. Алексей Ященко, Сергей Руденко "Фронтенд-мо...
 
Rate limits and Performance
Rate limits and PerformanceRate limits and Performance
Rate limits and Performance
 
[RakutenTechConf2013] [D-3_2] Counting Big Data by Streaming Algorithms
[RakutenTechConf2013] [D-3_2] Counting Big Databy Streaming Algorithms[RakutenTechConf2013] [D-3_2] Counting Big Databy Streaming Algorithms
[RakutenTechConf2013] [D-3_2] Counting Big Data by Streaming Algorithms
 
Big data @ uber vu (1)
Big data @ uber vu (1)Big data @ uber vu (1)
Big data @ uber vu (1)
 
Hands-on Lab Building High Performance Apps with In-Memory Data
Hands-on Lab Building High Performance Apps with In-Memory DataHands-on Lab Building High Performance Apps with In-Memory Data
Hands-on Lab Building High Performance Apps with In-Memory Data
 
Building High Performance Apps with In-Memory Data
Building High Performance Apps with In-Memory DataBuilding High Performance Apps with In-Memory Data
Building High Performance Apps with In-Memory Data
 

Recently uploaded

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
Health
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 

Recently uploaded (20)

Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 

Amazon Products Category Ranking System Design

  • 1. Methodology 1. 5 Step Process 1.1. Use cases, assumptions, constraints 1.2. Back of envelope calculations 1.3. Design core components 1.4. High level design 1.5. Scale the design
  • 2. Amazon Recently Viewed Items Step 1a: Use Cases ● Functional requirements (use cases) ○ Service calculates the past week's most popular products by category ○ User views recently viewed items ● Nonfunctional requirements ○ High availability
  • 3. Amazon Recently Viewed Items Step 1b: Assumptions / Constraints ● Uneven traffic ● 1 million products ● 100 categories ● 1 billion write transactions/month ● 50 billion write transactions/month ○ 50:1 read-write (read heavy)
  • 4. Amazon Recently Viewed Items Step 2a: Back of envelope calculations ● Database design ○ Users table: ~50 bytes ○ Products table: ~50 bytes ○ Categories table: ~50 bytes ○ Transactions table: ~50 bytes
  • 5. Amazon Recently Viewed Items Step 2b: Back of envelope calculations ● Daily Traffic ○ 1 billion write transactions/month ■ ~380 write/s ○ 50 billion write transactions/month ■ ~19,000 read/s ● Storage ○ Size per transaction per month ■ 50 GB writes/mo = 50 bytes * 1 billion writes/month ■ 250 GB reads/mo = 50 bytes * 50 billion reads/month
  • 6. Amazon Recently Viewed Items Step 3: Design core components ● Use case#1: Service for popular products by category ○ Write API gathers raw rank data ○ Rank service using MapReduce for data ● Use case #2: Users view latest products ○ Read API views data in SQL
  • 7. Amazon Recently Viewed Items Step 4: High Level Design
  • 8. Amazon Recently Viewed Items Step 5: Scale Design ● 250 billion read transactions/month (read heavy)