SlideShare a Scribd company logo
Methodology for FB Messenger/Whatsapp
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
Facebook Messenger/Whatsapp
Step 1a: Use Cases
● Functional requirements (use cases)
○ Users sends a message
○ Users receives messages
○ Users can search chat history
● Nonfunctional requirements
○ High availability
○ High reliability
Facebook Messenger/Whatsapp
Step 1b: Assumptions, Constraints
● Uneven traffic
● 1 billion users
● 1 million chat writes/sec
● 1 million chat reads/sec
○ 1:1 read-write (even)
Facebook Messenger/Whatsapp
Step 2a: Back of envelope calculations
● Database design
○ Users table
■ Id
■ Name
■ Created_at
■ Active_chat_ID
○ Chat table
■ Id
■ Chat Name
■ Created_at
■ Particpants_progress (object with users_id and timestamps)
○ Message table
■ Id
■ Chat_ID
■ Sender_ID
■ Content
■ Created_at
Facebook Messenger/Whatsapp
Step 2b: Back of envelope calculations
● Daily Traffic Estimates
○ 1 million chat writes/sec and reads/sec
■ 1:1 read-write (even)
● Storage Estimates
○ Sizes of users (~50 b), chats (~50 b), messages (~100 b)
tables (~200 bytes total)
■ 200 MB/s
● 200 bytes * 1 million/sec
Facebook Messenger/Whatsapp
Step 3: Design core components
● Use case #1: User sends a message
○ Server, write API, database
● Use case #2: User reads a message
○ Server, read API, database
● Use case #3: User searches a chat
○ Search service
Facebook Messenger/Whatsapp
Step 4: High level design
Facebook Messenger/Whatsapp
Step 5: Scale design
● High reliability and high availability
○ Add load balancers, DB shards, caches

More Related Content

What's hot

Design Patterns for working with Fast Data in Kafka
Design Patterns for working with Fast Data in KafkaDesign Patterns for working with Fast Data in Kafka
Design Patterns for working with Fast Data in Kafka
Ian Downard
 
Chat Application [Full Documentation]
Chat Application [Full Documentation]Chat Application [Full Documentation]
Chat Application [Full Documentation]
Rajon
 
Rate limits and Performance
Rate limits and PerformanceRate limits and Performance
Rate limits and Performance
supergigas
 
Microservices Design Patterns
Microservices Design PatternsMicroservices Design Patterns
Microservices Design Patterns
Haim Michael
 
Python final ppt
Python final pptPython final ppt
Python final ppt
Ripal Ranpara
 
End-to-end dialogue systems, or a feature which wasn’t meant to happen | Rasa...
End-to-end dialogue systems, or a feature which wasn’t meant to happen | Rasa...End-to-end dialogue systems, or a feature which wasn’t meant to happen | Rasa...
End-to-end dialogue systems, or a feature which wasn’t meant to happen | Rasa...
Rasa Technologies
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - Plansoft
Miki Lombardi
 
End-to-end Streaming Between gRPC Services Via Kafka with John Fallows
End-to-end Streaming Between gRPC Services Via Kafka with John FallowsEnd-to-end Streaming Between gRPC Services Via Kafka with John Fallows
End-to-end Streaming Between gRPC Services Via Kafka with John Fallows
HostedbyConfluent
 
Exactly-Once Financial Data Processing at Scale with Flink and Pinot
Exactly-Once Financial Data Processing at Scale with Flink and PinotExactly-Once Financial Data Processing at Scale with Flink and Pinot
Exactly-Once Financial Data Processing at Scale with Flink and Pinot
Flink Forward
 
GOTO Berlin - Battle of the Circuit Breakers: Resilience4J vs Istio
GOTO Berlin - Battle of the Circuit Breakers: Resilience4J vs IstioGOTO Berlin - Battle of the Circuit Breakers: Resilience4J vs Istio
GOTO Berlin - Battle of the Circuit Breakers: Resilience4J vs Istio
Nicolas Fränkel
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
The top 3 challenges running multi-tenant Flink at scale
The top 3 challenges running multi-tenant Flink at scaleThe top 3 challenges running multi-tenant Flink at scale
The top 3 challenges running multi-tenant Flink at scale
Flink Forward
 
