Skip to main content
Back to Tags

API Design

166 items tagged with "api-design"

Filter by type:

Best Practices18

Best Practice

Google API Design Guide

Opinionated REST and gRPC design rules: resource-oriented URIs, plural nouns, pagination, errors.

Best Practice

Microsoft REST API Guidelines

Cross-company REST consistency rules (nouns, verbs, versioning, errors).

Best Practice

Stripe API Versioning Policy

Backwards-compatible evolution strategy and pinned versions for API consumers.

Best Practice

Backends for Frontends (BFF)

An architecture pattern that gives each frontend client its own tailored backend service, instead of forcing web, mobile, and other clients to share one general-purpose API.

Best Practice

API Gateway Pattern

An architecture pattern that places a single entry point in front of backend services to handle routing, authentication, rate limiting, and other cross-cutting concerns.

Best Practice

Richardson Maturity Model

A four-level model for grading how fully an HTTP API embraces REST, from RPC-style endpoints up to hypermedia controls (HATEOAS).

Best Practice

OpenAPI Specification Best Practices

Guidance for writing accurate, machine-readable OpenAPI documents that describe HTTP APIs and drive docs, client SDKs, mocks, and contract tests.

Best Practice

GraphQL API Best Practices

Practical guidance for designing GraphQL schemas and servers: typed schemas, pagination, error handling, query cost limits, and avoiding the N+1 problem.

Best Practice

gRPC Best Practices

Guidance for building high-performance gRPC services with Protocol Buffers: service design, streaming, deadlines, error codes, and backward-compatible schema evolution.

Best Practice

API-First Design

An approach that treats the API contract as a product designed before implementation, so teams agree on the interface, then build clients and servers in parallel.

Best Practice

Idempotency Keys

A pattern where clients send a unique key with unsafe requests so the server can safely retry without applying the same operation twice, preventing duplicate charges or records.

Best Practice

API Rate Limiting

Controlling how many requests a client can make in a time window to protect API capacity, ensure fair use, and defend against abuse, using algorithms like token bucket.

Best Practice

API Pagination Best Practices

Techniques for returning large result sets in pages without breaking under concurrent writes: offset, cursor (keyset), and page-token pagination, with stable ordering.

Best Practice

Webhook Best Practices

Guidance for sending and receiving reliable webhooks: signature verification, idempotent handlers, retries with backoff, and fast acknowledgement of events.

Best Practice

AsyncAPI Specification

A standard, machine-readable format for describing event-driven and message-based APIs across protocols like Kafka, MQTT, and AMQP, analogous to OpenAPI for REST.

Best Practice

Problem Details for HTTP APIs (RFC 9457)

An IETF standard JSON format for machine-readable HTTP error responses, defining fields like type, title, status, detail, and instance for consistent error handling.

Best Practice

API Backward Compatibility

Evolving an API without breaking existing clients by making only additive changes, versioning breaking changes, and deprecating fields gracefully over time.

Best Practice

JSON:API Specification

A convention for building JSON APIs that standardizes resource structure, relationships, pagination, filtering, and sparse fieldsets to reduce bikeshedding and over-fetching.

Patterns24

Pattern

Anti-Corruption Layer

Create a translation layer between new and legacy systems to prevent legacy concepts from leaking into new code

Pattern

Backend for Frontend (BFF)

Create separate backend services tailored to each frontend's needs

Pattern

Front Controller

Channels all incoming requests through a single handler that centralizes cross-cutting concerns like routing, authentication, and logging before dispatching to handlers.

Pattern

API Gateway

A single entry point that routes, aggregates, and secures client requests across many backend microservices.

Pattern

API Composition

Implements a query that spans multiple services by invoking each owner service and joining the results in memory.

Pattern

Aggregator

A component that invokes multiple services and combines their responses into a single consolidated result for the caller.

Pattern

Gateway Aggregation

Uses a gateway to combine multiple backend requests into one, so clients make a single call instead of many.

