Face book platform architecture

4

Click here to load reader

Transcript of Face book platform architecture

Page 1: Face book platform architecture

The Architecture of the Facebook Platform

INAM SOOMRO & OLGUN CAKABEY

INTRODUCTION

Facebook has become one of the most important social networking sites around the globe for almost

people 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 and

approaches. Social networking focuses on linking and making online communication between friends

who share their thoughts and activities and who are willing to know the activities and interests of

other friends. A social platform goes further than that, it lets developer and other communities to

create external applications and it gives a chance to Facebook user to interact with each other in

different ways and on different applications. Behind Facebook’s complex technology there are

hundreds of millions of real people with real relationships. They want to communicate in different

ways 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 Facebook

Platform. Facebook Platform’s release brings fresh ideas and immense interest to not only the users

of Facebook, but to the industry as a whole.

Facebook Platform

The 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 with

Facebook. Facebook developers define Facebook platform as “A standards-based Web Service with

methods for accessing and contributing to Facebook data”. This service is what that enables to create

an application to communicate and integrate with Facebook services

The framework of Facebook platform consisted of the following technologies and hence can be

considered as a High Level platform components

o Graph API (Application Programming

Interface)

o Authentication

o Social Plugins

o Open Graph Protocol

o Facebook markup Language

o Facebook Query Language

o Facebook JavaScript

o Facebook Connect

Basic Architecture of the Facebook Application Platform

Facebook sets as an example of the architecture built around useful data of its consumers, the data

includes personal relationship mappings, bio-data, media contents and other important data. The

Facebook engineers built the architecture of the Facebook keeping in mind the philosophy of

displaying and manipulation of the social data. The site’s business logic is carefully related to this

Page 2: Face book platform architecture

data, such as flow of the information and access patterns, News Feed contents and search

implementation, privacy and visibility settings, Account settings and friends’ information.

Facebook is abstractly a standard n-tier architecture that brings data from Facebook’s internal

libraries, which are processed through the Facebook logic to be outputted on the view tier of the

site. 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 the

creation of Facebook Platform with the users data at the center of the architecture; the platform has

developed 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, they

are called when a user request for a specific application. The developers provide a canvas page URL

and a callback URL for that application. A user initiates an HTTP request to Facebook server

through canvas page URL then a Facebook server sends a request to the external server

based on callback URL where the application is hosted, then the application calls the

Facebook API or FQL (Facebook Query Language) to access data. After all the required data

has been accessed, the application server returns the FBML(Facebook Markup language) to

the Facebook server that in turn processes the FBML and converts it to HTML and the output

is 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 http://facebook.com

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 Service

Facebook data can be accessible through an externally accessible web service, In addition to Facebook API to Facebook Architecture begins the relationship between external applications and Facebook through the Facebook Platform, essentially adding Facebook’s data to the External application stack. Facebook user authorizes the external application to access the data from the Facebook; in this case the external application stack consumes the Facebook data as an XML Web Service, Facebook simply makes available two simple remote procedure 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 user

data as an xml document. Facebook platform maintains the authentication credentials and

Page 3: Face book platform architecture

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 appropriate

metadata by a code generator called Thrift. Employing the beautiful tool like “Thrift”

provides benefits over others:

o Automatic Type Synchronization

o Automatic Binding generation

o Automatic documentation

o Cross language Synchronization

A 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 style

interface 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 special

tags 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 logic

executed on the server through the FBML data. This is very good example of data at the center of

execution. As we said FBML includes tags, attributes and content. These tags are divided into some

categories: 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 is

called FBJS. Actually, as concept there is no difference between javascript and facebook javascript

just there are some differences like function and variable names, and also the usage of the code is

quite different. Moreover there are some restrictions of using some functions regarding safety

issues.

Applications on Facebook

We can create applications on facebook with three different methods:

1. Directly rendering HTML, CSS, and JS

Page 4: Face book platform architecture

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.

Conclusion

One of the main objectives of Facebook has always been to make it easy for user to benefit

from one another’s knowledge and Facebook Platform conveys the knowledge to users and

developers 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 a

model for other social networking sites. Facebook’s desire is not only to capture the entirety

of human connectedness, but also to be able to share the human information as well.