How Uber scaled its Real Time Infrastructure to Trillion events per day
How Uber scaled its Real Time Infrastructure to Trillion events per dayHow Uber scaled its Real Time Infrastructure to Trillion events per day
How Uber scaled its Real Time Infrastructure to Trillion events per day
DataWorks Summit
 
A project report on chat application
A project report on chat applicationA project report on chat application
A project report on chat applicationKumar Gaurav
 
Microservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring CloudMicroservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring Cloud
Eberhard Wolff
 
Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...
Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...
Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...
HostedbyConfluent
 
Python Basics | Python Tutorial | Edureka
Python Basics | Python Tutorial | EdurekaPython Basics | Python Tutorial | Edureka
Python Basics | Python Tutorial | Edureka
Edureka!
 
State of Micro Frontend
State of Micro FrontendState of Micro Frontend
State of Micro Frontend
Yugo Sakamoto
 
Chat Application - Requirements Analysis & Design
Chat Application - Requirements Analysis & DesignChat Application - Requirements Analysis & Design
Chat Application - Requirements Analysis & Design
Rajon
 
Pinterest’s Story of Streaming Hundreds of Terabytes of Pins from MySQL to S3...
Pinterest’s Story of Streaming Hundreds of Terabytes of Pins from MySQL to S3...Pinterest’s Story of Streaming Hundreds of Terabytes of Pins from MySQL to S3...
Pinterest’s Story of Streaming Hundreds of Terabytes of Pins from MySQL to S3...
confluent
 

What's hot (20)

Design Patterns for working with Fast Data in Kafka
Design Patterns for working with Fast Data in KafkaDesign Patterns for working with Fast Data in Kafka
Design Patterns for working with Fast Data in Kafka
 
Chat Application [Full Documentation]
Chat Application [Full Documentation]Chat Application [Full Documentation]
Chat Application [Full Documentation]
 
Rate limits and Performance
Rate limits and PerformanceRate limits and Performance
Rate limits and Performance
 
Microservices Design Patterns
Microservices Design PatternsMicroservices Design Patterns
Microservices Design Patterns
 
Python final ppt
Python final pptPython final ppt
Python final ppt
 
End-to-end dialogue systems, or a feature which wasn’t meant to happen | Rasa...
End-to-end dialogue systems, or a feature which wasn’t meant to happen | Rasa...End-to-end dialogue systems, or a feature which wasn’t meant to happen | Rasa...
End-to-end dialogue systems, or a feature which wasn’t meant to happen | Rasa...
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - Plansoft
 
End-to-end Streaming Between gRPC Services Via Kafka with John Fallows
End-to-end Streaming Between gRPC Services Via Kafka with John FallowsEnd-to-end Streaming Between gRPC Services Via Kafka with John Fallows
End-to-end Streaming Between gRPC Services Via Kafka with John Fallows
 
Exactly-Once Financial Data Processing at Scale with Flink and Pinot
Exactly-Once Financial Data Processing at Scale with Flink and PinotExactly-Once Financial Data Processing at Scale with Flink and Pinot
Exactly-Once Financial Data Processing at Scale with Flink and Pinot
 
GOTO Berlin - Battle of the Circuit Breakers: Resilience4J vs Istio
GOTO Berlin - Battle of the Circuit Breakers: Resilience4J vs IstioGOTO Berlin - Battle of the Circuit Breakers: Resilience4J vs Istio
GOTO Berlin - Battle of the Circuit Breakers: Resilience4J vs Istio
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
 
The top 3 challenges running multi-tenant Flink at scale
The top 3 challenges running multi-tenant Flink at scaleThe top 3 challenges running multi-tenant Flink at scale
The top 3 challenges running multi-tenant Flink at scale
 
How Uber scaled its Real Time Infrastructure to Trillion events per day
How Uber scaled its Real Time Infrastructure to Trillion events per dayHow Uber scaled its Real Time Infrastructure to Trillion events per day
How Uber scaled its Real Time Infrastructure to Trillion events per day
 
