LinkedIn数据架构剖析
LinkedIn是当今最流行的专业社交网站之一,本文描述了LinkedIn是如何管理数据的。如你对文中的观点有异议亦或文中有遗漏的部分请随时告诉我。 LinkedIn.com数据用例 下面是一些数据用例,可能我们在浏览LinkedIn网页时都已经看到过了。 更新后的个人资料后几
LinkedIn是当今最流行的专业社交网站之一,本文描述了LinkedIn是如何管理数据的。如你对文中的观点有异议亦或文中有遗漏的部分请随时告诉我。
LinkedIn.com数据用例
下面是一些数据用例,可能我们在浏览LinkedIn网页时都已经看到过了。- 更新后的个人资料后几乎可以实时的出现在招聘搜索页面
- 更新后的个人资料后几乎可以实时的出现在人脉网页
- 分享一个更新,可以近实时的出现在新闻feed页面
- 然后会更新到其他只读页面,像”你可能认识的人“、”看过我资料的人“、”相关搜索“等。
令人震惊的是,如果我们使用较好的宽带,这些页面可以在数毫秒内完成加载!让我们向LinkedIn工程师团队致敬!
早期的LinkedIn数据架构
像其它初创公司一样,LinkedIn 早期也是通过单个的RDBMS (关系型数据库管理系统)的几张表来保存用户资料和人脉关系。是不是很原始?后来这个RDMBS扩展出两个额外的数据库系统,其中一个用来支撑用户个人资料的全文搜索,另一个用来实现社交图。这两个数据库通过Databus来取得最新数据。Databus是一个变化捕捉系统,它的主要目标就是捕捉那些来至可信源(像Oracle)中数据集的变更,并且把这些变化更新到附加数据库系统中。 但是,没过多久这种架构就已经很难满足网站的数据需求了。因为按照Brewerd的CAP理论想要同时满足下面的条件看似不太可能: 一致性:所有应用在同一时刻看到相同的数据 可用性:保证每个请求都能收到应答,无论成功或失败 分区容错性:部分系统的消息丢失或失败不影响系统系统整体的正常运行根据上面的法则,LinkedIn工程师团队实现了他们称作为时间线一致性(或者说近线系统的最终一致性,下面会解释)以及另外两个特性:可用性和分区容错性。下面介绍目前LinkedIn的数据架构。
LinkedIn如今的数据架构
如果要支撑在不到一秒钟内处理数百万用户的相关事务,上面的数据架构已经明显不足了。因此,LinkedIn 工程师团队提出了三段式(three-phase)数据架构,由在线、离线以及近线数据系统组成。总体上讲,LinkedIn数据被存储在如下几种不同形式的数据系统中(看下面的图):-
RDBMS
- Oracle
- MySQL(作为Espresso的底层数据存储)
-
RDBMS
- Espresso(LinkedIn自己开发的文档型NoSQL数据存储系统)
- Voldemart (分布式Key-value存储系统)
- HDFS (存放Hadoop map-reduce任务的数据)
-
Caching
- Memcached
-
基于Lucene的索引
- 存放查询、关系图等功能数据的Lucene 索引
- Espresso使用的索引
图:LinkedIn数据库系统包括了DataBus、NoSQL、RDBMS以及Indexes
在线数据库系统
在线系统处理用户的实时互动;主数据库像Oracle就属于这一类别。主数据存储用来支撑用户的写操作和少量的读操作。以Orcale为例,Oracle master会执行所有的写操作。最近,LinkedIn正在开发另一个叫做“Espresso”的数据系统来满足日益复杂的数据需求,而这些数据看似不应从像Oracle这类的RDBMS中获取。他们能否淘汰所有或大部分的Oracle并将数据完全转移到像Espresso这类的NoSQL数据存储系统中去?让我们拭目以待。Espresso是一个支持水平扩展、索引、时间线一致性、基于文档且高可用的NoSQL数据仓库,旨在代替支撑公司网页操作所使用的传统Oracle数据库。设计它的初衷是为了提高LinkedIn的InMail消息服务的可用性。目前有如下一些应用在使用Espresso作为可信源系统。能够看到NoSQL数据存储是如果被用来处理如此众多应用的数据需求很是神奇!
- 成员间消息,
- 社交动作,如:更新
- 文章分享
- 用户个人资料
- 公司资料
- 新闻文章
离线数据库系统
离线系统主要包括Hadoop和一个Teradata数据仓库,用来执行批处理和分析类的工作。之所以被称为离线是因为它对数据执行的的批处理操作。?Apache Azkaban被用来管理Hadoop和ETL任务,这些任务从主可信源系统获取数据后交由map-reduce处理,处理结果被保存在HDFS,然后通知’消费者‘(例如:Voldemart)通过合适的方式来获取这些数据并切换索引来保证能获取到最新的数据。近线数据库系统(时间线一致性)
近线系统的目标是为了实现时间线一致性(或最终一致性),它处理类似’你可能认识的人(只读数据集)‘、搜索以及社交图这些功能,这些功能的数据会持续更新,但它们对延迟性的要求并不像在线系统那样高。下面是几种不同类型的近线系统:- Voldemart,一个Key-Value存储系统,为系统中的只读页面提供服务。Voldemart的数据来源于Hadoop框架(Hadoop Azkaban:编排Hadoop map-reduce任务的执行计划)。这就是近线系统,它们从类似Hadoop的离线系统获取数据。下面这些页面的数据都是来自于Voldemart:
- 你可能认识的人
- 看过本页面的人还在看
- 相关搜索
- 你可能感兴趣的工作
- 你可能感兴趣的事件
- 下面是几种不同的索引,这些索引由Databus-一个变化数据捕捉系统-来更新的:
- 供SeaS(Search-as-a-Service)使用的’成员搜索索引‘。当你在LinkedIn上搜索不同的成员时,这些数据就是来自于搜索索引。通常这个功能对招聘人员的帮助很大。
- 社交图索引帮助在人们的人脉关系中显示成员以及关系。通过这个索引用户几乎可以实时的得到网络关系的变化。
- 通过读复制集获取到的成员资料数据。这些数据会被’标准化服务‘访问。读复制集是对源数据库的复制,这样能使源数据库的更新同步到这些复制集上面。增加读复制集的最主要原因是能够通过将读操查询分散到读复制集上来减轻源数据库(执行用户发起的写操作)的压力。

