Files, not a database

A CTXR site is a folder with four roots, one kind of file each: content is a JSON file per thing (data/), templates are PHP files (theme/), images and other served files are just that (assets/), and the site’s own rules for the agents that work on it are markdown (guide/). There is no database, and nothing that behaves like one behind the scenes.

The choice

A database is a second world with its own language, backup, failure modes and need for an interface in front of it. Files are the scope the operating system, version control, an editor, a web server and an AI agent already share. CTXR put the data there. Everything above — rendering, checking, history, access — reads from the files and never replaces them.

What it buys

Recovery is copying. A site is restored, moved or cloned by copying a folder: no dump to import, no migration to run. See Reliability and recovery.

History is free. Every change is a diff; every earlier state is a commit. Undo, audit trail and backup are one mechanism. See History and undo.

Nothing is hidden. An agent, a developer or an auditor sees the entire state of the site by listing a folder — and the live folder is the site’s public address book: /data/<type>/<x>.json is that file, served as it lies. No table only the application can read; no cache that has to be warm.

Ownership is literal. “Your content is yours” is not a licence clause; it is the fact that it sits in a folder you can pick up. See Your content is yours.

What it costs

Queries. A database is good at “all articles from 2025 by this author, sorted by date”; a folder is not. CTXR answers with curation and one index: lists are ItemLists an editor maintains, and the index for machines (/data.json) is a full projection with a word search over it (?q=, or the MCP’s search) — hits, then the file. A filter words cannot express is the reader’s own work over the type’s index. For the size of site CTXR is built for — a company, an organisation, a body of knowledge, not a marketplace — that is the right trade. A site that needs a real query engine needs a different tool.

The rule that follows

Because the files are the truth, a wrong state is fixed by fixing the file, and wrong behaviour by fixing the engine. State faults are file faults, behaviour faults are logic faults — that distinction keeps a CTXR site understandable when something goes wrong.