A project report on chat application
A project report on chat applicationA project report on chat application
A project report on chat application
 
Microservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring CloudMicroservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring Cloud
 
Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...
Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...
Mistakes - I’ve made a few. Blunders in event-driven architecture | Simon Aub...
 
Python Basics | Python Tutorial | Edureka
Python Basics | Python Tutorial | EdurekaPython Basics | Python Tutorial | Edureka
Python Basics | Python Tutorial | Edureka
 
State of Micro Frontend
State of Micro FrontendState of Micro Frontend
State of Micro Frontend
 
Chat Application - Requirements Analysis & Design
Chat Application - Requirements Analysis & DesignChat Application - Requirements Analysis & Design
Chat Application - Requirements Analysis & Design
 
Pinterest’s Story of Streaming Hundreds of Terabytes of Pins from MySQL to S3...
Pinterest’s Story of Streaming Hundreds of Terabytes of Pins from MySQL to S3...Pinterest’s Story of Streaming Hundreds of Terabytes of Pins from MySQL to S3...
Pinterest’s Story of Streaming Hundreds of Terabytes of Pins from MySQL to S3...
 

Similar to Facebook Messenger/Whatsapp System Design

Building Facebook Apps
Building Facebook AppsBuilding Facebook Apps
Building Facebook Apps
David Keener
 
Amazon Products Category Ranking System Design
Amazon Products Category Ranking  System DesignAmazon Products Category Ranking  System Design
Amazon Products Category Ranking System Design
Elia Ahadi
 
Pakistan Census Data – Case Study
Pakistan Census Data – Case StudyPakistan Census Data – Case Study
Pakistan Census Data – Case Study
Jabran Rafique
 
ShutApp
ShutAppShutApp
Reporting Solution for ASP.NET Application with Telerik reporting
Reporting Solution for ASP.NET Application with Telerik reportingReporting Solution for ASP.NET Application with Telerik reporting
Reporting Solution for ASP.NET Application with Telerik reporting
Lohith Goudagere Nagaraj
 
FOSSASIA 2016 - 7 Tips to design web centric high-performance applications
FOSSASIA 2016 - 7 Tips to design web centric high-performance applicationsFOSSASIA 2016 - 7 Tips to design web centric high-performance applications
FOSSASIA 2016 - 7 Tips to design web centric high-performance applications
Ashnikbiz
 
Introduction of internet
Introduction of internetIntroduction of internet
Introduction of internet
13023901-016
 
ICT 1 - syllabus.pdf
ICT 1 - syllabus.pdfICT 1 - syllabus.pdf
ICT 1 - syllabus.pdf
ChristopherPilotin3
 
Meet with Meteor
Meet with MeteorMeet with Meteor
Meet with Meteor
Tahmina Khatoon
 
Software Engineering
Software EngineeringSoftware Engineering
Software Engineering
Malik Ghulam Murtza
 
OpenMinTeD Requirements Elicitation - Agro-Know
OpenMinTeD Requirements Elicitation - Agro-KnowOpenMinTeD Requirements Elicitation - Agro-Know
OpenMinTeD Requirements Elicitation - Agro-Know
cthanopoulos
 
redpill Forensics
redpill Forensicsredpill Forensics
redpill Forensics
Peter Presnell
 
Tweakthetweet
TweakthetweetTweakthetweet
Tweakthetweet
rhokto
 
Tweak thetweet
Tweak thetweetTweak thetweet
Tweak thetweet
rhokto
 
Ebanking slide
Ebanking slideEbanking slide
Ebanking slide
Tài Vĩnh
 

Similar to Facebook Messenger/Whatsapp System Design (20)

User study request approval
User study request approvalUser study request approval
User study request approval
 
Building Facebook Apps
Building Facebook AppsBuilding Facebook Apps
Building Facebook Apps
 
Amazon Products Category Ranking System Design
Amazon Products Category Ranking  System DesignAmazon Products Category Ranking  System Design
Amazon Products Category Ranking System Design
 
