跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[Go 编程语言] 用 Go 实现 GraphQL 转 gRPC 网关,大家觉得这个思路如何

发表于

最近在想如何解决 grpc 微服务接口聚合的问题。

我这边现在有大量 grpc 微服务,其中有不少都在做接口聚合的事情。

调研了一番,准备用 Go 写个 GraphQL 转 gRPC 的网关。

GraphQL 转 gRPC 的好处:

  • GraphQL 自带 schema ,对端友好,大家不用再为文档烦恼
  • 显式选择字段,配合 gRPC fieldmask 可实现前后端双重省流
  • 前端通过 query 参数,自己指定聚合 grpc 接口,很灵活
  • 基于 gRPC 生成 GraphQL schema ,又没那么灵活,没有 N+1 问题
  • 可在网关上实现限流、熔断、鉴权、链路、监控等功能

大家怎么看?欢迎给建议,提前感谢。

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.