4
Most systems currently use the database feature to record the most diverse types of information, even static information. This leads to the conclusion that a database brings significant conveniences.
What are the advantages of using a database in contrast to a simpler way of writing data such as a JSON or XML file?
Note that I am not asking what is "best". I know that each way of doing things (mostly at least) has its advantages and disadvantages. That’s why I’m asking about the advantages of a database in the specified context. With that, I’m also not asking for opinions, since I believe that this kind of question can be answered with facts, such as here and here.
I have also checked some other questions here at Sopt, but I did not find the desired answer:
Can I use a JSON file as a database?
On that one, the answers tell you how to do it, but no why or why not do.
It’s a good idea to use JSON as a database?
Already in this the answers show that JSON is only a data format, and not a database, and also suggest alternatives to a conventional database. However, the advantages of storing data in a database rather than in a file. JSON (not to be confused with json format) are not clearly presented.
What is faster, access data in file or database?
This question is focused only on data acquisition speed and performance.
To decrease the chances of someone finding the question too open, let’s take a simple example.
Suppose I have a task web application. The information to be saved in a database or JSON file would be the user authentication information, as well as information regarding tasks, statistics and settings of each of them. It is an application that could serve a large number of users, performing various CRUD operations. I ask again the question of the title to a situation like this.
Related articles/questions are also welcome.
How so compare a SGDB with a file format? The responsibility of the SGDB is to manage the persistence, handling, consistency and organization of the data, as well as control the access to the data manage the data access competition. While responsibility of the JSON format is only to be a simple and fast data exchange standard between systems. One you use to save/access the data the other uses to communicate the data.
– Augusto Vasques
A party in what creates confusion, Nosql document-oriented databases use XML-like document formats , YAML , JSON however what is not widespread is that these documents are supported within the Nosql database as a metadata structure creating an object model for each stored document, thus giving the impression to the user to be consulting simple JSON documents, for example, when in fact what is being consulted is a much more complex data structure.
– Augusto Vasques