SlideShare uma empresa Scribd logo
1 de 27
FACEBOOK THRIFT
 Facebook is the “social networking “ People have been
“facebooking” each other for about 7 years now, making
Facebook the most used social network with over 500 million
users worldwide.50% of our active users log on to Facebook in
any given day Average user has 130 friends .People spend over
700 billion minutes per month on Facebook.There are over
900 million objects that people interact with (pages, groups,
events and community pages).
INTRODUCTION
 Thrift is an interface definition language and binary
communication protocol
 It is used as a remote procedure call (RPC) framework and was
developed at Facebook for "scalable cross-language services
development".
 It combines a software stack with a code generation engine to
build services that work efficiently on
C#, C++ , Java, Perl, PHP, Python, Ruby and Smalltalk.
 it is now an open source project in the Apache Software
Foundation, now hosted on Apache.
THRIFT
 Scribe (log server) is a server for aggregating log data
streamed in real-time from many other servers. Useful for
logging a wide array of data. It is built on top of Thrift.
 Cassandra is a database management system designed to
handle large amounts of data spread out across many servers.
It powers Facebook’s Inbox Search feature and provides a
structured key-value store with eventual consistency.
 HipHop for PHP is a source code transformer for PHP script
code and was created to save server resources. HipHop
transforms PHP source code into optimized C++. After doing
this, it uses g++ to compile it to machine code.
The Back End
 The primary idea behind Thrift is that it consists of a language
neutral stack which is implemented across various programming
languages and an associated code generation engine which
transforms a simple interface and data definition language into
client and server remote procedure call libraries.
 Thrift is designed to be as simple as possible for the developers
who can define all the necessary data structures and interfaces
for a complex service in a single short file.
 This file is called as Thrift Interface Definition Logic File or Thrift
IDL File.
 The developers identified some important features while
evaluating the technical challenges of cross language interactions
in a networked environment.
Thrift Design Features
 Transport:
Each language must have a common interface to bidirectional raw
data transport. Consider a scenario where there are 2 servers in which, one
is deployed in Java and the other one is deployed in Python. So a typical
service written in Java should be able to send the raw data from that service
to a common interface which will be understood by the other server which
is running on Python and vice-versa. The Transport Layer should be able to
transport the raw data file across the two ends. The specifics about how this
transport is implemented shouldn’t matter to the service developer. The
same application code should be able to run against TCP Stream Sockets,
raw data in memory or files on disk.
 Protocol:
In order to transport the raw data, they have to be encoded into a
particular format like binary, XML etc. Therefore the Transport Layer uses
some particular protocol to encode or decode the data. Again the
application developer will not be bothered about this. He is only worried
whether the data can be read or written in some deterministic manner.
Types
 Versioning:
For the services to be robust they must evolve from their
present version. They should incorporate new features and in
order to do this the data types involved in the service should
provide a mechanism to add or delete fields of an object or alter
the arguments list of a function without any interruption in
service. This is called Versioning.
 Processors:
Processors are the ones which process the data streams
and accomplish Remote Procedure Calls.
Cont..
 Thrift has been employed in a large number of applications at
Facebook, including search, logging, mobile, ads and the
developer platform. Two specific usages are discussed below.
 Search
 logging
Facebook Thrift Services
Facebook serves 570 billion page views per month
There are more photos on Facebook than all other photo sites
combined
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!)
Facebook’s scaling challenge
 Linux & Apache
 PHP
 Memcache
 Haystack
 BigPipe
How Does Facebook Work?
There are more than 20 billion uploaded photos on Facebook, and
each one is saved in four different resolutions, resulting in more
than 80 billion photos.
And it’s not just about being able to handle billions of photos,
performance is critical. Facebook serves around 1.2 million
photos per second.
 Haystack is Facebook’s high-performance photo storage/retrieval
