facebook 架构_facebook系统架构简介

facebook 架构

How your social media data on Facebook are organized and stored

如何在Facebook上组织和存储您的社交媒体数据

There is no need for an introduction to Facebook. Facebook has more than 1 billion active users who record their relationships, share their interests, upload and comment on text, images and videos. In this blog, I will mainly discuss two aspects of Facebook’s backend system:

无需介绍Facebook。 Facebook拥有超过10亿活跃用户,他们记录他们的关系,分享他们的兴趣,对文本,图像和视频进行上传和评论。 在此博客中,我将主要讨论Facebook后端系统的两个方面:

  • How the social graph is modeled and stored, that is, the database schema adopted by Facebook.

    社交图的建模和存储方式,即Facebook采用的数据库架构。
  • How Facebook scaled its infrastructure, including servers, cache and databases, to serve 1 billion reads and millions of writes per second.

    Facebook如何扩展其基础结构(包括服务器,缓存和数据库),以每秒处理10亿次读取和数百万次写入。

社会图的数据模型 (The Data Model For Social Graph)

Facebook stores majority, if not all, of users’ data, such as profiles, friends, posts and comments, inside a single giant social graph. There are two elements inside a social graph, nodes and edges.

Facebook在单个巨型社交图谱中存储用户的大部分(如果不是全部)数据,例如个人资料,朋友,帖子和评论。 社交图中有两个元素:节点和边。

  • A node represents an entity, such a user, a post, a comment and a location.

    节点代表一个实体,例如用户,帖子,评论和位置。
  • An edge represents the relationships between the nodes. For example, one edge could mean that a particular user created a particular post.

    一条边表示节点之间的关系。 例如,一个边缘可能意味着特定用户创建了特定帖子。

For example, let’s imagine that the user Alice creates a post and tags the user Bob, as illustrated below. The user Cathey comments on the post, which David likes.

例如,假设用户Alice创建了一个帖子并标记了用户Bob,如下所示。 用户Cathey在帖子中发表了评论,David很喜欢。

Alice: It was a great party! @ Bob

爱丽丝:那是一场很棒的聚会! @鲍勃

— — Cathey: Thanks for coming. (David likes this)

— — Cathey:谢谢您的光临。 (大卫喜欢这个)

The post, comment and like will result a few changes to the social graph, as illustrated in the figured below. Assume the users, Alice, Bob, Cathey and David are already friends. Inside the social graph, 4 nodes already exist, 1 for each user. For instance, the node representing the user Alice has ID 105 and otype as User. (otype is an abbreviation for object type. Inside the Facebook system, node is referred to as object.) There are 2 edges between each pair of the users t

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值