Pattern

Gateway Offloading

Moves shared cross-cutting functionality such as TLS, auth, and rate limiting out of services and into a gateway.

Pattern

Gateway Routing

Routes client requests to the correct backend service through a single endpoint using request attributes such as path or host.

Pattern

Throttling

Control the consumption of resources by an instance, tenant, or service so a system stays within capacity under load.

Pattern

Rate Limiting

Constrain the rate of operations against a service or resource to stay within quotas and avoid throttling or overload.

Pattern

Message Router

Consumes a message and redirects it to a different channel based on conditions, decoupling producers from the decision of where messages should go.

Pattern

Content-Based Router

Routes each message to a destination channel chosen by inspecting the message's content, so the payload itself determines where it is delivered.

Pattern

Message Translator

Converts a message from one data format or schema to another so systems with incompatible representations can communicate.

Pattern

Normalizer

Translates messages arriving in many different formats into a single common format so downstream components handle one canonical representation.

Pattern

Request-Reply

Lets a requestor send a message and receive a corresponding response over messaging, combining two one-way channels into a logical two-way exchange.

Pattern

Rate Limiter

Caps how many requests a client or system may make in a time window, protecting services from overload, abuse, and runaway cost.

Pattern

Idempotency Key

Attaches a unique key to a request so the server can detect and de-duplicate retries, making non-idempotent operations safe to repeat.

Pattern

Pagination

Splits a large result set into smaller pages so APIs and UIs can return and traverse data incrementally instead of loading everything at once.

Pattern

HATEOAS

Hypermedia as the Engine of Application State: REST responses include links describing available actions, letting clients navigate the API by following links.

Pattern

Idempotency Key

A client-supplied unique key lets a server detect and dedupe retried requests, so repeated submissions produce the same result exactly once.

Pattern

API Versioning

Strategies for evolving an API without breaking existing clients, by exposing multiple versions through URLs, headers, or media types.

Pattern

Webhook

A server pushes event notifications to a client-registered HTTP endpoint as events occur, replacing inefficient polling with real-time callbacks.

Pattern

Token Bucket (Rate Limiting)

A rate-limiting algorithm where requests consume tokens refilled at a steady rate, allowing controlled bursts while capping the long-run request rate.

Anti-Patterns19

Anti-Pattern

Shared Database Integration

Multiple services directly sharing the same database tables

Anti-Pattern

Stovepipe System

Independently built, siloed systems that duplicate capabilities and cannot interoperate because each was designed in isolation without shared standards.

Anti-Pattern

Swiss Army Knife

An interface or component with so many options and overloads that it tries to cover every use case, becoming hard to learn, misuse-prone, and impossible to evolve.

Anti-Pattern

Boolean Trap

Function parameters that take a bare boolean force readers to decode opaque true/false call sites, hiding intent and inviting wrong arguments.

Anti-Pattern

Long Parameter List

A function signature with too many parameters, making calls error-prone, hard to read, and a sign of poorly grouped or missing abstractions.

Anti-Pattern

Temporal Coupling

Methods that must be called in a specific hidden order, where calling them out of sequence silently breaks state with no compiler protection.

Anti-Pattern

Sequential Coupling

A class designed so its methods must be invoked in a rigid sequence, with the ordering enforced only by convention rather than by the API itself.

Anti-Pattern

Chatty I/O

Making many small, fine-grained remote or storage calls where a few coarse-grained calls would do, multiplying latency and overhead per operation.

Anti-Pattern

N+1 Network Calls

Fetching a list, then making one additional remote call per item to enrich it, so a single logical operation fans out into N+1 dependency calls.

Anti-Pattern

Overly Permissive CORS

Configuring Cross-Origin Resource Sharing to allow any origin (or reflecting any origin with credentials), exposing authenticated APIs to malicious sites.

Anti-Pattern

Missing Input Validation

