SlideShare a Scribd company logo
1 of 20
Mechanism
Presented By : Dhruv Patel
Introduction
• 1.15 billion monthly active users .
• 2.5 billion content items shared per day (status updates + wall posts +
photos + videos + comments)
• 2.7 billion Likes per day
• 300 million photos uploaded per day
• 500+terabytes of new data ingested into the databases every day
By this statics, Facebook have to use such a great technology to handle
this traffic and giving their user a faster and safer social experience
Technologies
For faster data transfer
• Cookies and Caches
• GZip compression
• AJAX and JSON
• XMPP messaging
For data storage
• HBase & Haystack
• Zookeeper
• Memcached
• Scribe
Cookies and Caches
Cookies are small pieces of data that are stored on your
computer, mobile phone or other device.
Cache is a type of memory which is used by web browser. When any
page loads and it is not changeable for a long time browser cache it’s
CSS/JS and read it from memory to reduce the data transfer .
It provide and understand a range of products and services.
Facebook use this technologies to do things like:
• make Facebook easier or faster to use;
• enable features and store information about you (including on your
device or in your browser cache) and your use of Facebook;
• deliver, understand and improve advertising;
• monitor and understand the use of FB products and services;
• to protect you, others and Facebook.
Cookies and Caches
Gzip Compression
Gzip is a software application used for file compression and
decompression
It compresses the image, CSS, JS sent by server and loads in client
machine then decompress it. So there is no change in data and UI but
data transfer rate is decreased. So all servers of Facebook used Gzip
compression to make web more faster
AJAX and JSON
AJAX and JSON is a group of interrelated web development techniques
used on the client-side to create asynchronous web applications.
With AJAX, web applications can send data to, and retrieve data
from, a server asynchronously (in the background) without interfering
with the display and behavior of the existing page.
Data can be retrieved using the XMlHttpRequest object.
Where AJAX-JSON mainly used in Facebook
• Like, Comment, Share
• Post story
• Send message
• Load feed
• Dialog Box – likes, Mutual friends etc…
AJAX and JSON
XMPP Messaging
XMPP stands for Extensible Messaging and Presence Protocol.
XMPP is also called jabber protocol.
Facebook chat and messages work on this platform.
Every user of Facebook has a unique id and personal chat email like
100000874067290@chat.facebook.com and someone wants to send
message to that user core script convert it to XML and send to Jabber
server.
After this process partner user gets the message at same instance due
to highly reliable servers.
XMPP Messaging
Manage data in large clusters
HBase and Haystack
HDFS ( Highly Distributed File System )
• HBase & HDFS are elastic by design
• Multiple table shards (regions) per physical server
• On node additions
• Load balancer automatically reassigns shards from overloaded
nodes to new nodes
• Because file system underneath is itself distributed, data for
reassigned regions is instantly servable from the new nodes.
• Regions can be dynamically split into smaller regions.
• Pre-sharding is not necessary
• Splits are near instantaneous!
HBase and Haystack
Automatic failover
• Node failures automatically detected by HBase Master
• Regions on failed node are distributed evenly among surviving
nodes.
• Multiple regions/server model avoids need for substantial
overprovisioning
• HBase Master failover
• 1 active, rest standby
• When active master fails, a standby automatically takes over
HBase and Haystack
Zookeeper
Zookeeper is open source software that FB use mainly for two purposes:
• As the controller for implementing sharding and failover of
application servers
• As a store for their discovery service.
Since Zookeeper provides FB with a highly available repository and
notification mechanism, it goes a long way towards helping FB build a
highly available service.
Memcached
If you've read anything about scaling large websites, you've probably
heard about memcached.
Memcached is a high-performance, distributed memory object
caching system.
It speeding up Facebook by alleviating database load.
Memcached is an in-memory key-value store for small chunks of
arbitrary data (strings, objects) from results of database calls, API calls, or
page rendering.
Facebook is the world's largest user of memcached. They use
memcached to alleviate database load.
Scribe – Log server
Scribe was developed at Facebook using Apache Thrift and released in
2008 as open source.
Scribe is a server for aggregating log data streamed in real-time from a
large number of servers. It is designed to be scalable, extensible without
client-side modification, and robust to failure of the network or any
specific machine.
Desktop site
Mobile site
Application
Legacy
SMS/Email
Scribe
Scribe
Scribe
Scribe – Log server
References
• Facebook.com/engineering
• Facebook.com/data
• Developers.facebook.com
• Newsroom.fb.com
• Hbase.apache.org
• Zookeeper.apache.org
Thank you!