system, a highly scalable object store used to serve Facebook’s
immense amount of photos.
Strictly speaking, Haystack is an object store, so it doesn’t
necessarily have to store photos.
Haystack stores photo data inside 10 GB bucket with 1 MB of
metadata for every GB stored.
Haystack
 Pipelining web pages for high performance
 BigPipe -dynamic web page serving system, Facebook has
developed.
 Facebook uses it to serve each web page in sections (called
“pagelets”) for optimal performance.
 BigPipe is a fundamental redesign of the dynamic web page
serving system. The general idea is to pipeline pagelets through
several execution stages inside web servers and browsers.
 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.
BIGPIPE
 Free & open source, high-performance, distributed
memory object caching system
 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.
 The system uses a client–server architecture. the clients
populate this array and query it.
 The servers keep the values in RAM; if a server runs out of
RAM, it discards the oldest values.
 Clients can read each other's cached data.
MEMCACHE
 Facebook has a system, Gatekeeper that lets run different
code for different sets of users.
 This lets Facebook do gradual releases of new features,
activate certain features only for Facebook employees, etc.
 Gatekeeper also lets Facebook do something called “dark
launches”, which is to activate elements of a certain
feature behind the scenes before it goes live
Gradual releases and dark launches
 The Facebook Platform provides a set of APIs and tools
which enable 3rd party developers to integrate with the
"open graph“.
 Graph API is the core of Facebook Platform, enabling
developers to read and write data to Facebook
Facebook Platform
 The Graph API presents a simple, consistent view of the
Facebook social graph, uniformly representing objects in the
graph (e.g.,people, photos, events, and pages) and the
connections between them (e.g., friend relationships,
shared content, and photo tags).
 Restful API for accessing data on the Facebook graph.
 Every object in the social graph has a unique ID. You can
access the properties of an object by requesting -
https://graph.facebook.com/ID
 Alternatively, people and pages with usernames can be
accessed using their username as an ID. All responses are
JSON objects.
The Graph API
 FBML is a variant-evolved subset of HTML with some elements
removed.
 It allows Facebook Application developers to customize the "look
and feel" of their applications, to a limited extent.
 It is the specification of how to encode content so that
Facebook's servers can read and publish it.
 FBML plays an important role in building applications. FBML is used
to tap in to various Facebook elements when building applications.
 It operates a lot like HTML and it gives the ability to do various tasks
with ease such as:
sending a user e-mail
embedding flash video
creating a dashboard
posting on a wall
Facebook Markup Language
 Facebook also allows the use of regular HTML tags, such as <a
href=”#”></a>, which is used to generate a hyperlink. Facebook also allows
the use of many more HTML tags for building applications
FBML
 The new Messages interweaves your chats, texts and emails.
It’s a central place to control all of your private
communication, both on and off Facebook.
 Simply put, it can be a single inbox for all of your messages,
no matter how you choose to send them.
 A facebook.com Email Address
 SMS From Facebook
 Chat History
Facebook’s New Messages
 Facebook Connect is a set of APIs from Facebook that enable
Facebook members to log onto third-party websites,
applications, mobile devices and gaming systems with their
Facebook identity.
Facebook Connect
 Unlike other social networks like Friendster, MySpace,
and Twitter – all of whom have run into serious scalability issues
at different points during their growth. Facebook has been mostly
reliable throughout its rise.
 In actuality, Facebook uses JavaScript heavily, relies on their own
in-house PHP wrapper called XHP, HipHop (which optimizes
PHP), and many more technologies.
 A lot of technologies have been developed by Facebook in-house
to serve their own needs, for example Cassandra
RELIABILITY
 Thrift generates both the server and client interfaces for a given
service, and in a consistent manner. Client calls will be more
consistent
 Related to above: Thrift's RPC-like behavior means that you get
type safety
 Thrift supports various protocols, not just HTTP. If you are
dealing with large volumes of service calls, or have bandwidth
requirements, the client/server can transparently switch to more
efficient transports
 Thrift is a mature piece of software; well tested and used.
Advantages of Thrift:
 Thrift is poorly documented.
 It is more work to get started on the client side, when the
