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

GraphQL 用于服务端资源聚合

更新于 : May 19, 2020
不在本期内容中
这一条目不在当前版本的技术雷达中。如果它出现在最近几期中,那么它很有可能仍然具有相关参考价值。如果这一条目出现在更早的雷达中,那么它很有可能已经不再具有相关性,我们的评估将不再适用于当下。很遗憾我们没有足够的带宽来持续评估以往的雷达内容。 了解更多
May 2020
Trial ? 值得一试。了解为何要构建这一能力是很重要的。企业应当在风险可控的前提下在项目中尝试应用此项技术。

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

May 2018
Assess ? 在了解它将对你的企业产生什么影响的前提下值得探索

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

下载第29期技术雷达

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

获取最新技术洞见

 

立即订阅

查看存档并阅读往期内容