RESTGraphQLgRPCProtobufWebSocketsAPI DesignSystem Design

Design Paradigms

REST, GraphQL, gRPC, and WebSocket APIs — understand when and why to use each paradigm, their trade-offs, and how to make the right choice for your system.

30 min read10 sections
01

The Big Picture — What Are Design Paradigms?

A design paradigm is the communication style your API uses. Just like humans communicate differently depending on context — a formal letter, a quick text, a phone call, a live conversation — APIs have different paradigms optimized for different situations.

There is no single "best" paradigm. Each one exists because it solves a specific set of problems better than the others. The skill is knowing which one to reach for and why.

🍽️

The Restaurant Analogy

REST is a fixed menu — you pick item #12, you get exactly item #12. Simple, predictable, everyone understands it. GraphQL is a custom order — you tell the chef exactly what you want: 'I want the steak, but only the sauce from dish #5, and the side from dish #8.' You get precisely what you asked for, nothing more. gRPC is kitchen-to-kitchen communication — two chefs in connected kitchens passing dishes through a high-speed window. They speak a compact, pre-agreed language (protobuf) that's fast but not meant for customers. WebSockets is a live conversation with the chef — the kitchen door stays open. The chef can call out 'Your appetizer is ready!' without you asking. Both sides talk whenever they want.

🔥 Key Insight

The paradigm you choose shapes everything — how clients consume your API, how you handle errors, how you cache, how you scale. It's not just a technical choice; it's an architectural decision that affects every team that touches the API.

1 / 10