Accepting and processing external input without checking its type, range, format, or size, opening the door to injection, corruption, and crashes.

Anti-Pattern

Mass Assignment

Binding incoming request data directly onto domain objects, letting attackers set fields like isAdmin or accountBalance that were never meant to be writable.

Anti-Pattern

Chatty API

An API design that forces clients to make many small round trips to complete one task, harming latency, scalability, and battery life.

Anti-Pattern

Breaking Changes Without Versioning

Changing an API's contract in place without versioning or deprecation, silently breaking existing clients and eroding trust.

Anti-Pattern

Inconsistent API Naming and Conventions

An API where naming, casing, pluralization, error formats, and conventions vary across endpoints, raising the learning curve and integration errors.

Anti-Pattern

Overfetching and Underfetching

Endpoints that return too much data or too little, forcing clients to waste bandwidth or make extra calls to assemble what they need.

Anti-Pattern

Ignoring Idempotency

Designing write operations that cause duplicate effects when retried, so network blips and client retries create double charges or duplicate records.

Anti-Pattern

Missing Pagination (Unbounded Result Sets)

Collection endpoints that return all records at once with no pagination, causing huge payloads, slow queries, and out-of-memory failures as data grows.

Anti-Pattern

Leaky API Abstraction

An API that exposes internal database schemas, implementation details, or storage structures, coupling clients to internals and blocking safe evolution.

Tutorials16

Tutorial

Building a GraphQL API from REST Endpoints

Transform your REST API into a GraphQL server with Apollo

Tutorial

How to deploy a serverless REST API on AWS Lambda

Build and deploy a production REST API using AWS Lambda and API Gateway with infrastructure as code.

Tutorial

How to build an HTTP API with Azure Functions

Create and deploy a serverless HTTP-triggered API on Azure Functions using the Azure CLI and a consumption plan.

Tutorial

How to build a REST API with Amazon API Gateway

Configure Amazon API Gateway routes, stages, and authorizers to expose backend services as a managed REST API.

Tutorial

How to deploy a Python function on Google Cloud Functions

Write and deploy an HTTP-triggered Python function on Google Cloud Functions (2nd gen) with the gcloud CLI.

Tutorial

How to Secure an API with JWT Authentication

Issue signed JWT access tokens, validate them on every request, and refresh them safely without leaking long-lived credentials.

Tutorial

How to Add Rate Limiting to an API

Protect an API with token-bucket rate limiting, return standard rate-limit headers, and share limits across instances with Redis.

Tutorial

How to Build a REST API with Best Practices

Design resource-oriented routes, use correct status codes, validate input, handle errors consistently, and version your REST API.

Tutorial

How to Document an API with OpenAPI

Write an OpenAPI specification, serve interactive docs, validate requests against the schema, and generate client code.

Tutorial

How to Build a GraphQL Server

Define a schema, write resolvers, solve the N+1 problem with batching, and add error handling and depth limits to a GraphQL API.

Tutorial

How to Build a gRPC Service

Define a service in Protocol Buffers, generate code, implement unary and streaming methods, and call the service from a client.

Tutorial

How to Implement Secure Webhooks

Send and receive webhooks with HMAC signatures, idempotency keys, retries with backoff, and replay protection.

Tutorial

How to Version an API Without Breaking Clients

Choose a versioning scheme, evolve schemas with additive changes, deprecate old versions gracefully, and communicate changes to clients.

Tutorial

How to Add Cursor-Based Pagination to a REST API

Replace offset pagination with stable cursor pagination, return navigation links, and keep results consistent under concurrent writes.

Tutorial

How to build an LLM app with function calling (tools)

Give an LLM the ability to call your functions, so it can fetch data and take actions instead of only producing text.

Tutorial

How to build a Model Context Protocol (MCP) server

Build an MCP server that exposes tools and resources to AI assistants over a standard protocol.

Blueprints10

Blueprint

REST to GraphQL Migration Blueprint

