惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
LINUX DO - 热门话题
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Project Zero
Project Zero
V
Vulnerabilities – Threatpost
Cisco Talos Blog
Cisco Talos Blog
P
Palo Alto Networks Blog
C
Cisco Blogs
A
Arctic Wolf
月光博客
月光博客
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
量子位
小众软件
小众软件
Latest news
Latest news
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
T
The Exploit Database - CXSecurity.com
Security Latest
Security Latest
N
Netflix TechBlog - Medium
K
Kaspersky official blog
人人都是产品经理
人人都是产品经理
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
Y
Y Combinator Blog
P
Proofpoint News Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
M
MIT News - Artificial intelligence
T
Threat Research - Cisco Blogs
S
Schneier on Security
D
Docker
Scott Helme
Scott Helme
MyScale Blog
MyScale Blog
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
GbyAI
GbyAI
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
The Hacker News
The Hacker News
H
Help Net Security
Simon Willison's Weblog
Simon Willison's Weblog
J
Java Code Geeks
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tenable Blog
B
Blog
Know Your Adversary
Know Your Adversary
IT之家
IT之家

GraphQL

Graphql 太难用了,难监控性能,难客户端缓存 - V2EX 国内用 GraphQL 的好像不多? - V2EX 请教一个 graphql subscriptions 问题 - V2EX 做前后端分离接口开发时,用 graphql 的多吗? - V2EX 关于 N+1 问题解决方案的疑问 - V2EX Hello GraphQL - V2EX prisma 和 普通 orm 的区别是什么? - V2EX
有用过 GraphQL 的吗?可以进来说说相比 restful 的优劣吗? - V2EX
ReinerShir · 2021-01-26 · via GraphQL

近 1 年都在和 GraphQL 打交道,接触的方面包括:
1. 前端 apollo client 和后端 node.js apollo server 打交道,后端是重业务代码
2. 前端 apollo client 和后端 graphql ruby 打交道,后端也是重业务代码
3. 前端 react query 和后端 node.js apollo server 打交道,后端是 BFF 层

总结一下个人对 GraphQL 评价
优点:
- schema-driven 的开发流程,衍生出一系列好处:代码生成、精确的接口文档。类比 RESTful 的 swagger 。
- 很容易实现 field 粒度的 ACL
- 良好的类型系统,对 normalization 、cache 、codegen 等都非常友好
- 有官方 spec,不像 RESTful 有各种不同的解读方式(尽管 spec 没有提到分页,但 relay style 已经成为了事实标准)

缺点:
- 各类 HTTP debug 工具支持都很弱
- 大规模 scale out 的实践比较少,缺少成熟的基础设施( gateway,细粒度监控,日志,限流,等等)
- 很难利用 HTTP cache,需要前端自己实现 cache 系统
- 服务端 n+1 查询问题
- 和 RESTful 一样,只是一种工具,没有官方范式。有人会写嵌套很深的 field,有人会像 RESTful 一样全部扁平化,甚至有人写出来是 RPC style (我见过 root query 顶层 field 全部是 `getXxxByXxx` 的命名风格)
- 使用最广泛的 apollo-client 至今稳定性欠佳,bug 很多