All articles

Designing a CMS that editors can trust

Separate draft data, public reads, and media storage so editors can work confidently while the public site stays predictable.

Designing a CMS that editors can trust

Start at the publishing boundary

A small CMS has two audiences with different needs. Editors need to save incomplete work, inspect it, and revise it. Visitors need stable URLs and complete, readable pages. A single table can serve both audiences if its publishing state is explicit and every public read filters for published rows. Add the rule in the database as well as the application so a direct request through the data API receives the same protection.

For the edit screen, make Draft the default status and require an intentional action to publish. When a record changes, preserve its public slug unless the editor explicitly changes it. If a slug changes on an established site, retain the old address as a redirect. A broken link is a publishing problem even when the new page looks perfect.

Give media a lifecycle

Keep metadata in the database and bytes in object storage. Validate the type and size before uploading, generate a unique storage key, and save that key or a durable URL on the entry. A new asset should have a new key so a CDN can cache it without serving the old file. Keep bundled assets on a site-relative path when they already ship with the repository.

The database write and the object upload cannot share the same transaction. If the upload succeeds but the entry save fails, let the editor retry the save using the existing asset. Use a periodic reconciliation process to find uploads that are no longer referenced. Never delete a shared asset automatically while another entry still points to it.

Verify what each audience can see

Test with separate sessions for an anonymous visitor, a signed-in non-editor, and an editor. Create a draft, confirm it is invisible from the public listing and its direct URL, then publish it. Retest with a fresh request and make sure the change reaches the list, detail page, and sitemap. Reverse those steps by unpublishing. Coverage across the two read paths catches bugs that a successful dashboard update can hide.

Seed data by stable identifiers and insert missing rows without overwriting existing ones. This lets development and staging use representative content while protecting editorial changes during a retry.