Websites · Compared
Headless CMS vs a database of the site's own
A headless CMS is a hosted editing tool that stores content such as pages, posts and product descriptions and serves it to a website through an API. A site's own database stores rows that visitors create and change, such as orders, bookings and member accounts, with rules about who may read each row. Content sites lean on a CMS; sites that take actions need a database.
A headless CMS is built for people editing words and pictures; a database is built for visitors creating records. Most small business sites need one of these much more than the other, and some need both.
Nuwan Madhusanka · Co-founder
6 min read · Published
| Factor | Headless CMS | Site's own database |
|---|---|---|
| Built for | Editors writing and publishing content | Visitors and staff creating and updating records |
| Typical data | Pages, posts, product copy, images | Orders, bookings, members, messages |
| Who writes | A few editors | Every visitor who signs up, books or buys |
| Access rules | Draft or published, editor roles | Per row: own records, public rows, admins |
| Transactions | Not designed for them | Locks, constraints and all or nothing saves |
| Cost as you grow | Seats, content entries and API calls | Database size, compute and storage |
| Lock in | Content model tied to the vendor's API | Standard SQL that can be dumped and moved |
The core difference
The two tools answer different questions. A headless CMS answers "how do editors change what the site says?" It gives them a friendly editing screen, drafts, previews, scheduled publishing and image handling, and the website fetches the published content through an API. "Headless" means it has no front end of its own; your site supplies the design. A database answers "how does the site remember what visitors do?" When someone books a table, joins a waitlist, places an order or posts in a community, a row is created that belongs to them, may be private, and may need to be checked against other rows, such as a booking that must not overlap another. A CMS can store a contact form message, but it is not designed for many people writing at once, for rules that say each person sees only their own rows, or for a payment status that must change exactly once.
How each one works behind a page
With a headless CMS, an editor writes a post and presses publish. The website either fetches the post when a visitor opens the page or, more often, rebuilds static pages when content changes, which keeps pages fast. Visitors only ever read. With a database, the page itself reads and writes. A booking page asks for free slots, the visitor picks one, and the site saves a booking row; the database refuses it if another booking already holds that time. Access is decided per row: anyone may read services, only the person who made a booking may read it, and only staff may confirm it. Changes that must happen together, such as taking the last ticket and creating the order, run in one transaction so neither happens without the other. An admin area, built into the site, then gives staff screens over the same tables, which is how a database site gets its own editing tools.
When a site needs which
Choose a CMS when the site is mostly content written by a team: a magazine, a large blog, a documentation site, or a marketing site where non technical editors publish daily and need approval steps. Choose a database when visitors do things: book, order, pay, sign in, save favourites, apply for a job, bid or message. Many small business sites are the second kind with only a little content, such as a menu, a services list and an about page; those fit comfortably as database rows with an admin screen, or as text in the site's code that changes a few times a year. Use both when a content heavy site also has transactions, for example a publisher with paid memberships. In that case keep a clear line: articles live in the CMS, while members, subscriptions and comments live in the database, so each tool does what it was designed for.
Common mistakes
Bending a CMS into an order system, then discovering it cannot stop two people buying the last item or keep one customer's order private from another. Adding a CMS to a site whose content changes twice a year, which adds a login, a monthly bill and an API dependency for very little. Putting content that editors need to change daily into code, so every typo fix needs a developer. Splitting one kind of data across both tools, such as products in the CMS and stock levels in the database, then fighting to keep them in step. Forgetting access rules on database tables because the CMS never needed them. And choosing based on a tool's popularity rather than on a list of what visitors and staff will actually do on the site in its first year.
Where it shows up in OneCraft
OneCraft writes every site as code: a React Router, Tailwind and shadcn/ui project in its own repository. When a requested feature needs data, such as bookings, orders or members, the AI enables a database for that site: a schema of its own in OneCraft's pool project, or a project on the owner's own Supabase account when they connect one. Hosted schemas are included on every plan, or the owner can connect their own Supabase account. Every table has row level security, checked as an anonymous visitor and as a signed in person. Staff manage rows from an admin area inside the site, shown only to people in its site admins table. There is no separate CMS, and changes to fixed page text are made by chat, each change saved as a commit in the site's version history.
Questions people ask
Can a database replace a headless CMS for a small site?
Often yes. A menu, a services list, team profiles or blog posts can be rows in the site's database with an admin screen to edit them. What you give up is the polish of a dedicated editor: rich text tools, scheduled publishing, approval workflows and image cropping. For a few editors updating weekly, an admin screen is usually enough.
Is a headless CMS better for SEO than a database?
Neither helps or hurts on its own. What matters for search is that pages are served as real HTML with titles, descriptions and readable text, load quickly and have stable addresses. A site that prerenders its pages works equally well whether the words came from a CMS, a database or the code itself.
Where does WordPress fit in this comparison?
Traditional WordPress is both a CMS and a site in one, with its own MySQL database underneath. Used headless, it becomes a CMS that feeds another front end. Plugins add bookings or shops on top of its database, which works, but each plugin brings its own tables, update cycle and security record to look after.
Which is cheaper to run, a headless CMS or a database?
For small sites both can start free. A CMS tends to charge by editor seats, content entries and API calls; a hosted database by storage, compute and bandwidth. The bigger cost is usually time: a site that uses one tool well costs less to keep running than one stitched across two.
How hard is it to move later from one to the other?
Moving content out of a CMS usually means exporting entries and rewriting the parts of the site that fetch them. Moving a Postgres database is more standard, since a dump and restore carries tables, rules and data together. Either way, choosing from what the site does today saves a migration later.
Make one with websites
The button opens the generator with this use case already described. Change the wording to match your own.
Create a website with OneCraftRelated questions
- What is a Supabase project?What is a Supabase project? One Postgres database with sign in, file storage and an API on top. What a project includes, what it costs, and how keys work.
- What is row level security?What is row level security? Database policies that decide which rows each signed in person can read or change, with common policy shapes and how to test them.
- What is a static website?What is a static website? A site served as ready made files instead of pages built per visit. Why static sites are fast and secure, and what they cannot do.
Written and checked by the OneCraft team. Last checked .