r/webdev • • 1d ago

Question Headless cms

Sorry it maybe a stupid question but I read today about headless CMS, it being to be portable to every kind of device and it being "the new thing".

I went to read a few blogs but still don't understand its advantages.

Where is the difference when I store all content/paths in a json like I currently have?

0 Upvotes

19 comments sorted by

26

u/SPEZ_IS_A_JABRONI 1d ago

headless doesn't refer to how the data is stored it describes the relationship between the frontend and the backend. Ie, the 2 are largely independent.

-2

u/ExplanationOk2014 1d ago

Thank you. I wrote it below, it seems I build my site already in that direction. Prior it was a html site but then I switched to php and put everything in i18n json files with a few slugs.

11

u/Beregolas 1d ago

I mean, sure, there are a few posts about headless CMS right now, but it's certainly not "the new thing". They have been around for decades.

A CMS is a Content Management System. It has many jobs, but most of them can be boiled down to: Give the Admins an Interface to manage the data, and give the users an interface to consume it.

Many CMS come with their own frontend: WordPress is probably the best known example.

Some only offer an API and no GUI to interact with them natively: they are headless. For most use cases, you would bring your own GUI, for example by building it.

Where is the difference when I store all content/paths in a json like I currently have?

There is none. If you build a system, that stores all data as JSON and can retrieve it well enough for your users, congratilations, you have a CMS. If you don't ship a UI, you have a headless CMS.

That being said: JSON files on the backend have a myriad of issues, most of which only start coming up once you either scale, or try doing something fancy that just doesn't work well with multiple strewn JSON files. The first things that come to mind are searching and indexing, sorting and filtering, access control (is just way harder than it needs to be), reading and writing is probably slower than a DB, especially if you are doing it wrong (language dependent), etc.

As long as you don't run into any issues, and are programming for fun: JSON is completely fine. If you want to improve, try looking into more advanced backend setups, like SQL based databases, or if you want to stay in the file/document style without exactly defined schemas, try something like MongoDB.

2

u/ExplanationOk2014 1d ago

Thank you very much for your elaborate answer. Yes then I created a headless CMS without knowning that I have one. My json can be deployed anywhere and don't need a customer GUI.

I thought headless cms is some kind of new database that needs no html or whatever. 🫣

Currently i store all data in a i18n-json with 5 languages as machine translation is still awful. I can also sort, search, index it as I have a library which I built for searching my ~1000 books. I created some kind of webshop where I can choose my books and it's gives me a list where I can find it.

I can believe that for more fancy things a database is needed but I never understood how it exactly works despite me trying to figure out what primary keys and stuff is during the lockdown. Today I would most probably only vibecode it without understanding it.

5

u/MisterEd_ak php 1d ago

It just means you can focus on developing the frontend without having to also write the enitre backend system.

The CMS, like Drupal for instance, provides the JSON API and all of the required forms and content management so you can have multiple people maintaining content.

1

u/ExplanationOk2014 1d ago

Yes thank you. It seems I unintentionally built myself something like it but did not know its called headless...

I will now try to figure out what a CMS with head is..😆

2

u/sateliteconstelation 1d ago

Headful CMS means that the data is structured in a way that only makes sense to the system that renders the data in the layout in the screen.

Wordpress, for example, can do both.
It can headfully fill save the data behind php functios of it’s own, internal system. Or headlessly produce a json to be read on a react page.

3

u/SkyTheLine 1d ago

Look, i use it and love it. Imagine, that the backend can be modified and controlled without any inteference. Mainly because i seperate it with the frontend. On the frontend site everything is static rendered. Perfext for cdn and branching. Control it, deploy it and love it. I control frontend, backend and can do branching both.

1

u/ExplanationOk2014 1d ago

Thank you. I answered already to the others users here. It seems I unintentionally built something similar and independent..

-2

u/SkyTheLine 1d ago

Well, it depends. My site example has a rest endpoint and if i build an iwatch app, iphone/mac… etc. The needed data can be requested. Im also currently building it graphql, so only the requested parts are responding. You have to think with horizontal and vertical scalable architecture. When no backend activity is there, the site and microservices with the database ar shutdown. But frontend repsonds and awaken everything if needed.

2

u/florian_huber_8 17h ago

GraphQL lets clients request selected fields, but scaling and waking an idle database come from the hosting/runtime setup, not GraphQL itself.

1

u/boer0327 1d ago

a static JSON file is great when you are the only one editing content. a headless CMS only pays off when non-technical teammates need to update copy without triggering a git deploy.

1

u/One_Tap_3622 21h ago

Honestly, with your setup you're already doing the "headless" part by hand — your JSON files are the content store and your PHP is the delivery layer.

A headless CMS mainly buys you three things on top of that: an editing UI so non-developers can change content without touching files, an API with validation/caching instead of reading files directly, and enforced structure (schemas, drafts, media handling).

If you're the only one editing content and the JSON workflow doesn't hurt, the honest answer is you won't gain much. It becomes worth it when clients or editors need to update content themselves, or the content model outgrows hand-edited files.

1

u/h0rhay076 19h ago

Your JSON files are doing the same job, so you're not missing anything technical. What a headless CMS adds is everything around the content, for people who aren't you.

I moved a marketing site to one this year with six languages. What we actually use it for: editors change copy without a developer or a deploy, they see a preview before it goes live, there are drafts and a publish step, and translations go through a proper workflow instead of someone editing a JSON file by hand.

If it's just you and 1000 books, JSON in git is fine and probably better. The day someone non-technical needs to edit it, that's when it pays for itself.