from Hacker News

When to Use gRPC vs. GraphQL

by lorendsr on 11/30/22, 5:49 AM with 1 comments

  • by phendrenad2 on 11/30/22, 6:04 AM

    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)