M
M
MrGruffi2014-03-08 14:34:45
PHP
MrGruffi, 2014-03-08 14:34:45

How to organize a file structure as an alternative to MySQL?

I am developing a website for personal use. I wanted to try to make it without using the MySQL database, and without any database at all, that is, on files.
Immediately the question arose about the correct organization of data on the site.
So how do I imagine it.
1. users.file stores basic information about users (logins, passes, etc...).
2. news.file stores news information (headlines, descriptions, who posted the news, etc...).
3. posts.file stores only replies, ie replies to any news/topics and so on.
Perhaps knowledgeable people will advise a better way to organize the file structure?
The site should have registration, authorization, profile, private messages, news, forum, the ability to respond to this is the most basic thing.
Or all the same not to take a steam bath and use MySQL?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
R
rumkin, 2014-03-08
@MrGruffi

What you need is sqlite. This is an sql-database consisting of one file. In the code, you load it like a regular file, but you work like with SQL. This is most likely what you are looking for.
Otherwise, use any other popular data storage format: xml or json. But keep in mind that sooner or later you will encounter all the childhood diseases of databases. A project like this is very useful as a training project, but not as a working solution.
UPD. On SQLite, you can make cms for a small site or even a store, it's more convenient, easier and sometimes more reliable. So you can use such a solution in production, it meets the standards and has a developed infrastructure. But under load or on bigdata, you will have to migrate to a full-fledged DBMS, since sqlite is entirely located in memory.

R
Rpsl, 2014-03-08
@Rpsl

Do you have nothing else to do? If you want, then try it, after N time you will understand that the idea is terrible and you yourself will come to the idea that you need to redo everything to normal storage.

D
Diode Bot, 2014-03-08
@Diode-Bot

I remember such an old mobile CMS on files as PCMS and another one from the developers of RotorCMS. Everything was on files and worked very stably with registration, forums, chats, news and online games

S
Sergey Savostin, 2014-03-08
@savostin

See how it's done in GetSimple
Maybe you don't want to make your own bike.
In general, it's better

all the same, do not bathe and use MySQL

V
Vampiro, 2014-03-08
@Vampiro

So here they are, downshifters ... got to IT. The next step is sites without apache/nginx =)
On the topic - grow up, please. There are a lot of unsolved problems in the world, and this one has already been solved using databases. Take an existing problem and solve it, it will be interesting!

M
Maxim Kotov, 2014-03-08
@Kotov

Look at Monster CMS .
There storage in xml.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question