Ch1
Ch1Ch1
Ch1
 
Online help desk
Online help deskOnline help desk
Online help desk
 
Pakistan Census Data – Case Study
Pakistan Census Data – Case StudyPakistan Census Data – Case Study
Pakistan Census Data – Case Study
 
ShutApp
ShutAppShutApp
ShutApp
 
Reporting Solution for ASP.NET Application with Telerik reporting
Reporting Solution for ASP.NET Application with Telerik reportingReporting Solution for ASP.NET Application with Telerik reporting
Reporting Solution for ASP.NET Application with Telerik reporting
 
FOSSASIA 2016 - 7 Tips to design web centric high-performance applications
FOSSASIA 2016 - 7 Tips to design web centric high-performance applicationsFOSSASIA 2016 - 7 Tips to design web centric high-performance applications
FOSSASIA 2016 - 7 Tips to design web centric high-performance applications
 
Introduction of internet
Introduction of internetIntroduction of internet
Introduction of internet
 
ICT 1 - syllabus.pdf
ICT 1 - syllabus.pdfICT 1 - syllabus.pdf
ICT 1 - syllabus.pdf
 
Online quiz system
Online quiz systemOnline quiz system
Online quiz system
 
Meet with Meteor
Meet with MeteorMeet with Meteor
Meet with Meteor
 
Software Engineering
Software EngineeringSoftware Engineering
Software Engineering
 
OpenMinTeD Requirements Elicitation - Agro-Know
OpenMinTeD Requirements Elicitation - Agro-KnowOpenMinTeD Requirements Elicitation - Agro-Know
OpenMinTeD Requirements Elicitation - Agro-Know
 
redpill Forensics
redpill Forensicsredpill Forensics
redpill Forensics
 
Tweakthetweet
TweakthetweetTweakthetweet
Tweakthetweet
 
Tweak thetweet
Tweak thetweetTweak thetweet
Tweak thetweet
 
Persona request approval
Persona request approvalPersona request approval
Persona request approval
 
Ebanking slide
Ebanking slideEbanking slide
Ebanking slide
 

Recently uploaded

Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
ShahidSultan24
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
MuhammadTufail242431
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 

Recently uploaded (20)

Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 

Facebook Messenger/Whatsapp System Design

  • 1. Methodology for FB Messenger/Whatsapp 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. Facebook Messenger/Whatsapp Step 1a: Use Cases ● Functional requirements (use cases) ○ Users sends a message ○ Users receives messages ○ Users can search chat history ● Nonfunctional requirements ○ High availability ○ High reliability
  • 3. Facebook Messenger/Whatsapp Step 1b: Assumptions, Constraints ● Uneven traffic ● 1 billion users ● 1 million chat writes/sec ● 1 million chat reads/sec ○ 1:1 read-write (even)
  • 4. Facebook Messenger/Whatsapp Step 2a: Back of envelope calculations ● Database design ○ Users table ■ Id ■ Name ■ Created_at ■ Active_chat_ID ○ Chat table ■ Id ■ Chat Name ■ Created_at ■ Particpants_progress (object with users_id and timestamps) ○ Message table ■ Id ■ Chat_ID ■ Sender_ID ■ Content ■ Created_at
  • 5. Facebook Messenger/Whatsapp Step 2b: Back of envelope calculations ● Daily Traffic Estimates ○ 1 million chat writes/sec and reads/sec ■ 1:1 read-write (even) ● Storage Estimates ○ Sizes of users (~50 b), chats (~50 b), messages (~100 b) tables (~200 bytes total) ■ 200 MB/s ● 200 bytes * 1 million/sec
  • 6. Facebook Messenger/Whatsapp Step 3: Design core components ● Use case #1: User sends a message ○ Server, write API, database ● Use case #2: User reads a message ○ Server, read API, database ● Use case #3: User searches a chat ○ Search service
  • 8. Facebook Messenger/Whatsapp Step 5: Scale design ● High reliability and high availability ○ Add load balancers, DB shards, caches