Behind the screen

Backend and APIs

The backend is the part of an app that runs on a server rather than on the visitor's phone or laptop. It checks who is asking, applies the business rules (prices, stock, permissions), talks to the database and to outside services, and sends back only what each screen needs.

A backend is usually built from a runtime (the program that runs the code, such as Node.js), a framework that turns requests into function calls, and an API style that sets how apps ask for data. Around them sit realtime channels, webhooks, scheduled jobs and queues, which keep work moving when nobody is clicking.

26 terms · 5 comparisons · prices checked September 2026

26 terms, click any to open

Runtimes

Node.js

RuntimeOpen source
The program that lets JavaScript run on a server instead of only in a browser, and the usual base for JavaScript and TypeScript backends.

Node.js takes V8, the JavaScript engine from Chrome, and adds what a server needs: files, networking, processes and timers. It handles many connections on one thread with an event loop: while one request waits for the database, Node serves others instead of sitting idle. That suits work that mostly waits on networks and disks, such as APIs, realtime apps and proxies.

It comes with npm, a registry of millions of open-source packages, and almost every JavaScript tool (Next.js, Vite, ESLint) runs on it. Recent versions include a test runner, fetch, a watch mode and the ability to run TypeScript files by stripping out the types. Heavy CPU work, such as resizing large images, blocks the event loop, so it belongs in worker threads or a separate service. Production servers usually run a long-term support (LTS) release.

Pros

  • One language, JavaScript or TypeScript, across frontend and backend
  • Huge package ecosystem on npm for almost any task
  • Handles many simultaneous connections with little memory
  • Supported by every host, cloud and serverless platform

Cons

  • CPU-heavy work blocks the event loop unless moved to worker threads
  • Deep dependency trees add security and maintenance work
  • Few conventions, so each project picks its own structure

Pick it when

  • APIs and web backends written by a JavaScript or TypeScript team
  • Realtime features such as chat, notifications and live updates
  • You want the widest choice of hosts, libraries and developers

Skip it when

  • The work is mostly heavy number crunching or machine learning, where Python, Go or Rust fit better

What it costs · Open source

Free (MIT).

Approximate, checked September 2026.

Also called: Node, NodeJS

Open Node.js as a pageOfficial site (opens in a new tab)

Deno

RuntimeOpen source
A JavaScript and TypeScript runtime from the original creator of Node.js, with TypeScript, a formatter, a linter and a test runner built in, and strict permissions by default.

Ryan Dahl started Deno in 2018 to fix what he regretted about Node.js. Like Node it runs on the V8 engine, but its core is written in Rust and it runs TypeScript directly. A script cannot read files, open network connections or see environment variables unless you allow it with flags such as --allow-net, which limits the damage a compromised package can do.

Deno 2 made it largely compatible with Node.js and npm packages, so most existing libraries now work. It prefers web-standard APIs (fetch, Request, Response), can compile a program into a single executable, and has its own package registry, JSR. Deno Deploy hosts Deno code on a global network, and Supabase Edge Functions and Netlify Edge Functions both run on Deno.

Pros

  • TypeScript, formatter, linter and test runner work with no setup
  • Permissions stop code touching files or the network without consent
  • Web-standard APIs make code easy to move to edge platforms
  • Runs most npm packages since Deno 2

Cons

  • Smaller community and fewer guides than Node.js
  • Some Node-specific packages and native add-ons still misbehave
  • Fewer hosts treat it as a first-class option

Pick it when

  • New TypeScript projects that want built-in tooling and safer defaults
  • Scripts and command-line tools that should not get full system access
  • Supabase Edge Functions and other Deno-based platforms

Skip it when

  • A large Node.js codebase with many native dependencies

What it costs · Open source

Free (MIT). Deno Deploy hosting has a free plan (about 1 million requests a month) and Pro at about $20 a month.

Deno pricing (opens in a new tab)Approximate, checked September 2026.

Also called: Deno 2, Deno Deploy, JSR

Open Deno as a pageOfficial site (opens in a new tab)

Bun

RuntimeOpen source
A JavaScript and TypeScript runtime that also installs packages, bundles code and runs tests, designed as a drop-in replacement for Node.js.

Bun is written in Zig and runs on JavaScriptCore, the engine from Safari, rather than V8. It runs TypeScript and JSX directly, starts quickly and replaces several tools at once: bun install for packages (much faster than npm), bun test for tests and bun build for bundling. It implements most Node.js APIs, so many Node apps and frameworks run on it unchanged.

It also has built-in extras that would be separate packages elsewhere: an HTTP server (Bun.serve), a SQLite driver, PostgreSQL and S3 clients, and password hashing. Anthropic acquired Bun in late 2025, and it remains open source under the MIT licence. Compatibility with Node is high but not complete, so test an app's dependencies before moving production traffic.

Pros

  • Installs packages and starts up noticeably faster than Node.js
  • One tool replaces the runtime, package manager, bundler and test runner
  • Runs TypeScript and JSX with no configuration
  • Built-in SQLite, PostgreSQL and S3 clients

Cons

  • Node.js compatibility is high but still has gaps
  • Younger, with fewer years in production behind it
  • Fewer hosts document it than Node.js

