Home >Backend Development >PHP Tutorial >db - Can php use file storage instead of databases such as mysql to improve performance when the site has a small amount of data?
, what are the disadvantages of doing this? Is there anything I need to pay attention to?
, what are the disadvantages of doing this? Is there anything I need to pay attention to?
I haven’t heard of anyone doing this. If you want fast and simple performance, why not use redis? Databases are files after all, and memory is much faster than files, right?
Depending on the I/O speed of your server disk, if the application and database server are the same, there is no need, why give up the advantages of the relational database. Of course, if the amount of data is really small, you can actually use xml or json to store the data.
One of the great advantages of sql is its relevance.
If there are two sets of related data and you want to query and assemble the results at the same time, then SQL join can do it.
But if it is file storage, you have to read the entire file and write the associated query statement yourself.
The same applies when writing new data. You have to write the concepts of updating, inserting, and deleting yourself.
It depends on your needs.