The Architecture of the Facebook Platform                                 INAM SOOMRO & OLGUN CAKABEYINTRODUCTIONFacebook ...
data, such as flow of the information and access patterns, News Feed contents and searchimplementation, privacy and visibi...
session specific to user’s application through an assigned “API key”, “User Session Key” and a“request signature”. Web Ser...
To create an application on facebook, first option is configurating an external application      with small changes, addin...
Upcoming SlideShare
Loading in …5

Face book platform architecture


Published on

Published in: Education, Technology
  • Be the first to comment

  • Be the first to like this

Face book platform architecture

  1. 1. The Architecture of the Facebook Platform INAM SOOMRO & OLGUN CAKABEYINTRODUCTIONFacebook has become one of the most important social networking sites around the globe for almostpeople of all ages. In addition to provide its own services and features and contents to its users,Facebook also allows the developers and other communities to extend their social services andapproaches. Social networking focuses on linking and making online communication between friendswho share their thoughts and activities and who are willing to know the activities and interests ofother friends. A social platform goes further than that, it lets developer and other communities tocreate external applications and it gives a chance to Facebook user to interact with each other indifferent ways and on different applications. Behind Facebook’s complex technology there arehundreds of millions of real people with real relationships. They want to communicate in differentways and want to search for new friends, join different interested groups and share information.In May 2007, user involvement on Facebook grasped new peaks with the introduction of FacebookPlatform. Facebook Platform’s release brings fresh ideas and immense interest to not only the usersof Facebook, but to the industry as a whole.Facebook PlatformThe Facebook platform is a framework that offers a set of API ( Application Programming Interface )and services and other tools that help third parties to integrate and run their applications withFacebook. Facebook developers define Facebook platform as “A standards-based Web Service withmethods for accessing and contributing to Facebook data”. This service is what that enables to createan application to communicate and integrate with Facebook servicesThe framework of Facebook platform consisted of the following technologies and hence can beconsidered as a High Level platform components o Graph API (Application Programming o Facebook markup Language Interface) o Facebook Query Language o Authentication o Facebook JavaScript o Social Plugins o Facebook Connect o Open Graph ProtocolBasic Architecture of the Facebook Application PlatformFacebook sets as an example of the architecture built around useful data of its consumers, the dataincludes personal relationship mappings, bio-data, media contents and other important data. TheFacebook engineers built the architecture of the Facebook keeping in mind the philosophy ofdisplaying and manipulation of the social data. The site’s business logic is carefully related to this
  2. 2. data, such as flow of the information and access patterns, News Feed contents and searchimplementation, privacy and visibility settings, Account settings and friends’ information.Facebook is abstractly a standard n-tier architecture that brings data from Facebook’s internallibraries, which are processed through the Facebook logic to be outputted on the view tier of thesite. Facebook engineers realized the practicality of this data beyond the confines of its container.They allow the outside application to integrate with the Facebook data access system with thecreation of Facebook Platform with the users data at the center of the architecture; the platform hasdeveloped a range of Facebook web services to join application developers’ system.Third party application do not live on Facebook server somewhat they live on external servers, theyare called when a user request for a specific application. The developers provide a canvas page URLand a callback URL for that application. A user initiates an HTTP request to Facebook serverthrough canvas page URL then a Facebook server sends a request to the external serverbased on callback URL where the application is hosted, then the application calls theFacebook API or FQL (Facebook Query Language) to access data. After all the required datahas been accessed, the application server returns the FBML(Facebook Markup language) tothe Facebook server that in turn processes the FBML and converts it to HTML and the outputis rendered to the browser. With the help of Facebook Platform technologies: o Application can access useful social data through the Facebook platform Data Services. o Application can publish their display using the data driven markup language FBML to integrate with Facebook. o With the change in architecture that FBML requires, developers can use Facebook Platform Cookies and Facebook JavaScript FBJS to minimize the changes needed to add an application presence to o Finally, applications have these capabilities without sacrificing the privacy and expectations about user experience that Facebook has built around its user data and display.Facebook Data as an XML Web ServiceFacebook data can be accessible through an externally accessible web service, In addition toFacebook API to Facebook Architecture begins the relationship between externalapplications and Facebook through the Facebook Platform, essentially adding Facebook’sdata to the External application stack. Facebook user authorizes the external application toaccess the data from the Facebook; in this case the external application stack consumes theFacebook data as an XML Web Service, Facebook simply makes available two simple remoteprocedure call methods (RPC), this is established with the exposure of two remote methods Function friends_get($session_user); Function users_getInfo($session_user, $input_users, $inputFields);for its users to consume Facebook data as a web service and in return Facebook send userdata as an xml document. Facebook platform maintains the authentication credentials and
  3. 3. session specific to user’s application through an assigned “API key”, “User Session Key” and a“request signature”. Web Service wrap the Facebook data through the use of appropriatemetadata by a code generator called Thrift. Employing the beautiful tool like “Thrift”provides benefits over others: o Automatic Type Synchronization o Automatic documentation o Automatic Binding generation o Cross language SynchronizationA Social Data Query Service: Facebook Query Language ( FQL )FQL is a way to access/query data from the Facebook like with API functions but with the SQL styleinterface having the same syntax as SQL, e-g:SELECT [fields] FROM Table WHERE [condition] The benefits that developers get by FQL over traditional Facebook API is o FQL is more efficient o FQL reduces number of necessary requests o FQL is Language independent.Facebook Markup Language (FBML)FBML is a particular example of XML with many tags from HTML, and extended with some specialtags for platform for displaying on facebook. Also FBML incorporates with FQL. As you understand,they are modifying known standards like HTML, SQL into FBML, FQL etc. in the Facebook Platform.Moreover in FBML the developer is very flexible. The FBML lets him to control the display and logicexecuted on the server through the FBML data. This is very good example of data at the center ofexecution. As we said FBML includes tags, attributes and content. These tags are divided into somecategories: Briefly they are direct HTML tags, data-display tags, data-execution tags, design-only tags,replacement HTML tags, functionality package tags.Facebook JavaScript (FBJS)Facebook provides a solution for developers to use javascript in their facebook applications. It iscalled FBJS. Actually, as concept there is no difference between javascript and facebook javascriptjust there are some differences like function and variable names, and also the usage of the code isquite different. Moreover there are some restrictions of using some functions regarding safetyissues.Applications on FacebookWe can create applications on facebook with three different methods: 1. Directly rendering HTML, CSS, and JS
  4. 4. To create an application on facebook, first option is configurating an external application with small changes, adding two fields into application like application_name and callback_url. A request coming to the facebook application page basically fetches HTML, CSS, and JS codes from the application servers and shows it as the main content of the page on Facebook. This makes web site as an HTML web service. 2. Iframes Second option is using iframes which relies on a technology that have been already inside the browser. As we mentioned in directly rendering HTML, CSS, and JS option, we are using the same mappings for the iframes with different syntax like application url link results in HTML output with iframe tags. 3. Facebook Markup Language as data-driven execution markup Third option is quite different from the others. Here we are not sending HTML back instead of this, we are returning a data driven execution markup specialized for facebook named FBML which includes many HTML elements but adds also some special Facebook-defined tags inside. Then interpreter for FBML transforms this markup language into its own data, execution and display when the application page is being rendered. ConclusionOne of the main objectives of Facebook has always been to make it easy for user to benefitfrom one another’s knowledge and Facebook Platform conveys the knowledge to users anddevelopers universally. It brings a platform on which developers can build rich applications.Within its ever evolving website Facebook is making its platform architecture available as amodel for other social networking sites. Facebook’s desire is not only to capture the entiretyof human connectedness, but also to be able to share the human information as well.