Netflix内容工程公司如何使联合图谱可被搜索到
By Alex Hutter, Falguni Jhaveri and Senthil Sayeebaba
作者:Alex Hutter,Falguni Jhaveri和Senthil Sayeebaba
Over the past few years Content Engineering at Netflix has been transitioning many of its services to use a federated GraphQL platform. GraphQL federation enables domain teams to independently build and operate their own Domain Graph Services (DGS) and, at the same time, connect their domain with other domains in a unified GraphQL schema exposed by a federated gateway.
在过去的几年里,Netflix的内容工程部一直在将其许多服务过渡到使用联合的GraphQL平台。GraphQL联盟使领域团队能够独立地建立和运行他们自己的域图服务(DGS),同时,在一个由联盟网关暴露的统一的GraphQL模式中,将他们的领域与其他领域连接起来。
As an example, let’s examine three core entities of the graph, each owned by separate engineering teams:
作为一个例子,让我们检查一下图中的三个核心实体,它们分别由不同的工程团队拥有。
- Movie: At Netflix, we make titles (shows, films, shorts etc.). For simplicity, let’s assume each title is a Movie object.
- 电影。在Netflix,我们制作标题(节目、电影、短剧等)。为了简单起见,让我们假设每个标题都是一个Movie对象。
- Production: Each Movie is associated with a Studio Production. A Production object tracks everything needed to make a Movie including shooting location, vendors, and more.
- 生产。每部电影都与一个工作室生产相关联。生产对象跟踪制作电影所需的一切,包括拍摄地点、供应商和更多。
- Talent: the people working on a Movie are the Talent, including actors, directors, and so on.
- 人才:从事电影工作的人是人才,包括演员、导演等。
Sample GraphQL Schema
GraphQL模式样本
Once entities like the above are available in the graph, it’s very common for folks to want to query for a particular entity based on attributes of related entities, e.g. give me all movies that are currently in photography with Ryan Reynolds as an actor.
一旦图中有了上述实体,人们就很容易想根据相关实体的属性来查询某个特定的实体,例如,给我所有目前正在拍摄的以Ryan Reynolds为演员的电影。
In a federated graph architecture, how can we answer such a query given that each entity is served by its own service? The Movie service would need to provide an endpoint that accepts a query and filters that may apply to data the service does not own, and use those to identify the appropriate Movie entities to return.
在一个联合图结构中,鉴于每个实体都是由它自己的服务提供的,我们如何能回答这样的查询?电影服务将需要提供一个接受查询的端点,以及可能的过滤器。 适用于该服务不拥有的数据。并...