S
S
Space2015-10-11 13:24:17
PHP
Space, 2015-10-11 13:24:17

Where to store the data - in a database or a document?

Tens of thousands of id are collected with the help of a parse and they need to be entered somewhere. Here advise what is better - to enter them into a database or into a text document and store it on the server (or in another way as possible)? I collect only id, there are no additional fields. Then, in the script, I will need to receive each id and work with it separately.
Why the question: the amount of data is large and the load may be less if it is not stored in the database.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
W
wol_fi, 2015-10-11
@ruslite

The database and DBMS for them were designed just for this - to store data. Believe it or not, they also store data in files on the hard drive. Why reinvent the wheel when there is already a ready-made tool. Use a DBMS and don't worry about the load. It will be many times less than if you put everything into one file directly.

S
Sergey, 2015-10-11
Protko @Fesor

if you store it all not in the database.

The database will not allow write conflicts and will do it in memory before writing to disk, in the case of files you will have to play around with locks, and in order to do this at least somehow efficiently, you will have to spend a little time.
Another question is how to use a DBMS, you can simply store (key-value storage) in nosql and map to files.

C
Curly Brace, 2015-10-11
@stasuss

text files are fine as long as the volumes are not large.
because to use the file, it must be loaded into memory, and this is time and resources.
and if the data is small, then text files work faster. It's not for nothing that there are flat-file cms like gpEasy. For small sites, such a thing will simply fly and create practically no load. but it’s worth posting there under a hundred posts, how it will become clumsy)
summarizing what has been written: in your case, you can’t do without a database)

S
Sergey, 2015-10-11
@begemot_sun

Everything depends on your need. If you just quickly save, and then also quickly read in the same sequence, then nothing better than files has yet been invented.
If something to make still - that a DB.
Any NoSQL in the future may not give the desired flexibility.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question