What Happens When You Type a URL and Press Enter
DNS lookups, TCP and TLS handshakes, HTTP requests, servers, and the browser's rendering pipeline. The whole journey of a web page, explained so it finally clicks.
Read →GraphQL solves real problems, and creates a few new ones. How the two compare on flexibility, caching, performance, tooling and security, and how to decide which fits your API.
GraphQL arrived with a lot of excitement and a lot of "REST is dead" headlines. Years later, both are thriving, because they're good at different things. Choosing between them is less about which is modern and more about who uses your API and how.
REST organises an API around resources and HTTP methods:
GET /users/42
GET /users/42/orders
POST /orders
PATCH /orders/991
Each endpoint returns a fixed shape that the server decides. (REST design best practices.)
GraphQL exposes a single endpoint and a typed schema. Clients send a query describing exactly the data they want:
query {
user(id: 42) {
name
orders(last: 3) {
id
total
items { productName }
}
}
}
The response mirrors the query's shape: nothing more, nothing less. Changes go through mutations, and real-time updates through subscriptions.
/users/42, then /users/42/orders, then each order's items.GET /products/42 can be cached by browsers and CDNs with standard headers. GraphQL queries typically go through POST to one URL, so caching needs extra work like persisted queries or client-side caches. (Caching strategies.)errors array, so monitoring and clients must look inside responses.| REST | GraphQL | |
|---|---|---|
| Endpoints | Many, one per resource | Usually one |
| Response shape | Server decides | Client decides |
| HTTP caching | Natural | Needs extra work |
| Typed contract | Optional (OpenAPI) | Built in |
| Learning curve | Low | Moderate |
| Best for | Public APIs, simple CRUD, caching-heavy content | Complex UIs, many clients, rapidly evolving frontends |
Choose REST when:
Choose GraphQL when:
Plenty of systems use both: GraphQL for the app's complex screens, REST for webhooks, file handling, health checks and public integrations. And with full stack frameworks where the frontend and backend live together, you might not need a general-purpose API layer at all; server functions or simple typed endpoints may be enough.
Neither is universally better. GraphQL excels when many clients need flexible data shapes; REST excels at simplicity, HTTP caching and public APIs.
It can reduce round trips and payload size, but a poorly implemented GraphQL server can be slower due to N+1 queries and expensive nested requests. Performance depends on implementation.
Yes. Many teams use GraphQL for complex app data and REST for webhooks, file uploads and public endpoints.
DNS lookups, TCP and TLS handshakes, HTTP requests, servers, and the browser's rendering pipeline. The whole journey of a web page, explained so it finally clicks.
Read →There are dozens of HTTP status codes, but about fifteen cover nearly everything. What each one means, when to return it, and the mix-ups (401 vs 403, 301 vs 302) that confuse everyone.
Read →A, AAAA, CNAME, MX, TXT and NS records in plain English, why DNS changes seem slow, and the troubleshooting commands that tell you what is really going on.
Read →