Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the design & architecture behind facebook's status update mechanism?

I'm planning on creating a social network and I don't think I quite understand how the status update module of facebook is designed. Hoping I can find some help here. At algorithmic and datastructure level, what is the most efficient way to create a status update mechanism in a social network?

A full table scan for all friends and then sorting their updates is very naive and costly. Do we use some sort of mechanism based on hashing or something else? Please let me know.

P.S: I'm not talking about their EdgeRank algorithm but the basic status update. How do they find and fetch them from the database?

Thanks in advance for the help!

like image 643
Ari53nN3o Avatar asked Aug 16 '11 02:08

Ari53nN3o


People also ask

What is design simple words?

1 : an arrangement of parts in a structure or a work of art The design of the house suits a large family. 2 : the art or process of planning and creating something His job is Web page design. 3 : a sketch, model, or plan of something made or to be made Architects studied the design for the building.

What is design and example?

The definition of a design is a plan or something created, often in art or fashion. An example of design is a plaid pattern on a pair of pants. noun. 1. To conceive or fashion in the mind; invent.

What is the best meaning of design?

In simple and brief words, a design is a plan to make something. “Design is a plan for arranging elements in such a way as best to accomplish a particular purpose.”

Why is it called design?

It's said that the word “design” comes from the Latin word designare. Designare is said to have meant to draw a plan. For this reason, it is thought that the word design initially was used in this sense of a plan on paper.

What is the meaning of a design?

A design is a plan or specification for the construction of an object or system or for the implementation of an activity or process or the result of that plan or specification in the form of a prototype, product, or process. The verb to design expresses the process of developing a design.

What is design thinking and why is it important?

What is design? Generally speaking, it is the process of envisioning and planning the creation of objects, interactive systems, buildings, vehicles, etc. It user-centered, i.e. users are at the heart of the design thinking approach. It is about creating solutions for people, physical items or more abstract systems to address a need or a problem.

What are the elements of design?

The elements of design are the tools you use to create a work of art. Knowing the fundamental elements and applying them to your piece with a clear understanding will help you make it powerful enough to convey a message. So, what are the main elements that you need to know before starting working on your blank canvas?

Is design an art or science?

Most people think that design is about making things look pretty – a decoration. Art. But design is as much an art as it is a science. Cold and calculated process. Sometimes the detriment of pretty.


1 Answers

Here is a great presentation that answers your question. The specific answer comes up at around minute 55:40, but I suggest that you watch the entire presentation to understand how the solution fits into the entire architecture.

In short:

  1. A particular server ("leaf") stores all feed items for a particular user. So data for each of your friends is stored entirely at a specific destination.
  2. When you want to view your news feed, one of the aggregator servers sends request to all the leaf servers for your friends and ranks the results. The aggregator knows which servers to send requests to based on the userid of each friend.

This is terribly simplified, of course. This only works because all of it is memcached, the system is designed to minimize latency, some ranking is done at the leaf server that contains the friend's feed items, etc.

You really don't want to be hitting the database for any of this to work at a reasonable speed. FB use MySql mostly as a key-value store; JOINing tables is just impossible at their scale. Then they put memcache servers in front of the databases and application servers.

Having said that, don't worry about scaling problems until you have them (unless, of course, you are worrying about them for the fun of it.) On day one, scaling is the least of your problems.

like image 50
Nick Zalutskiy Avatar answered Nov 16 '22 00:11

Nick Zalutskiy