clients are directly building the calling code. It's less work for
the service owner if they are building libraries for clientsYet
another dependency.
Disadvantages:
Facebook thrift

Mais conteúdo relacionado

Mais procurados

Presentation on Android application
Presentation on Android applicationPresentation on Android application
Presentation on Android application
Atibur Rahman
 

Mais procurados (20)

Blackberry Technology ppt
Blackberry Technology pptBlackberry Technology ppt
Blackberry Technology ppt
 
Mind reading computer ppt
Mind reading computer pptMind reading computer ppt
Mind reading computer ppt
 
Presentation on Android application
Presentation on Android applicationPresentation on Android application
Presentation on Android application
 
Chat application with Azure SignalR Service
Chat application with Azure SignalR ServiceChat application with Azure SignalR Service
Chat application with Azure SignalR Service
 
Android studio ppt
Android studio pptAndroid studio ppt
Android studio ppt
 
The sixth sense technology complete ppt
The sixth sense technology complete pptThe sixth sense technology complete ppt
The sixth sense technology complete ppt
 
Chapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B KuteChapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B Kute
 
Augmented reality ppt
Augmented reality pptAugmented reality ppt
Augmented reality ppt
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Mobile Application Development With Android
Mobile Application Development With AndroidMobile Application Development With Android
Mobile Application Development With Android
 
Xbox360
Xbox360Xbox360
Xbox360
 
java script json
java script jsonjava script json
java script json
 
Mobile application development ppt
Mobile application development pptMobile application development ppt
Mobile application development ppt
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
 
Technical seminar on virtual smart phone
Technical seminar on virtual smart phoneTechnical seminar on virtual smart phone
Technical seminar on virtual smart phone
 
Web Development
Web DevelopmentWeb Development
Web Development
 
Android Web app
Android Web app Android Web app
Android Web app
 
screen-less displays
screen-less displays screen-less displays
screen-less displays
 
Voice morphing-
Voice morphing-Voice morphing-
Voice morphing-
 
The Full Stack Web Development
The Full Stack Web DevelopmentThe Full Stack Web Development
The Full Stack Web Development
 

Destaque

Introduction to Thrift
Introduction to ThriftIntroduction to Thrift
Introduction to Thrift
Dvir Volk
 
Best topics for seminar
Best topics for seminarBest topics for seminar
Best topics for seminar
shilpi nagpal
 
Facebook Powerpoint
Facebook PowerpointFacebook Powerpoint
Facebook Powerpoint
myra14
 

Destaque (20)

Introduction to Thrift
Introduction to ThriftIntroduction to Thrift
Introduction to Thrift
 
Best topics for seminar
Best topics for seminarBest topics for seminar
Best topics for seminar
 
Apache Thrift, a brief introduction
Apache Thrift, a brief introductionApache Thrift, a brief introduction
Apache Thrift, a brief introduction
 
Apache thrift-RPC service cross languages
Apache thrift-RPC service cross languagesApache thrift-RPC service cross languages
Apache thrift-RPC service cross languages
 
Apache Thrift : One Stop Solution for Cross Language Communication
Apache Thrift : One Stop Solution for Cross Language CommunicationApache Thrift : One Stop Solution for Cross Language Communication
Apache Thrift : One Stop Solution for Cross Language Communication
 
An introduction to Apache Thrift
An introduction to Apache ThriftAn introduction to Apache Thrift
An introduction to Apache Thrift
 
Thrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased ComparisonThrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased Comparison
 
3D-Doctor
3D-Doctor3D-Doctor
3D-Doctor
 
Eye phone
Eye phoneEye phone
Eye phone
 
captcha.ppt
 captcha.ppt captcha.ppt
captcha.ppt
 
Digital jewellery
Digital jewelleryDigital jewellery
Digital jewellery
 
Computer science seminar topics
Computer science seminar topicsComputer science seminar topics
Computer science seminar topics
 
Blue Brain
Blue Brain Blue Brain
Blue Brain
 
