SlideShare a Scribd company logo
1 of 32
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
MADANAPALLE INSTITUTE OF TECHNOLOGY AND SCIENCE
(UGC-AUTONOMOUS)
A Seminar Presentation
On
FACEBOOK
[The Nuts and Bolts – Technology]
By
M.Koushik reddy
12691A0546
Under the guidance
N.Sudhakar Yadav
M.Tech
Asst.professor
Contents
• Introduction
• Languages
• Databases
• Software's and technology
So what's all the Hype?
What exactly is Facebook®?
• Facebook® is a “social networking website”
• Facebook® is a free service that allows you to
create an online page to connect with friends,
family, or make new friends with anyone
anywhere.
• On your Facebook® page you can share
pictures, personal information , messages,
videos , join groups and add applications.
Introduction
• Here are a few factoids to give you an idea of the scaling challenge that
Facebook has to deal with:
• Facebook serves 570 billion page views per month (according to Google
Ad Planner).
• There are more photos on Facebook than all other photo sites combined
(including sites like Flickr).
• More than 3 billion photos are uploaded every month.
• Facebook’s systems serve 1.2 million photos per second.
• More than 25 billion pieces of content (status updates, comments, etc) are
shared every month.
• Facebook has more than 30,000 servers (and this number is from last year!)
Languages:
Front End: (client side)
- Java script
Back End: (server side)
- Hack, PHP (HHVM)
- C++,Java
- Python,Erlang
- D,XHP and
- Haskell
•Java script: (Front End)
It is a high-level, dynamic, un typed, and
interpreted programming language
- It is supported by all modern web browsers without plug-ins
• .
Sample code:
FB.getLoginStatus(function(response)
{
if (response.status === 'connected')
{
console.log('Logged in.');
}
else
{
FB.login();
}
})
Back End:(Server side)
Hack:
Hack is a programming language for the Hip-hop Virtual
Machine (HHVM), created by face book as a dialect of PHP.
• It is open-source, licensed under the BSD License
• Hack allows programmers to use both dynamic typing and static typing.
• Introduced on march 20,2014
Sample code:
<?hh
echo 'Hello World';
• An important point : Unlike PHP, Hack and HTML code do not mix.
Normally you can mix PHP and HTML code together in the same file.
PHP VS HACK
• They are both PHP, both run on apache
• Hack tries to implement more functionality and features to PHP and helps to clean up
some of the inconsistencies
Back End:(Server side)
Erlang:
It is a general purpose, concurrent, garbage collected programming
language and runtime system.
• It was originally designed by Ericsson .
• It supports hot swapping, thus code can be changed without stopping a
system.
• It provides language-level features for creating and managing processes
with the aim of simplifying concurrent programming.
• All concurrency is explicit in Erlang, processes communicate
using message passing instead of shared variables, which removes the need
for explicit locks.
Back End:(Server side)
Continue…
Sample code:
An Erlang function that uses recursion to count to ten
-module(count_to_ten).
-export([count_to_ten/0]).
count_to_ten() -> do_count(0).
do_count(10) -> 10;
do_count(Value) -> do_count(Value + 1).
Back End:(Server side)
Erlang in facebook..??
It is used mainly in facebook chat.
Back End:(Server side)
Continue…
System overview :User Interface-Chat in the browser:
Back End:(Server side)
Continue…
System overview :User Interface-Chat in the browser:
• Channel (Erlang): message queuing and delivery .
Queue messages in each user’s “channel”
Deliver messages as responses to long-polling HTTP requests
• Presence (C++): aggregates online info in memory (pull-based presence)
• Chatlogger (C++): stores conversations between page loads
• Web tier (PHP): serves our vanilla web requests
Back End:(Server side)
Haskell:
Haskell is a standardized, general-purpose purely functional
programming language, with non-strict semantics and strong static
typing.
Sample code:
”Hello world program “
module Main where
main :: IO ()
main = putStrLn "Hello, World!"
Back End:(Server side)
Haskell in facebook…??
Fighting spam with Haskell:
Sigma:
One of the weapons in the fight against spam, malware, and other abuse on
Facebook is a system called Sigma.
• Its job is to proactively identify malicious actions on Facebook, such as spam,
phishing attacks, posting links to malware, etc.
• Bad content detected by Sigma is removed automatically so that it doesn't show up
in your News Feed.
• Sigma is a rule engine, which means it runs a set of rules, called policies.
• These policies make it possible for us to identify and block malicious interactions
before they affect people on Facebook.
Back End:(Server side)
• Continue…
Why Haskell in sigma…??
• It was replaced by the FXL(Feature
eXtraction Language) with Haskell.
Reasons for replacements:
1. Purely functional and strongly
typed.
2. Push code changes to production in
minutes.
3. Performance.
4. Support for interactive development.
Database
What database actually Facebook uses..?
• A billion of people are using FACEBOOK, storing every transaction for 800
million users and handling more than 60 million queries per second
• Interacting with their peer and friends through wall posts, uploading their photos,
passing information’s about events and other meaningful information .
• Facebook uses several database techniques.
Databases used in facebook:
• MySql
• HBase
• Cassandra
Databases
MYSQL: Facebook primarily uses MYSQL
for structured data storage such as wall posts,
user information, timeline etc.
• This data is replicated between their various data centers.
Facebook Database Design:
Database
HBase:
Is an open source, non-relational, distributed database modeled written in Java.
• It is developed as part of Apache Software Foundation's Apache Hadoop project
• Runs on top of HDFS (Hadoop Distributed File system), providing BigTable-like
capabilities for Hadoop.
• Hbase is now serving several data-driven websites, including Facebook's Messaging
Platform
Hbase Architecture:
• In HBase, tables are split into regions and are served by the region servers.
• Regions are vertically divided by column families into “Stores”.
• Stores are saved as files in HDFS.
Continue…
The Master Server -
Assigns regions to the region servers and takes the help of Apache ZooKeeper
for this task.
• Handles load balancing of the regions across region servers. It unloads the busy servers
and shifts the regions to less occupied servers.
• Is responsible for operations such as creation of tables and column families.
Regions-
Regions are nothing but tables that are split up and spread across the region
servers.
Zookeeper-
Zookeeper is an open-source project that provides services like maintaining
configuration information, naming, providing distributed synchronization, etc.
• Clients communicate with region servers via zookeeper.
HBase in facebook Messaging
Messaging Data:
• Small/Medium sized data—Hbase
• Search index
• Small message bodies
o Attachments and Large messages– Haystack
• Used for our exesting photo/video store
Continue….
Continue….
Write Path in HBase:
•In Hbase, the messages are
stored in the file(Hfiles), the
messages are directly
appended in the HDFS
Read path:
•Simillarly messages can be
read directly from the Hfiles
Software And Techniques
The Front End:
• Linux & Apache
• Memcache
• Haystack
• Bigpipe
The Back End:
• Thrift (protocol)
• Scribe (log server)
• HipHop for PHP
Software And Techniques
The Front End:
Linux & Apache:
Linux is a Unix-like computer operating
system kernel.
• It’s open source, very customizable, and good for security.
• Facebook runs the Linux operating system on Apache HTTP Servers.
• Apache is also free and is the most popular open source web server in use.
Software And Techniques
Memcache:
• Facebook makes heavy use of
Memcached,
• A memory caching system that is
used to speed up dynamic database
driven websites by caching data and
objects in RAM to reduce reading
time.
• Having a caching system allows
Facebook to be as fast as it is at
recalling your data.
• Doesn’t have to go to the database, it
will just fetch your data from the
cache based on your user ID.
Software And Techniques
Faceebook-Photos-Haystack:
• The Photos application is one of Facebook’s most popular features.
• Users have uploaded over 15 billion photos which make Facebook the
biggest photo sharing website.
• For each uploaded photo, Facebook generates and stores four images of
different sizes, which translates to a total of 60 billion images and
1.5PB of storage.
• The current growth rate is 220 million new photos per week, which
translates to 25TB of additional storage consumed weekly.
Haystack in facebook
• Haystack is Facebook’s high-performance photo storage/retrieval system.
• A highly scalable object store used to serve Facebook’s immense amount of
photos.
• Implements a HTTP based photo server which stores photos in a generic
object store called Haystack.
Software And Techniques
BigPipe:
Dynamic web page serving system, Facebook has developed.
• BigPipe is a fundamental redesign of the dynamic web page serving system.
• BigPipe breaks the page generation process into several stages
• The first three stages are executed by the web server, and the last four stages are
executed by the browser.
Questions?
Hope you enjoyed this presentation…

