Skip to content

When to Use gRPC vs. GraphQL

stackoverflow.blog
1 pointlorendsr1 comment
On HN

Comments

I'm not convinced that GraphQL (which, spoiler, this article puts forth as the winner for client/server communication) is a win for most cases, unless you're literally at Stack Exchange scale.

In client-server communication, latency is high. We want to be able to get all the data we need in a single round trip, have flexibility in what data we fetch for different views, and have powerful caching

You can (mostly) get all 3 of these with REST, if you sacrifice a little flexibility and add some backend filtering. The upside is your stack is simpler than using a GraphQL library and keeping it patched (oh yeah, graphql library security vulnerabilities are a thing, sorry for the nightmare fuel)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.