Docsity

Facebook Distributon System, Study notes of Distributed Database Management Systems

Partial preview of the text

Download Facebook Distributon System and more Study notes Distributed Database Management Systems in PDF only on Docsity!

FACEBOOK

Distributed System

SUBMITTED TO:

Sir Tahir Mumtaz

  • (^) Facebook Architecture…………………………………. 9
  • Facebook Distributed System Working………………..
    • Facebook Front-End……………………………….. 11
    • Facebook Back-End……………………………….. 17
  • Features…………………………………………………….. 30
  • Motives……………………………………………………… 31
  • Challenges…………………………………………………. 32
  • Advantages………………………………………………... 36
  • Disadvantages…………………………………………….. 36
  • Literature Review…………………………………………..

37

  • (^) Methodology………………………………………………. 39
  • Conclusion………………………………………………….. 42
  • Summary…….………………………………………………
  • Reference…………………………………………………... 43

abstract

In recent years an impressive number of youth have taken to joining popular online social networking service (SNS) websites. One of the most famous and prosperous of these within the US college student community is Facebook.com. Facebook functions as a purposed network of identities, deposited expressions, and interactive media that make for a meaningful digital space that has become interlaced into the day-to-day lives of most students. The Facebook ecology facilitates an emergent, intricate, and robust arena of interactions and representations that serve to mediate the construction of identity. How is it then that participants perform and thus construct their identities on Facebook.com? This paper begins to answer this question within the folds of an intriguing, if not elaborate exploration. It reviews pertinent background information on Facebook, as well as its social relevancy, and highlights some of the applicable psychological and sociological theories on identity, starting with Erving Goffman’s dramaturgical approach. Several salient, mediating elements of digital architecture are discussed, including anonymity, disembodiment, virtual space, temporal context, interface and metaphors, and their correspondent relation to Facebook. The literature review includes a concise analysis of much of the material already available on Facebook and should bring readers up to speed with the perspective employed for the research questions in this work.

  • (^) A distributed system is one in which hardware or software components located at networked computers.
  • Distributed database is a kind of virtual database whose component parts are physically stored in a number of distinct real databases at a number of distinct locations.
  • Communicate and coordinate their actions only by Message passing.
  • In the term distributed computing, the word distributed means spread out across space. Thus, distributed computing is an activity performed on a distributed system.
  • These networked computers may be in the same room, same campus, same country, or in different country.
  • (^) Two aspects:
    • independent computers
    • (^) Single system => middleware. World Wide Web (WWW) is the biggest example of distributed system.

HIStory

Mark Zuckerberg, 23, founded Facebook while studying psychology at Harvard University. A keen computer programmer, Mr Zuckerberg had already developed a number of social-networking websites for fellow students, including Coursematch, which allowed users to view

people taking their degree, and Facemash, where you could rate people's attractiveness.

In February 2004 Mr Zuckerberg launched "The facebook", as it was originally known; the name taken from the sheets of paper distributed to freshmen, profiling students and staff. Within 24 hours, 1, Harvard students had signed up, and after one month, over half of the undergraduate population had a profile. The network was promptly extended to other Boston universities, the Ivy League and eventually all US universities. It became Facebook.com in August 2005 after the address was purchased for $200,000. US high schools could sign up from September 2005, then it began to spread worldwide, reaching UK universities the following month.

As of September 2006, the network was extended beyond educational institutions to anyone with a registered email address. The site remains free to join, and makes a profit through advertising revenue. Yahoo and Google are among companies which have expressed interest in a buy-out, with rumoured figures of around $2bn (£975m) being discussed. Mr. Zuckerberg has so far refused to sell.

The site's features have continued to develop during

  1. Users can now give gifts to friends, post free classified advertisements and even develop their own applications - graffiti and Scrabble are particularly popular. This month the company announced that the number of registered users had reached 30 million,

People from anywhere can use Facebook to stay connected with friends and family, they can share such contents of data and multimedia such as audios/videos and express what matters to them by comments and likes.

Facebook systems at the first are responsible for processing large quantities of data, named as “Big Data”, which is ranging from simple reporting and business intelligence to the huge measurements and reports executed from different perspectives, this numerous large of data located on different geographically distributed datacenters and being processed under highly equipment’s servers, which they architected in high technologies to improve the whole performance of the system ,Facebook inspired by Hadoop and Hive systems supported by its integrated components which Facebook was built on top of this technologies.

  • A portal for social networking
  • Interact with friends
  • Share photos and/or videos
  • Community organizing
  • Email and instant messaging
  • Various forms of interpersonal communication
  • Operated and privately owned by Facebook, Inc.

Facebook architecture

Facebook, the online social network (OSN) system is relying on globally distributed datacenters which are highly dependent on centralized U.S data centers, in which scalability, availability, openness, reliability and security are the major System requirements. When founded in 2004 it was such a dream to be the largest OSN by the year of 2013 putting the system on the surface of risk unless it well designed and protected against failure and attacks. The architecture of the system, the scheme here is 3 tier architecture or more ( tier), in which the data flow originated form clients requests that are served by the following steps:

1- Initially by dedicated web servers, these web servers are highly connected in high available scheme to handle billions of requests and aggregate the logs coming from different web servers.