More Related Content

What's hot

The Dev-Admin Chimera: Customising Connections (with Gab Davis)
The Dev-Admin Chimera: Customising Connections (with Gab Davis)The Dev-Admin Chimera: Customising Connections (with Gab Davis)
The Dev-Admin Chimera: Customising Connections (with Gab Davis)Mark Myers
 
How Facebook actually works????
How Facebook actually works????How Facebook actually works????
How Facebook actually works????Dhruv Patel
 
Drupal is from Mars, Wordpress is from Venus: Finding your library's CMS soul...
Drupal is from Mars, Wordpress is from Venus: Finding your library's CMS soul...Drupal is from Mars, Wordpress is from Venus: Finding your library's CMS soul...
Drupal is from Mars, Wordpress is from Venus: Finding your library's CMS soul...sbclapp
 
Drupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon BarcelonaDrupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon Barcelonahernanibf
 
One Drupal to rule them all - Drupalcamp London
One Drupal to rule them all - Drupalcamp LondonOne Drupal to rule them all - Drupalcamp London
One Drupal to rule them all - Drupalcamp Londonhernanibf
 
My Site is slow - Drupal Camp London 2013
My Site is slow - Drupal Camp London 2013My Site is slow - Drupal Camp London 2013
My Site is slow - Drupal Camp London 2013hernanibf
 