用数据用例来展示它们是如何工作的
假如你更新了你个人资料中的最新技能和职位。你还接受了一个连接请求。那么在系统内部到底发生了什么:
- 将更新写入Oracle Master数据库
- 然后Databus做了如下一系列奇妙的工作来实现时间线一致性:
- 将资料变更,如最新技能和职位信息,更新到标准化服务。
- 将上面提到的变更更新到搜索索引服务。
- 将关系变更更新到图索引服务。
数据架构经验
如果要设计一个像LinkedIn.com一样的支持数据一致性、高扩展性且高可用性的数据架构,可以借鉴下面的经验:- 数据库读写分离:你应当计划两种数据库,一种用来执行写操作的可以称为“可信源”系统,另一种执行读操作的可以称为派生数据库系统。这里的经验法则就是将由用户发起的写操作和用户读操作使用的数据库区分开来。
-
派生数据库系统:用户的读操作应该被分配到派生数据库或者读复制集上去。而派生数据库系统则可以建立在下面的系统之上:
- Lucene 索引
- NoSQL数据存储,例如:Voldemart、Redis、Cassandra、MongoDB等。
- 对于用户的读操作,应该尽量从主可信源数据库系统创建索引或者基于key-value的数据(来源于Hadoop map-reduce之类的系统),并且将每次由用户发起的被写入主可信源系统的变更一并更新到这些索引或派生数据(key-value)。
- 为确保派生数据库系统的数据是最新的,你可以选择应用复写(application-dual writes),即在应用层同时写入主数据库和派生数据库系统,或日志挖掘(读取通过批处理任务得到的主数据存储系统的事务提交日志)。
- 创建派生数据时,你可以针对主数据集或者变更数据集执行基于Hadoop的map-reduce任务,然后更新HDFS并且通知派生数据存储系统(类似Voldemart的NoSQL存储)来取走数据。
- 对于数据一致性来说,你可以以将这些数据存储库创建为分布式系统,集群中的每个节点又都包含主从节点。所有节点都可以创建水平扩展的数据Shards。
- 为了保证这些分布式数据存储系统正常运行时间最大化,你可以使用像Apache Helix这一类的集群管理工具。
参考文献
- Siddarth Anand LinkedIn Data Infrastructure paper
- https://github.com/linkedin/databus
- http://gigaom.com/2013/03/03/how-and-why-linkedin-is-becoming-an-engineering-powerhouse/
- http://highscalability.com/blog/2012/3/19/linkedin-creating-a-low-latency-change-data-capture-system-w.html
- 转自:http://blog.jobbole.com/69344/
原文地址:LinkedIn数据架构剖析, 感谢原作者分享。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



DDREASE is a tool for recovering data from file or block devices such as hard drives, SSDs, RAM disks, CDs, DVDs and USB storage devices. It copies data from one block device to another, leaving corrupted data blocks behind and moving only good data blocks. ddreasue is a powerful recovery tool that is fully automated as it does not require any interference during recovery operations. Additionally, thanks to the ddasue map file, it can be stopped and resumed at any time. Other key features of DDREASE are as follows: It does not overwrite recovered data but fills the gaps in case of iterative recovery. However, it can be truncated if the tool is instructed to do so explicitly. Recover data from multiple files or blocks to a single