Guide for transitioning REST APIs to GraphQL architecture

Blueprint

EJB to REST Services Blueprint

Replace remote EJB interfaces with HTTP REST services to decouple clients from RMI and enable language-agnostic integration.

Blueprint

SOAP to REST API Modernization Blueprint

Modernize WSDL-based SOAP web services to REST APIs with OpenAPI contracts, JSON payloads, and OAuth 2.0 security.

Blueprint

REST API to GraphQL Federation Blueprint

Migrate a sprawling set of REST endpoints to a federated GraphQL graph so clients fetch exactly what they need from one typed endpoint.

Blueprint

REST to gRPC for Internal Services Blueprint

Replace JSON-over-HTTP calls between internal microservices with gRPC and Protocol Buffers for lower latency and strongly typed contracts.

Blueprint

Monolithic API to API Gateway Blueprint

Front a monolithic API with an API gateway to centralize auth, rate limiting, routing, and observability before decomposing services.

Blueprint

Ad-Hoc REST Versioning to API-First Contracts Blueprint

Move from unmanaged REST API changes to an API-first workflow with OpenAPI contracts, contract testing, and a backward-compatibility policy.

Blueprint

REST Polling to GraphQL Subscriptions Blueprint

Replace client REST polling for fresh data with real-time GraphQL subscriptions over WebSockets for push updates and lower load.

Blueprint

Oracle Forms to Web Application Blueprint

Modernize Oracle Forms and Reports applications into a modern web app with a REST API over the existing Oracle Database.

Blueprint

Visual Basic / WinForms to Web Application Blueprint

Modernize legacy VB6 or .NET WinForms desktop apps into a browser-based web application with a modern API backend.

Reference Architectures16

Reference Architecture

API Gateway Pattern

Centralized API management with authentication, rate limiting, and request routing

Reference Architecture

Serverless API on Azure Functions

An event-driven serverless API built on Azure Functions with Cosmos DB and API Management for pay-per-use, low-operations workloads.

Reference Architecture

Serverless API on GCP Cloud Run

A container-based serverless API on Google Cloud Run with Cloud SQL and Pub/Sub, scaling to zero while keeping standard container portability.

Reference Architecture

LLM Gateway and Proxy on Kubernetes

A reference design for a self-hosted LLM gateway on Kubernetes that centralizes routing, rate limiting, cost tracking, and guardrails across multiple model providers.

Reference Architecture

Customer Identity and Access Management Platform

Scalable CIAM design on AWS for user sign-up, social login, and token-based authorization for consumer applications.

Reference Architecture

API Gateway with Backends-for-Frontends

An edge API gateway fronting channel-specific BFF services that aggregate microservices for web, mobile, and partner clients.

Reference Architecture

Federated GraphQL Supergraph

A federated GraphQL architecture where independently owned subgraphs compose into one supergraph behind a managed gateway.

Reference Architecture

gRPC Service Mesh for Internal APIs

A high-performance internal API platform using gRPC over a service mesh for typed, low-latency service-to-service calls.

Reference Architecture

CQRS with Event Sourcing

A command-query separated system where state is derived from an append-only event log and read models are projected for queries.

Reference Architecture

Reliable Webhook Delivery Platform

A platform that delivers outbound webhooks to customer endpoints with retries, signing, idempotency, and per-tenant rate control.

Reference Architecture

Enterprise API Management Platform

A full API management platform providing a developer portal, gateway, monetization, and lifecycle governance for internal and partner APIs.

Reference Architecture

Cloud-Native REST API Platform

A versioned, API-first REST platform with contract-driven development, gateway policies, and managed data services on GCP.

Reference Architecture

GraphQL BFF Gateway for Mobile

A GraphQL backend-for-frontend that aggregates microservices and optimizes payloads for bandwidth-constrained mobile clients.

Reference Architecture

Headless CMS Content Architecture

A content repository exposing structured content over APIs to multiple front ends, decoupling authoring from presentation.