More Related Content

What's hot

How companies-use-no sql-and-couchbase-10152013
How companies-use-no sql-and-couchbase-10152013How companies-use-no sql-and-couchbase-10152013
How companies-use-no sql-and-couchbase-10152013
Dipti Borkar
 
Microsoft's Big Play for Big Data- Visual Studio Live! NY 2012
Microsoft's Big Play for Big Data- Visual Studio Live! NY 2012Microsoft's Big Play for Big Data- Visual Studio Live! NY 2012
Microsoft's Big Play for Big Data- Visual Studio Live! NY 2012
Andrew Brust
 
Антон Бойко "Разделяй и властвуй — набор практик для построения масштабируемо...
Антон Бойко "Разделяй и властвуй — набор практик для построения масштабируемо...Антон Бойко "Разделяй и властвуй — набор практик для построения масштабируемо...
Антон Бойко "Разделяй и властвуй — набор практик для построения масштабируемо...
Marina Peregud
 

What's hot (20)

MongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of viewMongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of view
 
How companies-use-no sql-and-couchbase-10152013
How companies-use-no sql-and-couchbase-10152013How companies-use-no sql-and-couchbase-10152013
How companies-use-no sql-and-couchbase-10152013
 
Compare DynamoDB vs. MongoDB
Compare DynamoDB vs. MongoDBCompare DynamoDB vs. MongoDB
Compare DynamoDB vs. MongoDB
 
How companies use NoSQL and Couchbase - NoSQL Now 2013
How companies use NoSQL and Couchbase - NoSQL Now 2013How companies use NoSQL and Couchbase - NoSQL Now 2013
How companies use NoSQL and Couchbase - NoSQL Now 2013
 
Spark Streaming & Kafka-The Future of Stream Processing
Spark Streaming & Kafka-The Future of Stream ProcessingSpark Streaming & Kafka-The Future of Stream Processing
Spark Streaming & Kafka-The Future of Stream Processing
 
Find a needle in Haystack: Facebook's storage system
Find a needle in Haystack: Facebook's storage systemFind a needle in Haystack: Facebook's storage system
Find a needle in Haystack: Facebook's storage system
 
When to Use MongoDB...and When You Should Not...
When to Use MongoDB...and When You Should Not...When to Use MongoDB...and When You Should Not...
When to Use MongoDB...and When You Should Not...
 
What is NoSQL and CAP Theorem
What is NoSQL and CAP TheoremWhat is NoSQL and CAP Theorem
What is NoSQL and CAP Theorem
 
How companies use NoSQL and Couchbase
How companies use NoSQL and CouchbaseHow companies use NoSQL and Couchbase
How companies use NoSQL and Couchbase
 
NoSQL and MongoDB
NoSQL and MongoDBNoSQL and MongoDB
NoSQL and MongoDB
 
How companies use NoSQL & Couchbase - NoSQL Now 2014
How companies use NoSQL & Couchbase - NoSQL Now 2014How companies use NoSQL & Couchbase - NoSQL Now 2014
How companies use NoSQL & Couchbase - NoSQL Now 2014
 
Facebook[The Nuts and Bolts Technology]
Facebook[The Nuts and Bolts Technology]Facebook[The Nuts and Bolts Technology]
Facebook[The Nuts and Bolts Technology]
 
Big Data on the Microsoft Platform
Big Data on the Microsoft PlatformBig Data on the Microsoft Platform
Big Data on the Microsoft Platform
 
Intoduction of FIrebase Realtime Database
Intoduction of FIrebase Realtime DatabaseIntoduction of FIrebase Realtime Database
Intoduction of FIrebase Realtime Database
 
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL DatabasesDropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
 
Scalable Web Architecture
Scalable Web ArchitectureScalable Web Architecture
Scalable Web Architecture
 
Microsoft's Big Play for Big Data- Visual Studio Live! NY 2012
Microsoft's Big Play for Big Data- Visual Studio Live! NY 2012Microsoft's Big Play for Big Data- Visual Studio Live! NY 2012
Microsoft's Big Play for Big Data- Visual Studio Live! NY 2012
 
Capacity Planning For Your Growing MongoDB Cluster
Capacity Planning For Your Growing MongoDB ClusterCapacity Planning For Your Growing MongoDB Cluster
Capacity Planning For Your Growing MongoDB Cluster
 
SQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The MoveSQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The Move
 