2- then they are redirected in uncompressed format to the Scribe Hadoop Clusters they are dedicated for logs aggregations, the Later is then communicate the Hive Hadoop servers cluster ,these servers are divided in two categories, the Production and the Adhoc, they are clusters of servers that are balancing according to the priority of jobs, for example the Production servers are dedicated to the jobs that being strict in delivery deadlines time constrains , while the adhoc cluster is serving the low priority.

data. This tier stores all the metadata about every object in the database, such as a person, photo, or event.

The middle tier consists of caching servers. Even 800 database servers can’t serve up all the needed data: Facebook receives 15 million requests per second for both data and connections. Bulked-up cache servers, running Linux and the open-source Memcache software, fill the gap. About 95 percent of data queries can be filled from the cache servers’ 15 terabytes of RAM, so that only 500,000 queries per second have to be passed to the MySQL databases and their relatively slow hard drives.

facebook Distributed system working

1. FRONT-END

• LAMP:

  • Linux, Apache, MYSQL, PHP & Bigpipe
  • Low Barrier Entry
  • Great Documentation
  • Large Community
  • The Original Stack
  • Why LAMP?
  • Easy to learn, huge community, lots of
  • Framework used by Facebook

Apache & Linux

Apache is free and is the most popular open source webserver in use.

Facebook messaging system has recently added to the application, by the support of Apache HBase which is a database like layer built on Hadoop designed to support billions of messages per day. The application’s requirements for consistency, availability, partition tolerance, data model and scalability.

Enhancements made to Hadoop to make it a more effective real time system, Facebook made many tradeoffs while configuring the system, to add significant advantages over the shared MySQL database scheme used in applications at Facebook.

HBase will support Facebook billion messages capacity which will be increased with minimal overhead and no down time , with Highly write throughput ,efficient and low-latency that support the strong consistency semantics within a data center, the efficient random reads from disks, and being highly available specially in disaster recovery, and fault isolation ,and retaining the atomic read modify write primitives.

It added a zero downtime in case of individual data center failure, running on Active serving capabilities across different data centers.

LINUX is a computer operating system kernel. It’s open source, very customizable, and good for security.

Facebook uses PHP because it is a good web programming language with extensive support and an active developer community and it is good for rapid iteration.

PHP is a dynamically typed/interpreted scripting language.

The facebook sdk for php is a library with powerful features that enable php developers to easily integrate facebook login and make requests to the graph API.

It also plays well with the facebook sdk for javascript to give the front-end user the best possible user experience. But it doesn't end there, the facebook sdk for php makes it easy to upload photos and videos and send batch requests to the graph API among other things.

And sdk for php has many extensibility points giving php developers full control of how the sdk for php interacts with their specific hosting environment and web framework.

Whether you're developing a website with facebook login, creating a facebook canvas app or page tab, the facebook sdk for php does all the heavy lifting for you making it as easy as possible to deeply integrate into the facebook platform.

For installation & implementation instructions, look through the getting started with the facebook sdk for PHP guide.

Bigpipe is a dynamic web page system developed by facebook. The general idea is to perform pipelining of

sections through the implementation of various stages within web browsers and servers.

Bigpipe is a fundamental redesign of the dynamic web page serving system. The general idea is to decompose web pages into small chunks called pagelets, and pipeline them through several execution stages inside web servers and browsers. This is similar to the pipelining performed by most modern microprocessors: multiple instructions are pipelined through different execution units of the processor to achieve the best performance. Although bigpipe is a fundamental redesign of the existing web serving process, it does not require changing existing web browsers or servers; it is implemented entirely in php and javascript.

MOTIVATION

  • Browser sends an http request to web server.
  • Web server parses the request, pulls data from storage tier then formulates an html document and sends it to the client in an http response.
  • Http response is transferred over the internet to browser.
  • Browser parses the response from web server, constructs a tree representation of the html document, and downloads css and javascript resources referenced by the document.
  • After downloading javascript resources, browser parses and executes them.

facebook Distributed system working

2. BACK-END

  • Back end are the application servers.
  • Application servers are responsible for answering all queries and take all the writes into the system.
  • Facebook’s backend services are written in a variety of different programming languages including C++, Java, Python, and Erlang.
  • Haystack
  • SCRIBE
  • THRIFT
  • My SQL
  • Memcache
  • Cassandra
  • Storing

Haystack

The new photo infrastructure merges the photo serving tier and storage tier into one physical tier. It implements a HTTP based photo server which stores photos in a generic object store called Haystack. The main requirement for the new tier was to eliminate any unnecessary metadata overhead for photo read operations, so that each read I/O operation was only

reading actual photo data (instead of file system metadata). Haystack can be broken down into these functional layers:

  • HTTP server
  • (^) Photo Store
  • Haystack Object Store
  • (^) File system
  • Storage

I. Storage

Haystack is deployed on top of commodity storage blades. The typical hardware configuration of a 2U storage blade is:

  • 2 x quad-core CPUs
  • 16GB – 32GB memory
  • hardware raid controller with 256MB – 512MB of NVRAM cache
  • 12+ 1TB SATA drives

II. File system

Haystack object stores are implemented on top of files stored in a single file system created on top of the 10TB volume. Photo read requests result in read() system calls at known offsets in these files, but in order to execute the reads, the file system must first locate the data on the actual physical volume. Each file in the file system is represented by a structure called an inode which contains a block map that maps the logical file offset to the physical block offset on the physical volume.