Re-Architecting the Video Gatekeeper(二)

Original: https://medium.com/netflix-techblog/re-architecting-the-video-gatekeeper-f7b0ac2f6b00

idea

We decided to deploy a full-high-density near-field buffer (Hollow) to solve our IO bottleneck. For each of our upstream systems, allows us to build a data set including all the data Hollow Gatekeeper to perform this assessment. Each upstream system now needs to ensure its cache to date.

Using this model, the assessment of activity isolated from the data in the upstream system. With respect to the response to events, Gatekeeper will be a repeat of the cycle of continuous processing activity data from the video data in all over the world. Starting iterations on each video line Netflix calculating their activity information. At the end of each cycle, it is calculated to output a representation of the output of all activity detailed information of the video world (including Hollow dataset).

We hope that this ongoing process model is feasible, so that we can completely remove the bottleneck on our IO, can guarantee the order of operations more efficient. We also expect that we can produce more positive impact on the business by moving to this model.

  • As a final solution to the excessive load of Gatekeeper generated upstream system
  • The complete elimination of delays and missed active treatment of the issue date on the line.
  • Ease the contents of the configuration time consuming project team performance-related issues.
  • Improved active treatment can debug and visibility

problem

Hollow can be thought of as a time machine. As a data set of data has been changed, and the change to a consumer by the change data into a series of state of the time line. Each data state is represented as a snapshot of the entire data set at the time of the moment.

In general, save the new state consumer Hollow data set will load the latest state of the generated data to their mix memory. Of course, they may alternatively state will look like prior to the - leading to a state before the entire set of data points.

传统产生数据状态的方式是维护一个运行重复周期的生产者。在一个周期中,生产者从元数据中迭代所有记录。在迭代中,它对Hollow库中增加每条数据。Hollow则在之后计算数据的变化并在最后的周期将数据填加上去,将数据状态发布到一个已知地址的消费者。

这个基于真实数据源的迭代模型的问题是它可能会需要很长时间。在这个场景中一些我们的上游系统,这需要几小时。数据传播延迟是不可接受的 - 我们不能为活跃性处理等待几个小时,比如,标题运营给电影增加了一个评级并需要立即发布上线。

改进

我们需要一个更快的时间机器 - 它可以更频繁的产出状态,让消费方可以更快的识别到变化。

为了达到这个目标,我们建立了一套很强的Hollow基础设施,平衡了之前Hollow library做的工作,与流处理团队在Target生产环境做的先锋性工作(现在是公开的非beta的API)

使用这套基础设施,每次变更都可以在源应用中呗检测到,更新过的记录会被编码并发送给Kafka topic。一个不属于源应用的新组件,Hollow增量生产服务,以一个预定义的节奏执行一个重复周期。 在每个周期,它读取自从上个周期所有增加到topic的消息,并让Hollow状态引擎反映出更新过的记录的最新状态。

如果一个Kafka topic中的消息包含了已经在Hollow数据集中已经反映出来的相同数据,不会有任何变动。

为了缓解丢失事件产生的影响,我们实现了一套周期性从整个数据集清扫的机制。当它执行时,它将每条记录的内容发送给Kafka topic。通过这种方式,任何可能丢失的更新都会反映到Hollow数据集上。并且,这不是更新传播到Hollow数据集上的主要方式,它不需要像传统Hollow使用方式那样很快很频繁的在源上迭代运行。

Hollow增量生产者有从Kafka topic中读取大量消息并快速转变成Hollow状态的能力 - 所以我们可以将这个周期配置的非常短(我们目前的缺省配置是30秒)。

这就是我们如何构建一个更快时间机器的方式。现在,如果标题运营给电影增加了一条评级,在30秒内,数据就可以在Hollow数据集上可用。

本文来自微信公众号「麦芽面包,id「darkjune_think」
转载请注明。微信扫一扫关注公众号。
交流Email: [email protected]

Guess you like

Origin www.cnblogs.com/zhukunrong/p/11374137.html