Антон Бойко "Разделяй и властвуй — набор практик для построения масштабируемо...
Антон Бойко "Разделяй и властвуй — набор практик для построения масштабируемо...Антон Бойко "Разделяй и властвуй — набор практик для построения масштабируемо...
Антон Бойко "Разделяй и властвуй — набор практик для построения масштабируемо...
 

Similar to How Facebook actually works????

How facebook works and function- a complete approach
How facebook works and function- a complete approachHow facebook works and function- a complete approach
How facebook works and function- a complete approach
Prakhar Gethe
 
Going Mobile with HTML5
Going Mobile with HTML5Going Mobile with HTML5
Going Mobile with HTML5
John Reiser
 
Membase Meetup 2010
Membase Meetup 2010Membase Meetup 2010
Membase Meetup 2010
Membase
 

Similar to How Facebook actually works???? (20)

Presention on Facebook in f Distributed systems
Presention on Facebook in f Distributed systemsPresention on Facebook in f Distributed systems
Presention on Facebook in f Distributed systems
 
OVERVIEW OF FACEBOOK SCALABLE ARCHITECTURE.
OVERVIEW  OF FACEBOOK SCALABLE ARCHITECTURE.OVERVIEW  OF FACEBOOK SCALABLE ARCHITECTURE.
OVERVIEW OF FACEBOOK SCALABLE ARCHITECTURE.
 
How facebook works and function- a complete approach
How facebook works and function- a complete approachHow facebook works and function- a complete approach
How facebook works and function- a complete approach
 
Life In The FastLane: Full Speed XPages
Life In The FastLane: Full Speed XPagesLife In The FastLane: Full Speed XPages
Life In The FastLane: Full Speed XPages
 
Rapid Web Application Development with the WSO2 Mashup Server
Rapid Web Application Development with the WSO2 Mashup ServerRapid Web Application Development with the WSO2 Mashup Server
Rapid Web Application Development with the WSO2 Mashup Server
 
Optimization of modern web applications
Optimization of modern web applicationsOptimization of modern web applications
Optimization of modern web applications
 
Facebook Hadoop Usecase
Facebook Hadoop UsecaseFacebook Hadoop Usecase
Facebook Hadoop Usecase
 
Going Mobile with HTML5
Going Mobile with HTML5Going Mobile with HTML5
Going Mobile with HTML5
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
 
Real time web apps
Real time web appsReal time web apps
Real time web apps
 
Data Base Connector
Data Base Connector Data Base Connector
Data Base Connector
 
Project First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be usedProject First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be used
 
Architecture Patterns - Open Discussion
Architecture Patterns - Open DiscussionArchitecture Patterns - Open Discussion
Architecture Patterns - Open Discussion
 
Mysql wp memcached
Mysql wp memcachedMysql wp memcached
Mysql wp memcached
 
System design for video streaming service
System design for video streaming serviceSystem design for video streaming service
System design for video streaming service
 
SenchaCon 2016: Turbocharge your Ext JS App - Per Minborg, Anselm McClain, Jo...
SenchaCon 2016: Turbocharge your Ext JS App - Per Minborg, Anselm McClain, Jo...SenchaCon 2016: Turbocharge your Ext JS App - Per Minborg, Anselm McClain, Jo...
SenchaCon 2016: Turbocharge your Ext JS App - Per Minborg, Anselm McClain, Jo...
 
Scalable Architectures - Microsoft Finland DevDays 2014
Scalable Architectures - Microsoft Finland DevDays 2014Scalable Architectures - Microsoft Finland DevDays 2014
Scalable Architectures - Microsoft Finland DevDays 2014
 
Data infrastructure at Facebook
Data infrastructure at Facebook Data infrastructure at Facebook
Data infrastructure at Facebook
 
Membase Meetup 2010
Membase Meetup 2010Membase Meetup 2010
Membase Meetup 2010
 
Tech for the Non Technical - Anatomy of an Application Stack
Tech for the Non Technical - Anatomy of an Application StackTech for the Non Technical - Anatomy of an Application Stack
Tech for the Non Technical - Anatomy of an Application Stack
 

More from Dhruv Patel

More from Dhruv Patel (8)

Shortify for Android
Shortify for AndroidShortify for Android
Shortify for Android
 
Basics of Wordpress
Basics of WordpressBasics of Wordpress
Basics of Wordpress
 
Near field communication - Data transmission
Near field communication - Data transmissionNear field communication - Data transmission
Near field communication - Data transmission
 
Modem technology
Modem technologyModem technology
Modem technology
 
Inside google search - how it works??
Inside google search - how it works??Inside google search - how it works??
Inside google search - how it works??
 