Ethical hacking presentation
Ethical hacking presentationEthical hacking presentation
Ethical hacking presentation
 
Gi-Fi ppt presentation
Gi-Fi ppt presentationGi-Fi ppt presentation
Gi-Fi ppt presentation
 
Facebook Powerpoint
Facebook PowerpointFacebook Powerpoint
Facebook Powerpoint
 
Facebook architecture
Facebook architectureFacebook architecture
Facebook architecture
 
3 apache-avro
3 apache-avro3 apache-avro
3 apache-avro
 
EmoSpark
EmoSparkEmoSpark
EmoSpark
 
Ppt on Google glass
Ppt on Google glassPpt on Google glass
Ppt on Google glass
 

Semelhante a Facebook thrift

facebookthrift-151001153400-lva1-app6891.pptx
facebookthrift-151001153400-lva1-app6891.pptxfacebookthrift-151001153400-lva1-app6891.pptx
facebookthrift-151001153400-lva1-app6891.pptx
PrasannaKumarpanda2
 
Facebook Technology Stack
Facebook Technology StackFacebook Technology Stack
Facebook Technology Stack
Husain Ali
 
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
 
Sup (Semantic User Profiling)
Sup (Semantic User Profiling)Sup (Semantic User Profiling)
Sup (Semantic User Profiling)
Emanuela Boroș
 
SMARCOS CNR Paper Mashups
SMARCOS CNR  Paper MashupsSMARCOS CNR  Paper Mashups
SMARCOS CNR Paper Mashups
Smarcos Eu
 

Semelhante a Facebook thrift (20)

facebookthrift-151001153400-lva1-app6891.pptx
facebookthrift-151001153400-lva1-app6891.pptxfacebookthrift-151001153400-lva1-app6891.pptx
facebookthrift-151001153400-lva1-app6891.pptx
 
Facebook Technology Stack
Facebook Technology StackFacebook Technology Stack
Facebook Technology Stack
 
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
 
Facebook Messenger Platform Framework
Facebook Messenger Platform FrameworkFacebook Messenger Platform Framework
Facebook Messenger Platform Framework
 
Api
ApiApi
Api
 
TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING
TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING
TECHNOLOGY FOR BACK-END WEB DEVELOPMENT: SERVER-SIDE SCRIPTING
 
Architecture of Facebook
Architecture of FacebookArchitecture of Facebook
Architecture of Facebook
 
Sup (Semantic User Profiling)
Sup (Semantic User Profiling)Sup (Semantic User Profiling)
Sup (Semantic User Profiling)
 
Flex Framework Presentation PPT
Flex Framework Presentation PPTFlex Framework Presentation PPT
Flex Framework Presentation PPT
 
Mashups
MashupsMashups
Mashups
 
Which Backend Is Best For Flutter.pdf
Which Backend Is Best For Flutter.pdfWhich Backend Is Best For Flutter.pdf
Which Backend Is Best For Flutter.pdf
 
SMARCOS CNR Paper Mashups
SMARCOS CNR  Paper MashupsSMARCOS CNR  Paper Mashups
SMARCOS CNR Paper Mashups
 
Flex Remoting With WebORB v1.0
Flex Remoting With WebORB v1.0Flex Remoting With WebORB v1.0
Flex Remoting With WebORB v1.0
 
074Aman.pptx
074Aman.pptx074Aman.pptx
074Aman.pptx
 
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
 
SERVER SIDE SCRIPTING
SERVER SIDE SCRIPTINGSERVER SIDE SCRIPTING
SERVER SIDE SCRIPTING
 
A Survey on Various Web Technologies
A Survey on Various Web TechnologiesA Survey on Various Web Technologies
A Survey on Various Web Technologies
 
Php
PhpPhp
Php
 
Flutter for Web - A Comprehensive Outline.pdf
Flutter for Web - A Comprehensive Outline.pdfFlutter for Web - A Comprehensive Outline.pdf
Flutter for Web - A Comprehensive Outline.pdf
 
