← Lessons

quiz vs the machine

Silver1050

System Design

REST API Design Principles

The handful of constraints that make an HTTP API feel predictable and easy to consume.

4 min read · intro · beat Silver to climb

What REST asks of you

REST is a style for designing networked APIs around resources rather than actions. A resource is a noun your system owns, like an order or a user, and you interact with it through a small, fixed set of HTTP methods.

The core constraints

  • Client server: the client and server evolve independently behind a stable contract.
  • Statelessness: each request carries everything the server needs, so no session state is stored between calls.
  • Uniform interface: the same methods and status codes mean the same thing everywhere.
  • Cacheability: responses say whether they can be reused, which cuts load.

Why it matters

Statelessness lets you put any request on any server, which is what makes horizontal scaling simple. A uniform interface means a new developer can guess how an endpoint behaves before reading docs.

The trade off is that REST maps awkwardly onto operations that are not simple noun changes, like sending an email or running a report.

Key idea

REST organizes an API around stateless operations on named resources, which makes it scalable and predictable.

Check yourself

Answer to earn rating on the learn ladder.

1. Why does statelessness help an API scale horizontally?

2. What is the central abstraction in REST?