Google glass
Google glassGoogle glass
Google glass
 
Blue brain project
Blue brain projectBlue brain project
Blue brain project
 
Apple iOS - A modern way to mobile operating system
Apple iOS - A modern way to mobile operating systemApple iOS - A modern way to mobile operating system
Apple iOS - A modern way to mobile operating system
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

How Facebook actually works????

  • 2. Introduction • 1.15 billion monthly active users . • 2.5 billion content items shared per day (status updates + wall posts + photos + videos + comments) • 2.7 billion Likes per day • 300 million photos uploaded per day • 500+terabytes of new data ingested into the databases every day By this statics, Facebook have to use such a great technology to handle this traffic and giving their user a faster and safer social experience
  • 3. Technologies For faster data transfer • Cookies and Caches • GZip compression • AJAX and JSON • XMPP messaging For data storage • HBase & Haystack • Zookeeper • Memcached • Scribe
  • 4. Cookies and Caches Cookies are small pieces of data that are stored on your computer, mobile phone or other device. Cache is a type of memory which is used by web browser. When any page loads and it is not changeable for a long time browser cache it’s CSS/JS and read it from memory to reduce the data transfer . It provide and understand a range of products and services. Facebook use this technologies to do things like: • make Facebook easier or faster to use; • enable features and store information about you (including on your device or in your browser cache) and your use of Facebook; • deliver, understand and improve advertising; • monitor and understand the use of FB products and services; • to protect you, others and Facebook.
  • 6. Gzip Compression Gzip is a software application used for file compression and decompression It compresses the image, CSS, JS sent by server and loads in client machine then decompress it. So there is no change in data and UI but data transfer rate is decreased. So all servers of Facebook used Gzip compression to make web more faster
  • 7. AJAX and JSON AJAX and JSON is a group of interrelated web development techniques used on the client-side to create asynchronous web applications. With AJAX, web applications can send data to, and retrieve data from, a server asynchronously (in the background) without interfering with the display and behavior of the existing page. Data can be retrieved using the XMlHttpRequest object. Where AJAX-JSON mainly used in Facebook • Like, Comment, Share • Post story • Send message • Load feed • Dialog Box – likes, Mutual friends etc…
  • 9. XMPP Messaging XMPP stands for Extensible Messaging and Presence Protocol. XMPP is also called jabber protocol. Facebook chat and messages work on this platform. Every user of Facebook has a unique id and personal chat email like 100000874067290@chat.facebook.com and someone wants to send message to that user core script convert it to XML and send to Jabber server. After this process partner user gets the message at same instance due to highly reliable servers.
  • 11. Manage data in large clusters
  • 12. HBase and Haystack HDFS ( Highly Distributed File System ) • HBase & HDFS are elastic by design • Multiple table shards (regions) per physical server • On node additions • Load balancer automatically reassigns shards from overloaded nodes to new nodes • Because file system underneath is itself distributed, data for reassigned regions is instantly servable from the new nodes. • Regions can be dynamically split into smaller regions. • Pre-sharding is not necessary • Splits are near instantaneous!
  • 13. HBase and Haystack Automatic failover • Node failures automatically detected by HBase Master • Regions on failed node are distributed evenly among surviving nodes. • Multiple regions/server model avoids need for substantial overprovisioning • HBase Master failover • 1 active, rest standby • When active master fails, a standby automatically takes over
  • 15. Zookeeper Zookeeper is open source software that FB use mainly for two purposes: • As the controller for implementing sharding and failover of application servers • As a store for their discovery service. Since Zookeeper provides FB with a highly available repository and notification mechanism, it goes a long way towards helping FB build a highly available service.
  • 16. Memcached If you've read anything about scaling large websites, you've probably heard about memcached. Memcached is a high-performance, distributed memory object caching system. It speeding up Facebook by alleviating database load. Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering. Facebook is the world's largest user of memcached. They use memcached to alleviate database load.
  • 17. Scribe – Log server Scribe was developed at Facebook using Apache Thrift and released in 2008 as open source. Scribe is a server for aggregating log data streamed in real-time from a large number of servers. It is designed to be scalable, extensible without client-side modification, and robust to failure of the network or any specific machine. Desktop site Mobile site Application Legacy SMS/Email Scribe Scribe Scribe
  • 18. Scribe – Log server
  • 19. References • Facebook.com/engineering • Facebook.com/data • Developers.facebook.com • Newsroom.fb.com • Hbase.apache.org • Zookeeper.apache.org