Pick it when

  • Faster installs and test runs in an existing JavaScript project
  • New TypeScript servers and scripts that want minimal setup

Skip it when

  • Dependencies rely on Node internals or native add-ons that Bun does not support yet

What it costs · Open source

Free (MIT).

Approximate, checked September 2026.

Also called: Bun.js, bun install, bunx

Open Bun as a pageOfficial site (opens in a new tab)

Frameworks

Express

FrameworkOpen source
The classic minimal web framework for Node.js: it maps URLs to functions and passes each request through a chain of middleware.

An Express app is a list of routes (app.get('/orders', handler)) and middleware functions that run in order for each request: parse the body, check the session, log, then answer. It deliberately does little else, so templates, validation, database access and authentication all come from separate packages.

Released in 2010, it is the framework most Node tutorials, courses and older codebases use, and thousands of middleware packages target it. Express 5, the first major release in a decade, arrived in 2024 and passes errors from async handlers to the error handler automatically. In benchmarks it is slower than Fastify or Hono, which rarely matters for a typical app.

Pros

  • Simple to learn, with examples for almost every problem
  • Very large middleware ecosystem
  • Unopinionated, so it fits any project structure

Cons

  • Slower than newer frameworks in raw request throughput
  • No built-in validation, types or structure; you assemble everything
  • Built around Node's own request objects rather than web standards

Pick it when

  • Small to medium Node.js APIs where familiarity matters most
  • Maintaining or extending an existing Express codebase

Skip it when

  • Edge runtimes or very high request volumes, where Hono or Fastify fit better

What it costs · Open source

Free (MIT).

Approximate, checked September 2026.

Also called: Express.js, ExpressJS

Open Express as a pageOfficial site (opens in a new tab)

Fastify

FrameworkOpen source
A Node.js web framework built for speed and structure, where each route can declare a schema that checks its input and shapes its output.

Fastify routes accept a JSON Schema for the body, query string and response. Fastify compiles those schemas into fast validation and serialisation functions, so bad input is rejected before a handler runs and responses skip slow generic JSON conversion. With a type provider such as TypeBox, the same schema also gives the handler its TypeScript types.

Everything is a plugin (database connections, auth, groups of routes), and plugins are encapsulated so one part of an app cannot accidentally change another. Logging through Pino is built in. It is an OpenJS Foundation project, and in benchmarks it handles noticeably more requests per second than Express on the same machine.

Pros

  • High throughput with low overhead
  • Validation and response shaping built in through JSON Schema
  • Encapsulated plugins keep large apps organised
  • Built-in structured logging with Pino

Cons

  • More concepts to learn (plugins, hooks, decorators) than Express
  • Smaller ecosystem than Express, though most needs are covered
  • Built for Node.js, not for edge runtimes

Pick it when

  • Busy Node.js APIs where throughput and hosting cost matter
  • Teams that want validated input and typed routes from the start

Skip it when

  • The code must run on Cloudflare Workers or other edge runtimes

What it costs · Open source

Free (MIT).

Approximate, checked September 2026.

Also called: Fastify.js

Open Fastify as a pageOfficial site (opens in a new tab)

Hono

FrameworkOpen source
A small, fast web framework built on web standards, so the same code runs on Cloudflare Workers, Deno, Bun, Node.js and serverless platforms.

Hono (Japanese for 'flame') uses the standard Request and Response objects that browsers, Deno, Bun and edge platforms share, instead of Node's own types. That lets one app deploy to Cloudflare Workers, Deno, Bun, AWS Lambda, Vercel or Node.js with a small adapter at most. The core has no dependencies, and its smallest preset is under 14 KB.

It ships middleware for common jobs (CORS, JWT checks, logging, caching, secure headers) and a validator that works with Zod. In RPC mode a typed client (hc) reads the server's route types, giving tRPC-style end-to-end type safety over plain HTTP. Its API feels familiar to anyone who has used Express.

Pros

  • Runs on almost every JavaScript runtime and edge platform
  • Tiny and quick to start, which suits serverless cold starts
  • Written in TypeScript, with an optional typed RPC client
  • Useful middleware included out of the box

Cons

  • Younger ecosystem than Express or Fastify
  • Node-only libraries may not work on the edge runtimes it targets

Pick it when

  • APIs on Cloudflare Workers, Deno Deploy, Bun or other edge platforms
  • One codebase that can move between hosts
  • Small typed APIs beside a TypeScript frontend

Skip it when

  • The app depends on a large set of Express-specific middleware

What it costs · Open source

Free (MIT).

Approximate, checked September 2026.

Also called: Hono.js

Open Hono as a pageOfficial site (opens in a new tab)

FastAPI

FrameworkOpen source
A Python framework for building APIs where ordinary type hints do the validation and interactive documentation is generated automatically.

In FastAPI an endpoint is a Python function whose parameters carry type hints or Pydantic models. FastAPI reads those hints to parse and validate the request, convert types, return clear errors and produce an OpenAPI description, which appears as interactive docs at /docs. Shared pieces such as a database session or the current user are injected with Depends.

It is built on Starlette (an ASGI toolkit) and Pydantic, supports async endpoints, and runs on an ASGI server such as Uvicorn. It has become a common way to put a Python machine-learning model or AI pipeline behind an HTTP API. It has no ORM, admin panel or templates of its own; SQLAlchemy or SQLModel usually fill the database gap.

Pros

  • Validation, conversion and docs come straight from type hints
  • Automatic interactive API docs (Swagger UI and ReDoc)
  • Async support and good performance for Python
  • Natural fit for serving Python AI and data code

Cons

  • No built-in ORM, admin or auth; you choose and wire them up
  • Blocking libraries inside async endpoints can stall the server
  • Large apps need their own structure and conventions

Pick it when

  • JSON APIs written in Python, especially with typed request bodies
  • Putting machine-learning models or AI features behind an API
  • Backends for mobile or single-page apps that need documented endpoints

Skip it when

  • Content sites that need an admin panel and server-rendered pages, where Django fits better

What it costs · Open source

Free (MIT).

Approximate, checked September 2026.

Also called: Fast API

Open FastAPI as a pageOfficial site (opens in a new tab)

Django

FrameworkOpen source
A 'batteries included' Python web framework with its own database layer, admin panel, user accounts and security protections ready from day one.

Django gives a project a standard layout and most of what a web app needs: an ORM with migrations, a generated admin site for managing data, user accounts and permissions, forms, templates, caching, and built-in defences against CSRF, XSS and SQL injection. The admin site alone saves weeks on internal tools and back-office screens.

It first appeared in 2005 at a newspaper and is looked after by the non-profit Django Software Foundation. For JSON APIs most projects add Django REST Framework or Django Ninja. Django runs on WSGI or ASGI servers and supports async views, although much of its ecosystem is still synchronous. Its conventions make projects predictable, at the cost of more weight than a micro-framework.

Pros

  • Admin panel, accounts, ORM and migrations included
  • Strong security defaults and long-term support releases
  • Mature, well documented and very stable
  • Clear conventions make projects easy to hand over

Cons

  • Heavier and more opinionated than FastAPI or Flask
  • JSON APIs need an extra package such as Django REST Framework
  • Async support is still catching up with the rest of the framework

Pick it when

  • Content sites, marketplaces and dashboards with lots of data to manage
  • Projects that need an admin panel or back office quickly
  • Teams that value conventions and long-term stability

Skip it when

  • A small API-only service, where FastAPI or Flask is lighter

What it costs · Open source

Free (BSD licence).

Approximate, checked September 2026.

Also called: Django REST Framework, DRF, Django Ninja

Open Django as a pageOfficial site (opens in a new tab)

Flask

FrameworkOpen source
A small, flexible Python web framework that handles routing and requests and leaves every other choice to you.

A Flask app can be a single file: create the app, decorate functions with @app.route and return a response. It is built on Werkzeug (the request and routing layer) and Jinja (templates), and extensions add the rest, such as Flask-SQLAlchemy for databases, Flask-Login for sessions and Flask-WTF for forms.

Armin Ronacher released it in 2010, and the Pallets project maintains it. It is a WSGI framework: async views exist, but it lacks the async-first design of FastAPI. It remains a common choice for small services, internal tools, webhook receivers and teaching, where a tiny core that is easy to read matters more than built-in features.

Pros

  • Very small core that is quick to learn and read
  • Complete freedom over structure and libraries
  • Mature, with extensions for most needs

Cons

  • Larger apps need discipline, because there is no set structure
  • No built-in validation or API docs
  • Not async-first, so FastAPI suits high-concurrency APIs better

Pick it when

  • Small APIs, webhook receivers and internal tools in Python
  • Prototypes and teaching, where a readable single file helps

Skip it when

  • You want admin, ORM and accounts ready-made (Django) or typed async APIs (FastAPI)

What it costs · Open source

Free (BSD licence).

Approximate, checked September 2026.

Also called: Flask micro-framework, Werkzeug

Open Flask as a pageOfficial site (opens in a new tab)

Laravel

FrameworkOpen source
A widely used PHP framework with a complete toolkit for databases, queues, email, sign-in and scheduled tasks.

Laravel covers most of what a web app needs in one coherent package: routing, the Eloquent ORM and migrations, Blade templates, validation, queues, a task scheduler, events, mail and notifications, file storage and testing helpers. The Artisan command line generates code and runs jobs, and starter kits add sign-in screens built with React, Vue or Livewire.

Taylor Otwell released it in 2011, and a paid ecosystem has grown around it: Laravel Cloud and Forge for hosting and servers, Nova for admin panels. Because PHP runs on nearly every host, Laravel apps are cheap to deploy. The trade-offs are a lot of framework to learn and PHP as the language, which some JavaScript-first teams would rather avoid.

Pros

  • Very complete: queues, scheduler, mail and auth all included
  • Readable, consistent APIs and thorough documentation
  • Runs on cheap PHP hosting as well as modern clouds
  • Large community, packages and video courses

Cons

  • Many framework conventions to learn at first
  • Heavy traffic needs care with caching, queues or Octane
  • Needs PHP skills, which JavaScript-only teams may lack

Pick it when

  • Full web apps, dashboards and SaaS products built by a PHP team
  • Projects that need queues, email and scheduled jobs from day one

Skip it when

  • The team works only in JavaScript or TypeScript

What it costs · Open source

Free (MIT). Laravel Cloud, the official hosting, starts at about $5 a month with usage credits included.

Laravel pricing (opens in a new tab)Approximate, checked September 2026.

Also called: Eloquent, Artisan, Laravel PHP

Open Laravel as a pageOfficial site (opens in a new tab)

Spring Boot

FrameworkOpen source
A widely used way to build backend services in Java and Kotlin, which sets up the large Spring framework with sensible defaults so a service runs with little configuration.

Spring is a long-standing Java framework for dependency injection, web APIs, data access and security. Spring Boot sits on top: add a 'starter' dependency and it configures the matching pieces automatically, embeds a web server such as Tomcat, and packages the service as one runnable file. Actuator adds health checks and metrics for production.

It is common in enterprise, banking and government backends, and pairs with Spring Data (databases), Spring Security (sign-in and permissions) and Spring Cloud (microservices). Kotlin is fully supported. The JVM uses more memory and starts more slowly than Go or Node.js, although GraalVM native images narrow that gap for containers and serverless.

Pros

  • Mature and complete for large, long-lived systems
  • Huge ecosystem for data, security, messaging and cloud
  • Strong typing and tooling in Java or Kotlin
  • Health checks and metrics built in for production

Cons

  • Higher memory use and slower start-up than lighter stacks
  • Much happens by convention, which can feel like magic
  • A lot to learn for a small project

Pick it when

  • Enterprise systems and teams already working in Java or Kotlin
  • Large backends with many integrations, queues and databases

Skip it when

  • Small APIs or serverless functions where start-up time and memory matter

What it costs · Open source

Free (Apache 2.0).

Approximate, checked September 2026.

Also called: Spring, Spring Framework

Open Spring Boot as a pageOfficial site (opens in a new tab)

Ktor

FrameworkOpen source
A lightweight Kotlin framework from JetBrains for building servers and HTTP clients, built around Kotlin coroutines.

Ktor lets a Kotlin developer write a server as a few lines of routing code and add features (authentication, JSON serialisation, WebSockets, CORS) as plugins only when needed. It is asynchronous throughout thanks to coroutines, and runs on engines such as Netty or its own CIO engine.

The same project provides the Ktor client, a multiplatform HTTP client that Kotlin Multiplatform apps use on Android, iOS, desktop and the web. Compared with Spring Boot it is smaller and more explicit, with fewer built-in integrations.

What it costs · Open source

Free (Apache 2.0).

Approximate, checked September 2026.

Also called: Ktor client, Ktor server

Open Ktor as a pageOfficial site (opens in a new tab)

Uvicorn and ASGI

ToolOpen source
Uvicorn is the server program that runs async Python web apps such as FastAPI; ASGI is the standard way such servers and frameworks talk to each other.

A Python framework does not listen on a network port by itself. A server such as Uvicorn accepts HTTP and WebSocket connections and hands each request to the app through ASGI (Asynchronous Server Gateway Interface), the async successor to WSGI, which Flask and classic Django use. Any ASGI app runs on any ASGI server, so Hypercorn, Daphne or Granian can stand in for Uvicorn.

Installed with its standard extras, Uvicorn uses uvloop and httptools for speed. In production it usually runs several worker processes, through its own --workers option or under Gunicorn, behind a reverse proxy such as Nginx.

What it costs · Open source

Free (BSD licence).

Approximate, checked September 2026.

Also called: Uvicorn, ASGI, WSGI, Gunicorn

Open Uvicorn and ASGI as a pageOfficial site (opens in a new tab)

Pydantic

LibraryOpen source
A Python library that checks and converts data using ordinary type hints, turning messy input such as JSON into trusted, typed objects.

You describe data as a class with typed fields (name: str, age: int), and Pydantic validates incoming data against it: it converts '42' to 42 where that is safe and raises clear errors where it is not. Models can also produce JSON Schema and serialise back to JSON.

FastAPI is built on it, as are many AI libraries that need structured output, including the official OpenAI and Anthropic Python SDKs. Version 2 moved the core into Rust (pydantic-core), which made validation much faster. pydantic-settings loads configuration from environment variables the same way.

What it costs · Open source

Free (MIT).

Approximate, checked September 2026.

Also called: pydantic-core, pydantic-settings, BaseModel

Open Pydantic as a pageOfficial site (opens in a new tab)

API styles

REST API

Pattern
The usual style of web API: each kind of thing has its own URL, and standard HTTP methods such as GET and POST read and change it.

In a REST API, resources live at URLs (/orders, /orders/42) and HTTP methods say what to do: GET reads, POST creates, PUT or PATCH updates, DELETE removes. Status codes report the result (200 OK, 404 Not Found) and bodies are usually JSON. Each request carries everything the server needs, such as a token, so any server in a group can answer it.

Roy Fielding described REST in 2000, and it became the default because it needs nothing beyond HTTP: browsers, phones, scripts and other servers can all call it, and CDNs can cache its responses. An OpenAPI document describes the endpoints and can generate docs and typed clients. The weak spot is fit: one screen may need several calls, or receive far more data than it uses.

Pros

  • Works with any language, tool or device that speaks HTTP
  • Simple to understand, test and debug with a browser or curl
  • Standard HTTP caching, status codes and tooling apply
  • OpenAPI can generate documentation and typed clients

Cons

  • Screens often need several requests or get more data than needed
  • No built-in contract, so types and docs drift without OpenAPI
  • Versioning and consistent naming take discipline

Pick it when

  • Public or partner APIs that anyone should be able to call
  • Most app backends, especially with several kinds of client
  • Straightforward create, read, update and delete on clear resources

Skip it when

  • Many clients need very different slices of deeply linked data (consider GraphQL)

Also called: REST, RESTful API, OpenAPI, Swagger

Open REST API as a page

GraphQL

ProtocolOpen source
A query language for APIs where the app asks one endpoint for exactly the fields it needs and gets data back in that same shape.

A GraphQL server publishes a typed schema of everything it offers: users, orders, their fields and how they link. A client sends a query naming just the fields it wants, even across related records (a user with their last three orders), and receives exactly that in one round trip. Mutations change data and subscriptions push live updates.

Facebook built it in 2012 for its mobile apps and released it in 2015; the GraphQL Foundation now looks after the specification. Common tools include Apollo, GraphQL Yoga and Relay, while Hasura, PostGraphile and Supabase's pg_graphql generate an API from a database. The flexibility has costs: caching is harder than with REST, and servers must guard against slow nested queries and the N+1 problem.

Pros

  • Clients fetch exactly the data a screen needs in one request
  • A strongly typed schema doubles as documentation
  • One API serves web, mobile and partners with different needs
  • Tooling generates typed client code from the schema

Cons

  • More complex to build, secure and monitor than REST
  • HTTP and CDN caching do not work out of the box
  • Deeply nested queries can overload the server without limits

Pick it when

  • Several clients (web, iOS, Android) need different views of the same data
  • Deeply connected data, such as social graphs or large catalogues

Skip it when

  • A small API with one client, where REST or tRPC is simpler
  • Caching public responses on a CDN matters a lot

What it costs · Open source

Free: an open specification with open-source servers and clients.

Approximate, checked September 2026.

Also called: GQL, Apollo, GraphQL API

Open GraphQL as a pageOfficial site (opens in a new tab)

tRPC

LibraryOpen source
A TypeScript library that lets the frontend call backend functions directly with full type checking, without writing a schema or generating code.

With tRPC you write procedures on the server (queries, mutations and subscriptions), usually checking their input with Zod, and group them into a router. The client imports only the router's type, so every call from the browser is checked by the TypeScript compiler: rename a field on the server and the frontend stops compiling until it is fixed.

Under the hood it sends ordinary HTTP requests with JSON and can batch several calls into one. Adapters connect it to Next.js, Express, Fastify and serverless platforms, and it pairs with TanStack Query for caching on the client. It only works when both ends are TypeScript in the same codebase or monorepo, so it does not suit public APIs or apps written in other languages.

Pros

  • End-to-end type safety with no schema or code generation
  • Very quick to build with in a full-stack TypeScript app
  • Changes that break the frontend are caught at compile time

Cons

  • Both client and server must be TypeScript
  • Poor fit for public APIs or third-party clients
  • Couples the frontend tightly to the backend's code

Pick it when

  • Full-stack TypeScript apps, such as Next.js with its own API
  • Monorepos where one team owns both frontend and backend

Skip it when

  • Other companies, languages or native mobile apps will call the API

What it costs · Open source

Free (MIT).

Approximate, checked September 2026.

Also called: TypeScript RPC

Open tRPC as a pageOfficial site (opens in a new tab)

gRPC

ProtocolOpen source
An efficient, strictly typed way for services to call each other's functions over the network, using compact binary messages instead of JSON.

You describe services and messages in a .proto file, and gRPC's tools generate client and server code in many languages (Go, Java, Kotlin, Python, C#, Node.js and more). Calls travel over HTTP/2 as Protocol Buffers, a binary format that is smaller and quicker to parse than JSON. Besides simple request and response, it supports streaming in either direction or both at once.

Google created it from its internal RPC system and open-sourced it in 2015; it is now a Cloud Native Computing Foundation project. It is common between microservices and in some mobile and device clients. Browsers cannot speak it directly, so web apps need gRPC-Web or the Connect protocol through a proxy, and binary traffic is harder to inspect than JSON.

Pros

  • Compact binary messages and HTTP/2 make calls efficient
  • Strict contracts in .proto files, with generated code in many languages
  • Built-in streaming in both directions

Cons

  • Browsers need gRPC-Web or Connect and a proxy
  • Binary payloads are harder to read and debug by hand
  • More setup than a JSON API for small projects

Pick it when

  • Internal traffic between microservices written in different languages
  • High-volume or streaming connections where efficiency matters

Skip it when

  • A public API called straight from browsers or by third parties

What it costs · Open source

Free (Apache 2.0).

Approximate, checked September 2026.

Also called: Protocol Buffers, protobuf, gRPC-Web

Open gRPC as a pageOfficial site (opens in a new tab)

Realtime

WebSockets

ProtocolFree
A connection that stays open between a browser or app and a server so either side can send a message at any moment, which is how chat and live collaboration work.

A WebSocket starts as an ordinary HTTP request that asks to 'upgrade', then becomes a two-way channel over the same connection (ws://, or wss:// when encrypted). Either side can push small messages with very little overhead, so the client no longer has to keep asking whether anything has changed. The protocol was standardised in 2011 and every modern browser supports it.

Libraries such as ws and Socket.IO (which adds rooms and automatic reconnection) run it on Node.js, and services such as Supabase Realtime, Pusher and Ably host it for you. Open connections are the hard part: a server must keep thousands of them alive, reconnect dropped clients and share messages across machines, and many serverless platforms cannot hold connections open at all.

Pros

  • True two-way messaging with very little delay
  • Supported natively by every modern browser
  • Efficient for frequent small messages

Cons

  • Long-lived connections need servers that stay running
  • Reconnection, scaling across servers and auth need extra work
  • Some proxies and corporate networks interfere with them

Pick it when

  • Chat, multiplayer games and collaborative editing
  • Both sides send messages often

Skip it when

  • Updates only flow from server to browser, where SSE is simpler
  • Updates are rare, so checking now and then is enough

What it costs · Free

Free: it is a web standard. Hosted realtime services charge by connections and messages.

Approximate, checked September 2026.

Also called: WebSocket, ws, wss, Socket.IO

Open WebSockets as a pageOfficial site (opens in a new tab)

Server-Sent Events (SSE)

ProtocolFree
A simple way for a server to stream updates to a browser over one long HTTP response, used for live feeds, notifications and AI answers that appear word by word.

The browser opens a connection with the EventSource API, and the server keeps the response open, writing short text messages (content type text/event-stream) whenever something happens. If the connection drops, the browser reconnects on its own and can tell the server the last event it received. Data flows one way only; the browser still sends anything of its own with normal requests.

Because it is plain HTTP, SSE passes through most proxies, CDNs and load balancers and needs no special server. The OpenAI, Anthropic and Gemini APIs stream model output this way. Over HTTP/1.1 a browser allows only about six open connections per site across all tabs, a limit HTTP/2 removes, and messages are text only.

Pros

  • Simpler than WebSockets for one-way updates
  • Automatic reconnection built into the browser
  • Plain HTTP, so it works with most hosts and proxies

Cons

  • Server to client only, with no messages from the browser
  • Text only, and HTTP/1.1 limits open connections per site

Pick it when

  • Streaming AI responses, logs or progress to a browser
  • Live scores, feeds and notifications

Skip it when

  • The client also needs to send frequent messages (use WebSockets)

What it costs · Free

Free: part of the web platform.

Approximate, checked September 2026.

Also called: SSE, EventSource, event stream, text/event-stream

Open Server-Sent Events (SSE) as a pageOfficial site (opens in a new tab)

WebRTC

ProtocolFree
Technology built into every modern browser for live video, audio and data straight between users, with nothing to install. Libraries bring the same to Android and iOS apps.

A web page asks for the camera and microphone (getUserMedia) and opens an RTCPeerConnection to the other person. Media travels as encrypted SRTP, usually straight from peer to peer over UDP, with Opus for audio and VP8, VP9, H.264 or AV1 for video. Data channels carry chat messages, files or game state over the same connection.

WebRTC deliberately leaves signalling to you: before connecting, the two sides must swap connection details (SDP offers and answers) through your own server, usually over WebSockets. To get past home routers and firewalls it uses ICE, which tries direct routes discovered with STUN servers and falls back to TURN servers that relay the media. A share of calls always needs a relay, so production apps budget for TURN.

Peer to peer suits one-to-one calls. Group calls usually go through an SFU (selective forwarding unit), a server that receives each person's stream once and forwards it to everyone else; LiveKit, Janus, mediasoup and Cloudflare Realtime provide one. Google Meet and Discord both run on WebRTC.

Pros

  • Built into browsers, so people need no app or plugin
  • Encryption is mandatory for all audio, video and data
  • Low delay, designed for live conversation
  • Free and open, with open-source libraries for mobile and servers

Cons

  • Signalling is left to you, so there is still a server to build
  • Needs STUN and TURN servers, and relayed traffic costs money
  • Group calls need an SFU, because pure peer to peer stops scaling after a few people
  • Differences between browsers and networks make problems hard to debug

Pick it when

  • Video or audio calls inside a web or mobile app
  • Screen sharing, live tutoring or consultations in the browser
  • Low-delay peer-to-peer data, such as multiplayer games or file transfer

Skip it when

  • Broadcasting one stream to thousands of viewers, where HLS is simpler and cheaper
  • Text messages only, with no audio or video, where WebSockets are simpler

What it costs · Free

Free and built into browsers. TURN relays cost money: coturn is free software but needs a server and bandwidth, and Cloudflare's TURN service charges about $0.05 per GB after the first 1,000 GB each month.

WebRTC pricing (opens in a new tab)Approximate, checked September 2026.

Also called: Web Real-Time Communication, RTCPeerConnection, getUserMedia, STUN, TURN, ICE, SFU

Open WebRTC as a pageOfficial site (opens in a new tab)

Jobs and glue

Webhooks

Pattern
A message one service sends to your server the moment something happens, such as a payment succeeding, so your app does not have to keep asking.

You give a service (Stripe, Razorpay, GitHub, a form tool) a URL on your server. When an event occurs, it sends an HTTP POST to that URL with the details as JSON, and your endpoint updates the order, sends the email or starts the build. Payments depend on them: the webhook, not the browser's redirect, is the reliable signal that money arrived.

Because the URL is public, anyone could post to it, so senders sign each request (usually an HMAC with a shared secret) and your code must check that signature. Senders retry when an endpoint fails or is slow, so the same event can arrive twice: reply with a 2xx status quickly, hand slow work to a queue and make handlers idempotent. The Stripe CLI and tunnelling tools forward webhooks to a laptop for testing.

Pros

  • Instant updates without polling
  • Simple: an HTTP endpoint that accepts POST requests
  • Works on serverless platforms, since each event is one request

Cons

  • Endpoints must verify signatures or they can be faked
  • Events can arrive twice, late or out of order
  • Harder to test locally without a tunnel or CLI

Pick it when

  • Reacting to payments, subscriptions and refunds
  • Connecting services, such as Git pushes that trigger deploys

Skip it when

  • The receiver is a browser or phone, which cannot expose a public URL (use push or WebSockets)

Also called: webhook, HTTP callback

Open Webhooks as a page

Cron jobs

Concept
Tasks that run automatically on a schedule, such as a nightly backup or an hourly report, named after the Unix program that runs them.

A cron schedule has five fields: minute, hour, day of month, month and day of week. So '0 2 * * *' means 2 a.m. every day and '*/15 * * * *' means every fifteen minutes. On a server, the cron program reads these lines from a crontab file and runs each command at the matching times.

Serverless apps have no always-on machine, so hosts offer their own versions: Vercel Cron Jobs, Cloudflare Cron Triggers, GitHub Actions schedules, pg_cron inside PostgreSQL and QStash schedules. Most run in UTC, may start a little late and can overlap a previous run that has not finished, so jobs should be safe to run twice.

Also called: cron, crontab, scheduled jobs, cron expression

Open Cron jobs as a page

Queues and background jobs

Pattern
A way to hand slow work, such as sending emails or processing videos, to a separate worker so the app can answer the user straight away.

Instead of doing everything inside the request, the app adds a job to a queue ('send the receipt for order 42') and responds at once. Worker processes take jobs off the queue and run them, retrying with growing delays when something fails and moving jobs that keep failing to a dead-letter queue for someone to inspect.

Common tools include BullMQ (Node.js on Redis), Celery (Python), Laravel's queues, Amazon SQS, RabbitMQ and Cloudflare Queues, plus HTTP-based services such as QStash, Inngest and Trigger.dev that suit serverless apps. Most deliver each job at least once, so a job can occasionally run twice and its handler should be idempotent.

Also called: job queue, background jobs, workers, BullMQ, Celery, SQS

Open Queues and background jobs as a page

Rate limiting

Pattern
Capping how many requests a user, key or IP address can make in a period of time, to stop abuse, brute-force attacks and runaway costs.

A rate limiter counts requests per key (a user id, an API key, an IP address) in a time window and rejects the excess with HTTP 429 Too Many Requests, often with a Retry-After header. Common algorithms are fixed windows, sliding windows and the token bucket, which allows short bursts while holding the long-run average.

Counters usually live in a fast shared store such as Redis, so every server sees the same numbers; Upstash offers a ready-made library for serverless apps, and Cloudflare and API gateways can enforce limits before traffic reaches the app. Sign-in, OTP and password-reset endpoints, and anything that calls a paid AI model, need limits most.

Also called: throttling, 429 Too Many Requests, token bucket

Open Rate limiting as a page

Middleware

Pattern
Code that runs on every request before or after the main handler, for jobs such as logging, checking sign-in, adding headers and handling errors.

A web framework passes each request through a chain of middleware functions. Each one can read or change the request, stop it (for example with a 401 when there is no valid session) or pass it on to the next with a call such as next(). Order matters: the body must be parsed before it is validated, and the user checked before any route that needs one.

Express, Hono, Django, Laravel and ASP.NET all work this way, and Fastify offers the same idea as hooks. Next.js has a similar layer that runs before a page is served, renamed proxy in Next.js 16. The word also has an older, broader meaning: any software that sits between systems, such as a message broker.

Also called: middleware chain, request pipeline, interceptors

Open Middleware as a page

Side by side

Differences

How the options in this area compare on the questions that usually decide the choice.

Three runtimes for JavaScript and TypeScript on the server. Much of the same code runs on all three; they differ in built-in tools, security defaults, speed and how long each has been used in production.

CompareNode.jsDenoBun
What it isThe original server-side JavaScript runtimeA runtime with safe defaults and built-in toolsRuntime, package manager and bundler in one
EngineV8 (from Chrome), written in C++V8, with a core written in RustJavaScriptCore (from Safari), written in Zig
TypeScriptRuns plain TypeScript by stripping typesBuilt inBuilt in
Security defaultsFull access unless its permission model is onNo file, network or env access without flagsFull access, like Node.js
npm packagesThe native home of npmMost work, since Deno 2Most work, with some gaps
Built-in toolsTest runner and watch modeFormatter, linter, test runner, compilerPackage manager, bundler, test runner
In use since20092020 (version 1.0)2023 (version 1.0)
Best forProduction apps that need the widest supportNew TypeScript projects and edge functionsFast installs, tests and fresh projects

How to choose

  • Pick Node.js for production systems where compatibility, hosting options and hiring matter most.
  • Pick Deno for new TypeScript projects that want built-in tooling and permission checks, or for Deno-based platforms such as Supabase Edge Functions.
  • Pick Bun to speed up installs, tests and scripts, and test dependencies carefully before running it in production.

Three JavaScript web frameworks with a similar feel. Express is the long-standing default, Fastify focuses on throughput and structure, and Hono is built on web standards so it can run almost anywhere.

CompareExpressFastifyHono
Runs onNode.js (and Bun)Node.jsWorkers, Deno, Bun, Node.js, Lambda
SpeedSlowest of the three, fine for most appsHigh throughput on Node.jsHigh throughput, tiny footprint
ValidationAdd a library such as ZodJSON Schema built inValidator middleware, works with Zod
TypeScriptCommunity type definitionsTypes included, typed schemasWritten in TypeScript, typed RPC client
EcosystemLargest, thousands of middlewareSolid plugin ecosystemGrowing, with many built-in middleware
Learning curveLowestModerate (plugins, hooks)Low, with an Express-like API
Best forFamiliar, simple Node.js APIsBusy Node.js APIsEdge and multi-runtime APIs

How to choose

  • Pick Express when familiarity and the size of its ecosystem matter more than speed.
  • Pick Fastify for high-traffic Node.js APIs that benefit from schemas and a plugin structure.
  • Pick Hono for Cloudflare Workers, Deno, Bun or any project that may move between runtimes.

Three widely used Python web frameworks. Django includes almost everything, Flask includes almost nothing, and FastAPI focuses on typed, self-documenting APIs.

CompareFastAPIDjangoFlask
What it isAsync framework for typed APIsFull-stack, batteries includedMinimal micro-framework
Built onStarlette, Pydantic, ASGIIts own stack, on WSGI or ASGIWerkzeug and Jinja, on WSGI
DatabaseBring your own (SQLAlchemy, SQLModel)Built-in ORM and migrationsBring your own (Flask-SQLAlchemy)
Admin panelNoneBuilt inThrough extensions
API docsAutomatic OpenAPI and Swagger UIThrough DRF or Django NinjaThrough extensions
AsyncNativeSupported, still maturingLimited
Learning curveLow for APIsSteeper, many conventionsLowest to start
Best forJSON APIs and AI model servingContent sites, marketplaces, back officesSmall apps, webhooks, prototypes

How to choose

  • Pick FastAPI for JSON APIs, especially ones that serve Python AI or data code.
  • Pick Django when the product needs an admin panel, accounts and a database layer from day one.
  • Pick Flask for small services and prototypes where a tiny, flexible core is enough.

Four ways for apps and services to ask a backend for data. They differ in who can call them, how strictly the contract is typed, and what travels over the wire.

CompareRESTGraphQLtRPCgRPC
ShapeA URL for each resourceOne endpoint; queries name the fieldsTypeScript functions called over HTTPFunctions defined in .proto files
Data formatUsually JSONJSONJSONProtocol Buffers (binary)
ContractOptional (OpenAPI)Typed schema, requiredInferred from TypeScript code.proto files, required
ClientsAnything that speaks HTTPAny language, with client librariesTypeScript onlyMany languages; browsers need a proxy
CachingStandard HTTP and CDN cachingNeeds client-side cachingClient-side, often TanStack QueryNot cached by HTTP tools
Best forPublic APIs and most appsMany clients needing different dataFull-stack TypeScript appsTraffic between services
Watch out forOver- or under-fetching dataComplexity and expensive nested queriesTies both ends to TypeScriptHarder debugging and browser support

How to choose

  • Pick REST for public APIs and whenever many kinds of client will call the backend.
  • Pick GraphQL when several apps need different views of deeply linked data.
  • Pick tRPC when one team writes both ends in TypeScript and wants types to flow automatically.
  • Pick gRPC for efficient, strictly typed calls between internal services.

Three ways to deliver news the moment it happens. WebSockets and SSE push updates to browsers and apps; webhooks push events from one server to another.

CompareWebSocketsSSEWebhooks
DirectionBoth waysServer to browser onlyOne service to your server
ConnectionKept openKept open as one long HTTP responseA new HTTP request per event
ReceiverBrowsers, apps and serversBrowsersA public URL on your server
Browser APIWebSocketEventSourceNone; it is server to server
ReconnectsYour code or a library handles itAutomaticThe sender retries failed deliveries
HostingLong-running server or a hosted serviceMost HTTP hosts; serverless time limits applyAny HTTP endpoint, serverless included
Typical useChat, games, collaborative editingAI streaming, live feeds, progressPayments, Git pushes, form submissions

How to choose

  • Pick WebSockets when both sides talk often, as in chat or multiplayer.
  • Pick SSE when only the server sends updates, such as streaming an AI answer or a live feed.
  • Pick webhooks to hear about events in another company's system, such as a payment or a push to GitHub.

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.