Jive, dropbox and other integrations
Jive, dropbox and other integrationsJive, dropbox and other integrations
Jive, dropbox and other integrationsJared Ottley
 
My site is slow
My site is slowMy site is slow
My site is slowhernanibf
 
Oxford DrupalCamp 2012 - The things we found in your website
Oxford DrupalCamp 2012 - The things we found in your websiteOxford DrupalCamp 2012 - The things we found in your website
Oxford DrupalCamp 2012 - The things we found in your websitehernanibf
 
Drupal content editor flexibility
Drupal content editor flexibilityDrupal content editor flexibility
Drupal content editor flexibilityhernanibf
 
The things we found in your website
The things we found in your websiteThe things we found in your website
The things we found in your websitehernanibf
 
XPages: No Experience Needed
XPages: No Experience NeededXPages: No Experience Needed
XPages: No Experience NeededKathy Brown
 
Nyc hadoop meetup introduction to h base
Nyc hadoop meetup   introduction to h baseNyc hadoop meetup   introduction to h base
Nyc hadoop meetup introduction to h base智杰 付
 
Deployer - Deployment tool for PHP
Deployer - Deployment tool for PHPDeployer - Deployment tool for PHP
Deployer - Deployment tool for PHPhernanibf
 
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL databaseHBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL databaseEdureka!
 

What's hot (20)

The Dev-Admin Chimera: Customising Connections (with Gab Davis)
The Dev-Admin Chimera: Customising Connections (with Gab Davis)The Dev-Admin Chimera: Customising Connections (with Gab Davis)
The Dev-Admin Chimera: Customising Connections (with Gab Davis)
 
How Facebook actually works????
How Facebook actually works????How Facebook actually works????
How Facebook actually works????
 