0.What does this article do? We propose DepthFM: a versatile and fast state-of-the-art generative monocular depth estimation model. In addition to traditional depth estimation tasks, DepthFM also demonstrates state-of-the-art capabilities in downstream tasks such as depth inpainting. DepthFM is efficient and can synthesize depth maps within a few inference steps. Let’s read about this work together ~ 1. Paper information title: DepthFM: FastMonocularDepthEstimationwithFlowMatching Author: MingGui, JohannesS.Fischer, UlrichPrestel, PingchuanMa, Dmytr

The performance of JAX, promoted by Google, has surpassed that of Pytorch and TensorFlow in recent benchmark tests, ranking first in 7 indicators. And the test was not done on the TPU with the best JAX performance. Although among developers, Pytorch is still more popular than Tensorflow. But in the future, perhaps more large models will be trained and run based on the JAX platform. Models Recently, the Keras team benchmarked three backends (TensorFlow, JAX, PyTorch) with the native PyTorch implementation and Keras2 with TensorFlow. First, they select a set of mainstream

Facing lag, slow mobile data connection on iPhone? Typically, the strength of cellular internet on your phone depends on several factors such as region, cellular network type, roaming type, etc. There are some things you can do to get a faster, more reliable cellular Internet connection. Fix 1 – Force Restart iPhone Sometimes, force restarting your device just resets a lot of things, including the cellular connection. Step 1 – Just press the volume up key once and release. Next, press the Volume Down key and release it again. Step 2 – The next part of the process is to hold the button on the right side. Let the iPhone finish restarting. Enable cellular data and check network speed. Check again Fix 2 – Change data mode While 5G offers better network speeds, it works better when the signal is weaker

I cry to death. The world is madly building big models. The data on the Internet is not enough. It is not enough at all. The training model looks like "The Hunger Games", and AI researchers around the world are worrying about how to feed these data voracious eaters. This problem is particularly prominent in multi-modal tasks. At a time when nothing could be done, a start-up team from the Department of Renmin University of China used its own new model to become the first in China to make "model-generated data feed itself" a reality. Moreover, it is a two-pronged approach on the understanding side and the generation side. Both sides can generate high-quality, multi-modal new data and provide data feedback to the model itself. What is a model? Awaker 1.0, a large multi-modal model that just appeared on the Zhongguancun Forum. Who is the team? Sophon engine. Founded by Gao Yizhao, a doctoral student at Renmin University’s Hillhouse School of Artificial Intelligence.

Recently, the military circle has been overwhelmed by the news: US military fighter jets can now complete fully automatic air combat using AI. Yes, just recently, the US military’s AI fighter jet was made public for the first time and the mystery was unveiled. The full name of this fighter is the Variable Stability Simulator Test Aircraft (VISTA). It was personally flown by the Secretary of the US Air Force to simulate a one-on-one air battle. On May 2, U.S. Air Force Secretary Frank Kendall took off in an X-62AVISTA at Edwards Air Force Base. Note that during the one-hour flight, all flight actions were completed autonomously by AI! Kendall said - "For the past few decades, we have been thinking about the unlimited potential of autonomous air-to-air combat, but it has always seemed out of reach." However now,

This week, FigureAI, a robotics company invested by OpenAI, Microsoft, Bezos, and Nvidia, announced that it has received nearly $700 million in financing and plans to develop a humanoid robot that can walk independently within the next year. And Tesla’s Optimus Prime has repeatedly received good news. No one doubts that this year will be the year when humanoid robots explode. SanctuaryAI, a Canadian-based robotics company, recently released a new humanoid robot, Phoenix. Officials claim that it can complete many tasks autonomously at the same speed as humans. Pheonix, the world's first robot that can autonomously complete tasks at human speeds, can gently grab, move and elegantly place each object to its left and right sides. It can autonomously identify objects

The latest video of Tesla's robot Optimus is released, and it can already work in the factory. At normal speed, it sorts batteries (Tesla's 4680 batteries) like this: The official also released what it looks like at 20x speed - on a small "workstation", picking and picking and picking: This time it is released One of the highlights of the video is that Optimus completes this work in the factory, completely autonomously, without human intervention throughout the process. And from the perspective of Optimus, it can also pick up and place the crooked battery, focusing on automatic error correction: Regarding Optimus's hand, NVIDIA scientist Jim Fan gave a high evaluation: Optimus's hand is the world's five-fingered robot. One of the most dexterous. Its hands are not only tactile
