Enable javascript in your browser for better experience. Need to know to enable it? Go here.

GraphQL 用于服务端资源聚合

更新于 : May 19, 2020
不在本期内容中
这一条目不在当前版本的技术雷达中。如果它出现在最近几期中,那么它很有可能仍然具有相关参考价值。如果这一条目出现在更早的雷达中,那么它很有可能已经不再具有相关性,我们的评估将不再适用于当下。很遗憾我们没有足够的带宽来持续评估以往的雷达内容。 了解更多
May 2020
试验 ?

我们看到越来越多的工具(例如 Apollo Federation)支持将多个 GraphQL 端点聚合到一个图中。但必须提醒的是,不要滥用 GraphQL,尤其是作为服务间的协议时。我们的实践是仅将 GraphQL 用于服务端资源聚合。使用这种模式时,微服务会持续发布明确定义的 RESTful API,而聚合服务或 BFF(Backend for Frontends) 模式则使用 GraphQL 解析器集成其他服务资源。图的形状需由领域建模实践驱动,以确保在必要时(在每个限界上下文都是一个微服务的情况下)将统一语言局限在子图内。该技术简化了聚合服务或 BFF 的内部实现,同时鼓励对服务进行良好的建模以避免贫血 REST

May 2018
评估 ?

One pattern that comes up again and again when building microservice-style architectures is how to handle the aggregation of many resources server-side. In recent years, we've seen the emergence of a number of patterns such as Backend for Frontend (BFF) and tools such as Falcor to address this. Our teams have started using GraphQL for server-side resource aggregation instead. This differs from the usual mode of using GraphQL where clients directly query a GraphQL server. When using this technique, the services continue to expose RESTful APIs but under-the-hood aggregate services use GraphQL resolvers as the implementation for stitching resources from other services. This technique simplifies the internal implementation of aggregate services or BFFs by using GraphQL.

发布于 : May 15, 2018

下载 PDF

 

English | Español | Português | 中文

订阅技术雷达简报

 

立即订阅

查看存档并阅读往期内容