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

GraphQL 用于服务端资源聚合

Last updated : May 19, 2020
Not on the current edition
This blip is not on the current edition of the Radar. If it was on one of the last few editions it is likely that it is still relevant. If the blip is older it might no longer be relevant and our assessment might be different today. Unfortunately, we simply don't have the bandwidth to continuously review blips from previous editions of the Radar Understand more
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
Radar

下载第25期技术雷达

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

Radar

获取最新技术洞见

 

立即订阅

查看存档并阅读往期内容