Online job portal management system..pdf
Online job portal management system..pdfOnline job portal management system..pdf
Online job portal management system..pdf
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
[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
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
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...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 

Facebook thrift

  • 2.  Facebook is the “social networking “ People have been “facebooking” each other for about 7 years now, making Facebook the most used social network with over 500 million users worldwide.50% of our active users log on to Facebook in any given day Average user has 130 friends .People spend over 700 billion minutes per month on Facebook.There are over 900 million objects that people interact with (pages, groups, events and community pages). INTRODUCTION
  • 3.  Thrift is an interface definition language and binary communication protocol  It is used as a remote procedure call (RPC) framework and was developed at Facebook for "scalable cross-language services development".  It combines a software stack with a code generation engine to build services that work efficiently on C#, C++ , Java, Perl, PHP, Python, Ruby and Smalltalk.  it is now an open source project in the Apache Software Foundation, now hosted on Apache. THRIFT
  • 4.  Scribe (log server) is a server for aggregating log data streamed in real-time from many other servers. Useful for logging a wide array of data. It is built on top of Thrift.  Cassandra is a database management system designed to handle large amounts of data spread out across many servers. It powers Facebook’s Inbox Search feature and provides a structured key-value store with eventual consistency.  HipHop for PHP is a source code transformer for PHP script code and was created to save server resources. HipHop transforms PHP source code into optimized C++. After doing this, it uses g++ to compile it to machine code. The Back End
  • 5.
  • 6.  The primary idea behind Thrift is that it consists of a language neutral stack which is implemented across various programming languages and an associated code generation engine which transforms a simple interface and data definition language into client and server remote procedure call libraries.  Thrift is designed to be as simple as possible for the developers who can define all the necessary data structures and interfaces for a complex service in a single short file.  This file is called as Thrift Interface Definition Logic File or Thrift IDL File.  The developers identified some important features while evaluating the technical challenges of cross language interactions in a networked environment. Thrift Design Features
  • 7.
  • 8.  Transport: Each language must have a common interface to bidirectional raw data transport. Consider a scenario where there are 2 servers in which, one is deployed in Java and the other one is deployed in Python. So a typical service written in Java should be able to send the raw data from that service to a common interface which will be understood by the other server which is running on Python and vice-versa. The Transport Layer should be able to transport the raw data file across the two ends. The specifics about how this transport is implemented shouldn’t matter to the service developer. The same application code should be able to run against TCP Stream Sockets, raw data in memory or files on disk.  Protocol: In order to transport the raw data, they have to be encoded into a particular format like binary, XML etc. Therefore the Transport Layer uses some particular protocol to encode or decode the data. Again the application developer will not be bothered about this. He is only worried whether the data can be read or written in some deterministic manner. Types
  • 9.  Versioning: For the services to be robust they must evolve from their present version. They should incorporate new features and in order to do this the data types involved in the service should provide a mechanism to add or delete fields of an object or alter the arguments list of a function without any interruption in service. This is called Versioning.  Processors: Processors are the ones which process the data streams and accomplish Remote Procedure Calls. Cont..
  • 10.  Thrift has been employed in a large number of applications at Facebook, including search, logging, mobile, ads and the developer platform. Two specific usages are discussed below.  Search  logging Facebook Thrift Services
  • 11. Facebook serves 570 billion page views per month There are more photos on Facebook than all other photo sites combined 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!) Facebook’s scaling challenge
  • 12.  Linux & Apache  PHP  Memcache  Haystack  BigPipe How Does Facebook Work?
  • 13. There are more than 20 billion uploaded photos on Facebook, and each one is saved in four different resolutions, resulting in more than 80 billion photos. And it’s not just about being able to handle billions of photos, performance is critical. Facebook serves around 1.2 million photos per second.  Haystack is Facebook’s high-performance photo storage/retrieval system, a highly scalable object store used to serve Facebook’s immense amount of photos. Strictly speaking, Haystack is an object store, so it doesn’t necessarily have to store photos. Haystack stores photo data inside 10 GB bucket with 1 MB of metadata for every GB stored. Haystack
  • 14.  Pipelining web pages for high performance  BigPipe -dynamic web page serving system, Facebook has developed.  Facebook uses it to serve each web page in sections (called “pagelets”) for optimal performance.  BigPipe is a fundamental redesign of the dynamic web page serving system. The general idea is to pipeline pagelets through several execution stages inside web servers and browsers.  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. BIGPIPE
  • 15.
  • 16.  Free & open source, high-performance, distributed memory object caching system  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.  The system uses a client–server architecture. the clients populate this array and query it.  The servers keep the values in RAM; if a server runs out of RAM, it discards the oldest values.  Clients can read each other's cached data. MEMCACHE
  • 17.  Facebook has a system, Gatekeeper that lets run different code for different sets of users.  This lets Facebook do gradual releases of new features, activate certain features only for Facebook employees, etc.  Gatekeeper also lets Facebook do something called “dark launches”, which is to activate elements of a certain feature behind the scenes before it goes live Gradual releases and dark launches
  • 18.  The Facebook Platform provides a set of APIs and tools which enable 3rd party developers to integrate with the "open graph“.  Graph API is the core of Facebook Platform, enabling developers to read and write data to Facebook Facebook Platform
  • 19.  The Graph API presents a simple, consistent view of the Facebook social graph, uniformly representing objects in the graph (e.g.,people, photos, events, and pages) and the connections between them (e.g., friend relationships, shared content, and photo tags).  Restful API for accessing data on the Facebook graph.  Every object in the social graph has a unique ID. You can access the properties of an object by requesting - https://graph.facebook.com/ID  Alternatively, people and pages with usernames can be accessed using their username as an ID. All responses are JSON objects. The Graph API
  • 20.  FBML is a variant-evolved subset of HTML with some elements removed.  It allows Facebook Application developers to customize the "look and feel" of their applications, to a limited extent.  It is the specification of how to encode content so that Facebook's servers can read and publish it.  FBML plays an important role in building applications. FBML is used to tap in to various Facebook elements when building applications.  It operates a lot like HTML and it gives the ability to do various tasks with ease such as: sending a user e-mail embedding flash video creating a dashboard posting on a wall Facebook Markup Language
  • 21.  Facebook also allows the use of regular HTML tags, such as <a href=”#”></a>, which is used to generate a hyperlink. Facebook also allows the use of many more HTML tags for building applications FBML
  • 22.  The new Messages interweaves your chats, texts and emails. It’s a central place to control all of your private communication, both on and off Facebook.  Simply put, it can be a single inbox for all of your messages, no matter how you choose to send them.  A facebook.com Email Address  SMS From Facebook  Chat History Facebook’s New Messages
  • 23.  Facebook Connect is a set of APIs from Facebook that enable Facebook members to log onto third-party websites, applications, mobile devices and gaming systems with their Facebook identity. Facebook Connect
  • 24.  Unlike other social networks like Friendster, MySpace, and Twitter – all of whom have run into serious scalability issues at different points during their growth. Facebook has been mostly reliable throughout its rise.  In actuality, Facebook uses JavaScript heavily, relies on their own in-house PHP wrapper called XHP, HipHop (which optimizes PHP), and many more technologies.  A lot of technologies have been developed by Facebook in-house to serve their own needs, for example Cassandra RELIABILITY
  • 25.  Thrift generates both the server and client interfaces for a given service, and in a consistent manner. Client calls will be more consistent  Related to above: Thrift's RPC-like behavior means that you get type safety  Thrift supports various protocols, not just HTTP. If you are dealing with large volumes of service calls, or have bandwidth requirements, the client/server can transparently switch to more efficient transports  Thrift is a mature piece of software; well tested and used. Advantages of Thrift:
  • 26.  Thrift is poorly documented.  It is more work to get started on the client side, when the clients are directly building the calling code. It's less work for the service owner if they are building libraries for clientsYet another dependency. Disadvantages: