Static vs Dynamic Websites, APIs, and Web Services
Objectives
By the end of this lesson, you should be able to:
- Distinguish a static website from a dynamic one
- Explain what an API is, in plain terms
- Explain the difference between a website and a web service
💡 Why this matters: This course is entirely about building the dynamic, data-driven side of the web, not fixed pages. Being clear on what makes a site “dynamic,” and what an API actually is, sets up every module that follows.
Static Websites
A static website returns the exact same HTML for every visitor, every time, nothing on the server changes what gets sent back. A simple portfolio page or a documentation site with fixed content is often static: the server’s job is just to hand back a file that already exists, no real “processing” involved.
Static sites are simple and fast, but they can’t personalize content, respond to user input, or reflect data that changes over time (like a live inventory count) without rebuilding the whole site.
Dynamic Websites
A dynamic website builds its response on the fly, differently depending on the request. Logging into an account, seeing your own order history, searching for a product, all of these need the server to actually do work, usually involving a database, and construct a response specific to that request.
Everything this course builds, an Express server handling routes, reading data, rendering views with real content, is dynamic by definition. The server isn’t just handing back a fixed file, it’s computing a response.
APIs and Web Services
An API (Application Programming Interface) is a defined way for one program to talk to another. A web API specifically is an API accessed over HTTP, the same protocol from Lesson 3, exposing certain functionality or data for other programs (not necessarily a human in a browser) to use.
A web service is closely related, a program running on a server that provides functionality to other programs over a network, usually via a web API. In practice, “web API” and “web service” are often used almost interchangeably in casual conversation, though “web service” sometimes implies a broader system, while “API” refers more specifically to the interface itself.
Website vs Web Service
A traditional website is built to be read by a human, through a browser, rendering HTML meant for eyes. A web service (exposing a web API) is built to be consumed by another program, a mobile app, a different backend, a frontend JavaScript application, returning structured data (commonly JSON) rather than a rendered page.
This course covers both: Module 6 covers rendering real HTML for humans (server-rendered views), and the REST API design module later covers building a proper web service, returning structured JSON data instead. Modern backend development regularly involves both, sometimes even in the same application.
Try It
- Give an example of a static site and a dynamic site you’ve used recently, and explain what makes each one static or dynamic.
- Explain, in your own words, the difference between a website and a web service.
- Explain why a search feature (“find all products matching ‘mouse’”) can’t be implemented as a static site.
Recap
- A static site returns identical content for every request, a dynamic site computes a response specific to each request.
- An API is a defined way for programs to talk to each other, a web API does this over HTTP.
- A website is built for humans in a browser, a web service is built for other programs to consume, usually returning structured data like JSON.
Next lesson: REST vs GraphQL, a high-level preview of two common ways to design a web API.