これらは 3 つの異なる API パラダイムで、それぞれ異なる制約に最適化されています。普遍的な勝者はありません — 正しい選択は 消費者、データの形、ネットワーク に依存します。
3 つを一目で
REST GraphQL gRPC
Style resources + HTTP single query graph RPC (call methods)
Transport HTTP/1.1, JSON HTTP, JSON HTTP/2, Protobuf (binary)
Fetching fixed endpoints client picks fields fixed methods
Schema optional (OpenAPI) strong, typed strong, .proto
Browser native, cacheable needs client lib limited (needs proxy)
REST
素の HTTP 上のリソース指向。public API、CRUD サービス、HTTP キャッシュ・遍在性・単純さの恩恵を受けるものには 。弱点は (1 フィールドしか要らなくても 全体を得る) と ( 問題: user を取得し、次に各 order を取得するためにループする) です。