Fb mechanism
Fb mechanismFb mechanism
Fb mechanism
 
Drupal is from Mars, Wordpress is from Venus: Finding your library's CMS soul...
Drupal is from Mars, Wordpress is from Venus: Finding your library's CMS soul...Drupal is from Mars, Wordpress is from Venus: Finding your library's CMS soul...
Drupal is from Mars, Wordpress is from Venus: Finding your library's CMS soul...
 
SubjectsPlus Manual in Compatible with XAMPP
SubjectsPlus Manual in Compatible with XAMPPSubjectsPlus Manual in Compatible with XAMPP
SubjectsPlus Manual in Compatible with XAMPP
 
Drupal and Libraries
Drupal and LibrariesDrupal and Libraries
Drupal and Libraries
 
Drupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon BarcelonaDrupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon Barcelona
 
One Drupal to rule them all - Drupalcamp London
One Drupal to rule them all - Drupalcamp LondonOne Drupal to rule them all - Drupalcamp London
One Drupal to rule them all - Drupalcamp London
 
My Site is slow - Drupal Camp London 2013
My Site is slow - Drupal Camp London 2013My Site is slow - Drupal Camp London 2013
My Site is slow - Drupal Camp London 2013
 
Jive, dropbox and other integrations
Jive, dropbox and other integrationsJive, dropbox and other integrations
Jive, dropbox and other integrations
 
My site is slow
My site is slowMy site is slow
My site is slow
 
Oxford DrupalCamp 2012 - The things we found in your website
Oxford DrupalCamp 2012 - The things we found in your websiteOxford DrupalCamp 2012 - The things we found in your website
Oxford DrupalCamp 2012 - The things we found in your website
 
EPUB NOW AND FUTURE
EPUB NOW AND FUTUREEPUB NOW AND FUTURE
EPUB NOW AND FUTURE
 
Drupal content editor flexibility
Drupal content editor flexibilityDrupal content editor flexibility
Drupal content editor flexibility
 
The things we found in your website
The things we found in your websiteThe things we found in your website
The things we found in your website
 
XPages: No Experience Needed
XPages: No Experience NeededXPages: No Experience Needed
XPages: No Experience Needed
 
Open Source CMS
Open Source CMSOpen Source CMS
Open Source CMS
 
Nyc hadoop meetup introduction to h base
Nyc hadoop meetup   introduction to h baseNyc hadoop meetup   introduction to h base
Nyc hadoop meetup introduction to h base
 
Deployer - Deployment tool for PHP
Deployer - Deployment tool for PHPDeployer - Deployment tool for PHP
Deployer - Deployment tool for PHP
 
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL databaseHBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
 

Similar to Facebook's Nuts and Bolts - The Technologies Behind the World's Largest Social Network

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 systemsAhmad Yar
 
OVERVIEW OF FACEBOOK SCALABLE ARCHITECTURE.
OVERVIEW  OF FACEBOOK SCALABLE ARCHITECTURE.OVERVIEW  OF FACEBOOK SCALABLE ARCHITECTURE.
OVERVIEW OF FACEBOOK SCALABLE ARCHITECTURE.Rishikese MR
 
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 approachPrakhar Gethe
 
Data infrastructure at Facebook
Data infrastructure at Facebook Data infrastructure at Facebook
Data infrastructure at Facebook AhmedDoukh
 
Facebook Technology Stack
Facebook Technology StackFacebook Technology Stack
Facebook Technology StackHusain Ali
 
Architecture Patterns - Open Discussion
Architecture Patterns - Open DiscussionArchitecture Patterns - Open Discussion
Architecture Patterns - Open DiscussionNguyen Tung
 
After the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEANAfter the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEANJeff Fox
 
Presentation 1 Web--dev
Presentation 1 Web--devPresentation 1 Web--dev
Presentation 1 Web--devaltsav
 
