Architecture Tradeoff Explorer

Every comparison answers the same five questions — use when, avoid when, complexity, operational cost, failure modes — so the decision is about your constraints, not the fashion of the year.

Same request/response idea, different transport. REST/JSON is universal and debuggable; gRPC is binary over HTTP/2 with generated typed clients, deadlines and streams. Inside a network you control, gRPC pays off on hot paths; at the edge, REST wins.

REST
API Architecture: REST, GraphQL, RPC, gRPC, WebSockets, Webhooks
gRPC
Microservices
Use whenPublic or browser-facing APIs, occasional internal calls, anything where any HTTP tool must work.Service-to-service on a hot path — thousands of calls per second, typed contracts across languages, streaming in either direction, deadlines that propagate.
Avoid whenA chatty internal path where JSON encoding and hand-written clients are a measured cost and integration bugs come from untyped payloads.Browser clients (needs a transcoding gateway), an L4 load balancer that cannot see HTTP/2 streams, or a team that will debug with curl at 3 a.m.
ComplexityLow: HTTP and JSON; contract via OpenAPI.Medium: protobuf definitions, codegen for every language, HTTP/2-aware load balancing, a gateway for external access.
Operational costEvery proxy, CDN and observability tool understands it.L7 or client-side balancing required; binary payloads need tooling to inspect; but deadlines and streaming are built in.
Failure modesSlow serialisation on hot paths; no built-in deadline propagation, so timeouts must be threaded by hand.One backend taking 100% of traffic because an L4 balancer pinned all streams to it; field semantics changed while the field number stayed, which codegen cannot catch.
Data flowHTTP/1.1 or 2, JSON text, one request per responseHTTP/2 streams, protobuf binary, unary or streaming in either direction
LatencyHigher: text encoding and per-request connection overhead without HTTP/2Lower: compact encoding, multiplexed streams, persistent connections
ObservabilityReadable on the wire; any proxy logs itNeeds interceptors for tracing and tooling to decode payloads