Reference Architecture

Backend-for-Frontend API Aggregation Platform

Per-client backend-for-frontend services and a GraphQL gateway that aggregate microservices into tailored, efficient API responses.

Reference Architecture

Single-Page Application with API Backend

A client-rendered SPA served from a CDN that talks to a stateless REST API, with token-based auth and a managed database.

Checklists11

Checklist

API-First Design Review Checklist

Review an API design before implementation to ensure contract, versioning, and consistency standards are met up front.

Checklist

Backward-Compatibility Review Checklist

Review a change to a service, API, or schema to confirm existing consumers and data continue to work without breaking.

Checklist

API Design Review Checklist

Review items for evaluating a new or changed HTTP API against design, consistency, and developer-experience standards.

Checklist

API Versioning and Deprecation Checklist

Verification items for introducing a new API version and retiring an old one without breaking existing consumers.

Checklist

GraphQL Migration Readiness Checklist

Readiness items for migrating a REST API or adding a GraphQL layer without losing performance, security, or observability.

Checklist

gRPC Rollout Checklist

Pre-flight items for rolling out gRPC services across a system, covering contracts, compatibility, security, and observability.

Checklist

API Security (OAuth/OIDC) Review Checklist

Security review items for an API protected by OAuth 2.0 and OpenID Connect, covering tokens, flows, scopes, and validation.

Checklist

Webhook Reliability Checklist

Verification items for delivering and consuming webhooks reliably, covering signing, retries, idempotency, and ordering.

Checklist

Third-Party Integration Cutover Checklist

Cutover items for switching to or replacing a third-party API or vendor integration with minimal disruption.

Checklist

API Rate Limiting and Throttling Readiness Checklist

Verification items for designing fair, abuse-resistant rate limiting and throttling for a public or internal API.

Checklist

Microservices API Contract Testing Checklist

Verification items for establishing consumer-driven contract testing across microservices to prevent integration breakage.

Comparisons13

Comparison

Go vs Node.js for APIs

For building HTTP and gRPC APIs, Go offers compiled performance and easy concurrency, while Node.js offers rapid development and full-stack JavaScript.

Comparison

REST in Go vs REST in Java

Building REST APIs in Go with its lean standard library versus in Java with mature frameworks like Spring Boot. Different trade-offs in speed, structure, and tooling.

Comparison

Django vs FastAPI

Django is a batteries-included framework for full web apps; FastAPI is a modern, async, type-driven framework focused on high-performance APIs.

Comparison

FastAPI vs Flask

FastAPI is async-first with type-driven validation and auto docs; Flask is a mature, synchronous microframework with a vast extension ecosystem.

Comparison

Express vs Fastify

Express is the ubiquitous, minimal Node.js framework; Fastify is a modern alternative built for higher throughput and schema-based validation.

Comparison

Gin vs Echo

Gin and Echo are two of the most popular Go web frameworks, both fast and minimal, differing mainly in API design and built-in features.

Comparison

Actix vs Axum

Actix Web and Axum are leading Rust web frameworks; Actix is feature-rich and battle-tested, Axum is built on Tower with strong type-driven ergonomics.

Comparison

REST vs GraphQL

REST exposes many resource-oriented endpoints; GraphQL exposes one typed endpoint where clients request exactly the fields they need.

Comparison

gRPC vs REST

gRPC is a contract-first, binary, HTTP/2 RPC framework; REST is a resource-oriented, text-based HTTP style. Both build service APIs.

Comparison

GraphQL vs gRPC

GraphQL is a client-driven query language for flexible APIs; gRPC is a high-performance binary RPC framework. Each targets different API problems.

Comparison

REST vs SOAP

SOAP is a rigid XML-based messaging protocol with built-in standards; REST is a lightweight resource-oriented HTTP style. Both expose web services.

Comparison

WebSockets vs Server-Sent Events

WebSockets give full-duplex bidirectional channels; Server-Sent Events provide simple one-way server-to-client streaming over HTTP.

Comparison

OpenAPI vs AsyncAPI

OpenAPI describes synchronous request/response HTTP APIs; AsyncAPI describes event-driven, message-based APIs over brokers and streams.

FAQs8

FAQ

What is the difference between REST and GraphQL?

REST exposes data through multiple fixed endpoints, each returning a predefined resource representation, and relies on HTTP verbs and status codes. Gr...

FAQ

What is gRPC and when should I use it?

gRPC is a high-performance remote procedure call framework that uses Protocol Buffers for compact binary serialization and HTTP/2 for transport, inclu...

FAQ

What is an API gateway?

An API gateway is a server that sits in front of one or more backend services and acts as a single entry point for clients. It handles cross-cutting c...

FAQ

What is rate limiting and how does it work?

Rate limiting caps how many requests a client may make in a given window to protect a service from overload, abuse, and runaway costs. Common algorith...

FAQ

What does idempotency mean in APIs?

An operation is idempotent if performing it multiple times has the same effect as performing it once. In HTTP, GET, PUT, and DELETE are defined as ide...

FAQ

What is an idempotency key?

An idempotency key is a unique client-generated identifier, often a UUID, sent with a request so the server can recognize and safely deduplicate retri...

FAQ

What is a webhook?

A webhook is a way for one system to push real-time notifications to another by sending an HTTP POST to a URL the receiver registered in advance. Inst...

FAQ

What are common API versioning strategies?

API versioning lets you evolve an interface without breaking existing clients. Common approaches are URI versioning (`/v1/orders`), which is explicit ...

Glossaries15

Glossary

API Versioning

The practice of managing changes to an API over time while maintaining backward compatibility for existing consumers

Glossary

Ingress

Ingress is a Kubernetes resource that defines rules for routing external HTTP and HTTPS traffic to internal services, typically based on hostnames and URL paths.

Glossary

Model Context Protocol (MCP)

The Model Context Protocol is an open standard that defines how AI applications connect to external tools, data sources, and prompts through a uniform interface.

Glossary

OAuth 2.0

OAuth 2.0 is an authorization framework that lets an application obtain limited access to a user's resources on another service without exposing the user's credentials, by using access tokens.

Glossary

JSON Web Token (JWT)

A JSON Web Token is a compact, URL-safe, digitally signed token that encodes claims as JSON, commonly used to transmit identity and authorization data between parties.

Glossary

GraphQL

GraphQL is a query language and runtime for APIs that lets clients request exactly the fields they need from a single endpoint, returning a precisely shaped response.

Glossary

gRPC

gRPC is a high-performance remote procedure call framework that uses HTTP/2 for transport and Protocol Buffers for compact, strongly typed message serialization.

Glossary

Webhook

A webhook is an HTTP callback that one system sends to a user-supplied URL when an event occurs, pushing data to subscribers instead of requiring them to poll for changes.

Glossary

Rate Limiting

Rate limiting is a technique that caps how many requests a client may make to a service within a time window, protecting capacity and enforcing fair usage.

Glossary

Idempotency

Idempotency is the property that performing an operation multiple times produces the same result as performing it once, making safe retries possible in distributed systems.

Glossary

Pagination

Pagination is the practice of dividing a large result set into smaller, ordered pages so that an API returns data in manageable chunks rather than all at once.

Glossary

OpenAPI

OpenAPI is a language-agnostic specification for describing HTTP APIs in a machine-readable document, enabling shared contracts, documentation, and code generation.

Glossary

JSON

JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format that represents structured data as key-value objects and arrays.

Glossary

CORS

CORS (Cross-Origin Resource Sharing) is a browser security mechanism that uses HTTP headers to let a server permit web pages from other origins to access its resources.

Glossary

Idempotent Operation

An idempotent operation produces the same result whether it is performed once or many times, so repeating it has no additional effect beyond the first successful application.