r/webdev • u/ExplanationOk2014 • 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
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.
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.
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.
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.
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/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.