SDI.

API Design Lab

Explore and compare 6 API protocols for system design interviews.

GraphQL

Request-Response

GraphQL is a query language for APIs that lets clients request exactly the data they need in a single request, using a strongly-typed schema to define available operations and data shapes.

Eliminates over-fetching and under-fetching — clients get exactly the data they requestSingle request can traverse complex object graphs, replacing multiple REST round-trips

gRPC

Request-Response

gRPC is a high-performance RPC framework using HTTP/2 and Protocol Buffers for strongly-typed, low-latency communication between services with support for bidirectional streaming.

3-10x smaller payloads and 20-100x faster serialization compared to JSON via Protocol BuffersBidirectional streaming over persistent HTTP/2 connections with flow control

REST

Request-Response

REST is a stateless, resource-oriented architectural style that uses standard HTTP methods to interact with server resources identified by URIs.

Universal browser and HTTP client support with zero additional tooling requiredStatelessness enables straightforward horizontal scaling behind load balancers

Server-Sent Events

Streaming

Server-Sent Events is a simple, HTTP-based protocol for unidirectional server-to-client streaming that provides automatic reconnection and event ID tracking out of the box.

Built-in automatic reconnection with Last-Event-ID resumption — zero client-side retry code neededStandard HTTP protocol — works seamlessly with proxies, CDNs, load balancers, and firewalls

Webhooks

Event-Driven

Webhooks are HTTP callbacks that push event notifications from a producer to a consumer's pre-registered URL when specific events occur, enabling real-time server-to-server integration without polling.

Real-time event delivery without polling — consumers are notified immediately when events occurSimple HTTP-based protocol — no special infrastructure, just standard HTTP POST requests

WebSocket

Streaming

WebSocket is a full-duplex communication protocol that enables persistent, bidirectional message exchange between client and server over a single TCP connection.

True full-duplex bidirectional communication with minimal per-message overhead (2-14 bytes)Native browser support via the standard WebSocket API — no plugins or polyfills needed

Command Palette

Search for a command to run...