Online Fitness Gym Documentation
Online Fitness Gym Documentation Online Fitness Gym Documentation
Online Fitness Gym Documentation Abhishek Patel
 
facebook architecture for 600M users
facebook architecture for 600M usersfacebook architecture for 600M users
facebook architecture for 600M usersJongyoon Choi
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar litbbsr
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar litbbsr
 
CONTENT MANAGEMENT SYSTEM
CONTENT MANAGEMENT SYSTEMCONTENT MANAGEMENT SYSTEM
CONTENT MANAGEMENT SYSTEMANAND PRAKASH
 
Full Stack Web Development
Full Stack Web DevelopmentFull Stack Web Development
Full Stack Web DevelopmentSWAGATHCHOWDARY1
 
Hadoop at Yahoo! -- University Talks
Hadoop at Yahoo! -- University TalksHadoop at Yahoo! -- University Talks
Hadoop at Yahoo! -- University Talksyhadoop
 

Similar to Facebook's Nuts and Bolts - The Technologies Behind the World's Largest Social Network (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
 
Data infrastructure at Facebook
Data infrastructure at Facebook Data infrastructure at Facebook
Data infrastructure at Facebook
 
Facebook Technology Stack
Facebook Technology StackFacebook Technology Stack
Facebook Technology Stack
 
Architecture Patterns - Open Discussion
Architecture Patterns - Open DiscussionArchitecture Patterns - Open Discussion
Architecture Patterns - Open Discussion
 
lamp.pptx
lamp.pptxlamp.pptx
lamp.pptx
 
After the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEANAfter the LAMP, it's time to get MEAN
After the LAMP, it's time to get MEAN
 
Presentation 1 Web--dev
Presentation 1 Web--devPresentation 1 Web--dev
Presentation 1 Web--dev
 
Online Fitness Gym Documentation
Online Fitness Gym Documentation Online Fitness Gym Documentation
Online Fitness Gym Documentation
 
facebook architecture for 600M users
facebook architecture for 600M usersfacebook architecture for 600M users
facebook architecture for 600M users
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar
 
1_Intro_toHTML.ppt
1_Intro_toHTML.ppt1_Intro_toHTML.ppt
1_Intro_toHTML.ppt
 
Open source: Making connections by Sunny Pai
Open source: Making connections by Sunny PaiOpen source: Making connections by Sunny Pai
Open source: Making connections by Sunny Pai
 
CONTENT MANAGEMENT SYSTEM
CONTENT MANAGEMENT SYSTEMCONTENT MANAGEMENT SYSTEM
CONTENT MANAGEMENT SYSTEM
 
FAT.Seminar.FOSS_Joomla!
FAT.Seminar.FOSS_Joomla!FAT.Seminar.FOSS_Joomla!
FAT.Seminar.FOSS_Joomla!
 
Facebook thrift
Facebook thriftFacebook thrift
Facebook thrift
 
Full Stack Web Development
Full Stack Web DevelopmentFull Stack Web Development
Full Stack Web Development
 
Hadoop at Yahoo! -- University Talks
Hadoop at Yahoo! -- University TalksHadoop at Yahoo! -- University Talks
Hadoop at Yahoo! -- University Talks
 

Recently uploaded

Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 

Recently uploaded (20)

Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 

Facebook's Nuts and Bolts - The Technologies Behind the World's Largest Social Network

  • 1. DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING MADANAPALLE INSTITUTE OF TECHNOLOGY AND SCIENCE (UGC-AUTONOMOUS) A Seminar Presentation On FACEBOOK [The Nuts and Bolts – Technology] By M.Koushik reddy 12691A0546 Under the guidance N.Sudhakar Yadav M.Tech Asst.professor
  • 2. Contents • Introduction • Languages • Databases • Software's and technology
  • 3. So what's all the Hype? What exactly is Facebook®? • Facebook® is a “social networking website” • Facebook® is a free service that allows you to create an online page to connect with friends, family, or make new friends with anyone anywhere. • On your Facebook® page you can share pictures, personal information , messages, videos , join groups and add applications.
  • 4. Introduction • Here are a few factoids to give you an idea of the scaling challenge that Facebook has to deal with: • Facebook serves 570 billion page views per month (according to Google Ad Planner). • There are more photos on Facebook than all other photo sites combined (including sites like Flickr). • More than 3 billion photos are uploaded every month. • Facebook’s systems serve 1.2 million photos per second. • More than 25 billion pieces of content (status updates, comments, etc) are shared every month. • Facebook has more than 30,000 servers (and this number is from last year!)
  • 5. Languages: Front End: (client side) - Java script Back End: (server side) - Hack, PHP (HHVM) - C++,Java - Python,Erlang - D,XHP and - Haskell
  • 6. •Java script: (Front End) It is a high-level, dynamic, un typed, and interpreted programming language - It is supported by all modern web browsers without plug-ins • . Sample code: FB.getLoginStatus(function(response) { if (response.status === 'connected') { console.log('Logged in.'); } else { FB.login(); } })
  • 7. Back End:(Server side) Hack: Hack is a programming language for the Hip-hop Virtual Machine (HHVM), created by face book as a dialect of PHP. • It is open-source, licensed under the BSD License • Hack allows programmers to use both dynamic typing and static typing. • Introduced on march 20,2014 Sample code: <?hh echo 'Hello World'; • An important point : Unlike PHP, Hack and HTML code do not mix. Normally you can mix PHP and HTML code together in the same file.
  • 8. PHP VS HACK • They are both PHP, both run on apache • Hack tries to implement more functionality and features to PHP and helps to clean up some of the inconsistencies
  • 9. Back End:(Server side) Erlang: It is a general purpose, concurrent, garbage collected programming language and runtime system. • It was originally designed by Ericsson . • It supports hot swapping, thus code can be changed without stopping a system. • It provides language-level features for creating and managing processes with the aim of simplifying concurrent programming. • All concurrency is explicit in Erlang, processes communicate using message passing instead of shared variables, which removes the need for explicit locks.
  • 10. Back End:(Server side) Continue… Sample code: An Erlang function that uses recursion to count to ten -module(count_to_ten). -export([count_to_ten/0]). count_to_ten() -> do_count(0). do_count(10) -> 10; do_count(Value) -> do_count(Value + 1).
  • 11. Back End:(Server side) Erlang in facebook..?? It is used mainly in facebook chat.
  • 12. Back End:(Server side) Continue… System overview :User Interface-Chat in the browser:
  • 13. Back End:(Server side) Continue… System overview :User Interface-Chat in the browser: • Channel (Erlang): message queuing and delivery . Queue messages in each user’s “channel” Deliver messages as responses to long-polling HTTP requests • Presence (C++): aggregates online info in memory (pull-based presence) • Chatlogger (C++): stores conversations between page loads • Web tier (PHP): serves our vanilla web requests
  • 14. Back End:(Server side) Haskell: Haskell is a standardized, general-purpose purely functional programming language, with non-strict semantics and strong static typing. Sample code: ”Hello world program “ module Main where main :: IO () main = putStrLn "Hello, World!"
  • 15. Back End:(Server side) Haskell in facebook…?? Fighting spam with Haskell: Sigma: One of the weapons in the fight against spam, malware, and other abuse on Facebook is a system called Sigma. • Its job is to proactively identify malicious actions on Facebook, such as spam, phishing attacks, posting links to malware, etc. • Bad content detected by Sigma is removed automatically so that it doesn't show up in your News Feed. • Sigma is a rule engine, which means it runs a set of rules, called policies. • These policies make it possible for us to identify and block malicious interactions before they affect people on Facebook.
  • 16. Back End:(Server side) • Continue… Why Haskell in sigma…?? • It was replaced by the FXL(Feature eXtraction Language) with Haskell. Reasons for replacements: 1. Purely functional and strongly typed. 2. Push code changes to production in minutes. 3. Performance. 4. Support for interactive development.
  • 17. Database What database actually Facebook uses..? • A billion of people are using FACEBOOK, storing every transaction for 800 million users and handling more than 60 million queries per second • Interacting with their peer and friends through wall posts, uploading their photos, passing information’s about events and other meaningful information . • Facebook uses several database techniques. Databases used in facebook: • MySql • HBase • Cassandra
  • 18. Databases MYSQL: Facebook primarily uses MYSQL for structured data storage such as wall posts, user information, timeline etc. • This data is replicated between their various data centers.
  • 20. Database HBase: Is an open source, non-relational, distributed database modeled written in Java. • It is developed as part of Apache Software Foundation's Apache Hadoop project • Runs on top of HDFS (Hadoop Distributed File system), providing BigTable-like capabilities for Hadoop. • Hbase is now serving several data-driven websites, including Facebook's Messaging Platform
  • 21. Hbase Architecture: • In HBase, tables are split into regions and are served by the region servers. • Regions are vertically divided by column families into “Stores”. • Stores are saved as files in HDFS.
  • 22. Continue… The Master Server - Assigns regions to the region servers and takes the help of Apache ZooKeeper for this task. • Handles load balancing of the regions across region servers. It unloads the busy servers and shifts the regions to less occupied servers. • Is responsible for operations such as creation of tables and column families. Regions- Regions are nothing but tables that are split up and spread across the region servers. Zookeeper- Zookeeper is an open-source project that provides services like maintaining configuration information, naming, providing distributed synchronization, etc. • Clients communicate with region servers via zookeeper.
  • 23. HBase in facebook Messaging Messaging Data: • Small/Medium sized data—Hbase • Search index • Small message bodies o Attachments and Large messages– Haystack • Used for our exesting photo/video store
  • 25. Continue…. Write Path in HBase: •In Hbase, the messages are stored in the file(Hfiles), the messages are directly appended in the HDFS Read path: •Simillarly messages can be read directly from the Hfiles
  • 26. Software And Techniques The Front End: • Linux & Apache • Memcache • Haystack • Bigpipe The Back End: • Thrift (protocol) • Scribe (log server) • HipHop for PHP
  • 27. Software And Techniques The Front End: Linux & Apache: Linux is a Unix-like computer operating system kernel. • It’s open source, very customizable, and good for security. • Facebook runs the Linux operating system on Apache HTTP Servers. • Apache is also free and is the most popular open source web server in use.
  • 28. Software And Techniques Memcache: • Facebook makes heavy use of Memcached, • A memory caching system that is used to speed up dynamic database driven websites by caching data and objects in RAM to reduce reading time. • Having a caching system allows Facebook to be as fast as it is at recalling your data. • Doesn’t have to go to the database, it will just fetch your data from the cache based on your user ID.
  • 29. Software And Techniques Faceebook-Photos-Haystack: • The Photos application is one of Facebook’s most popular features. • Users have uploaded over 15 billion photos which make Facebook the biggest photo sharing website. • For each uploaded photo, Facebook generates and stores four images of different sizes, which translates to a total of 60 billion images and 1.5PB of storage. • The current growth rate is 220 million new photos per week, which translates to 25TB of additional storage consumed weekly.
  • 30. Haystack in facebook • Haystack is Facebook’s high-performance photo storage/retrieval system. • A highly scalable object store used to serve Facebook’s immense amount of photos. • Implements a HTTP based photo server which stores photos in a generic object store called Haystack.
  • 31. Software And Techniques BigPipe: Dynamic web page serving system, Facebook has developed. • BigPipe is a fundamental redesign of the dynamic web page serving system. • BigPipe breaks the page generation process into several stages • The first three stages are executed by the web server, and the last four stages are executed by the browser.
  • 32. Questions? Hope you enjoyed this presentation…