System Design Nuggets

System Design Nuggets

Polling vs. WebSockets vs. Webhooks: Designing Real-Time Architectures

Master API selection for system design interviews. Learn the mechanics and trade-offs of REST, GraphQL, gRPC (Protocol Buffers), WebSockets, and Webhooks for scalable microservice architecture.

Arslan Ahmad's avatar
Arslan Ahmad
Feb 21, 2026
∙ Paid

Modern software applications rarely exist as single isolated programs. They are typically built as massive collections of smaller independent software components. These independent components operate on completely different servers and must share data continuously.

When these disconnected systems attempt to communicate without strict rules, massive integration chaos occurs.

Software engineers would have to write custom integration code for every single new connection. This lack of standardization creates highly fragile systems that break easily under heavy network traffic.

Application Programming Interfaces solve this exact technical problem.

An API establishes strict structural rules and standardized protocols for network communication.

Choosing the correct API architectural style determines how fast data moves across the network. It directly impacts server load, network bandwidth, and overall application scalability.

Understanding these distinct communication patterns is critical for building highly reliable distributed systems.

A solid grasp of these architectures demonstrates a clear understanding of modern software engineering.

To receive all the latest articles and guides, subscribe to my publication.

1. REST Architecture

REST stands for Representational State Transfer. It is currently the most widely adopted architectural style for standard web communication.

This architecture treats all system data as individual and distinct entities called resources.

A resource might be a user authentication record or a standard database entry.

Every single resource receives a specific and unique network address. System designers refer to these digital network addresses as endpoints.

An endpoint looks exactly like a standard web URL pointing to a specific server location. Client applications interact with these endpoints to retrieve or modify the underlying data.

How It Works Behind The Scenes

A client application initiates the interaction by sending an HTTP request to a specific endpoint. This request uses standard HTTP verbs to declare the exact desired action. A GET request asks the server to retrieve existing data from the database.

A POST request tells the server to create a completely new data record entirely.

Furthermore, a PUT request modifies existing data, and a DELETE request removes the data permanently.

The receiving server intercepts this incoming HTTP request and parses the instruction. It then routes the request to the internal database to fetch the required resource.

The server formats the resulting data into a plain text format called JSON.

JSON stands for JavaScript Object Notation. It is a lightweight data format that organizes information into simple key and value pairs. The server wraps this JSON data into a response payload and transmits it back across the network.

Why Choose REST?

A critical rule defining REST architecture is statelessness.

The server retains absolutely no memory of previous client interactions. Every individual request must contain all the necessary authorization tokens to process the action independently.

Because the server does not store active session data, engineers can easily scale the system by adding more servers.

However, REST struggles heavily with data efficiency due to fixed endpoints.

Over-fetching occurs when a server sends back a massive data object, but the client only needs one single field.

This wastes valuable network bandwidth.

Under-fetching happens when a single endpoint does not provide enough complete data, forcing multiple sequential network requests.

2. GraphQL Architecture

Software engineers developed GraphQL specifically to solve the strict data retrieval limitations found in standard REST architectures.

GraphQL operates as a highly specialized data query language and an execution engine. It fundamentally changes how client applications request data from a backend server.

Keep reading with a 7-day free trial

Subscribe to System Design Nuggets to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2026 Arslan Ahmad · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture