Db-can php replace mysql and other databases with file storage to improve the performance when the site data volume is small?

Source: Internet
Author: User
What are the drawbacks of doing so? What do you need to pay attention? What are the drawbacks of doing so? What do you need to pay attention?

Reply content:

What are the drawbacks of doing so? What do you need to pay attention?

I have never heard of this. it would be better to use redis quickly and easily in terms of performance. the database is always a file, and the memory is much faster than the file.

It depends on the I/O speed of your server disk. if the application and database server are the same, there is no need to do so. why should we discard the advantages of relational databases. Of course, if the data volume is small, you can actually store the data in xml or json.

A major advantage of SQL is its relevance.
If there are two groups of related data, you need to query and assemble the results at the same time, then SQL can be done with a join,
But for file storage, you need to read the entire file and write the associated query statement on your own.
When writing new data, you must write the concepts of update, insert, and delete.

However, if the requirement is simple, for example, a static menu, you can simply use a json file without any pressure. My personal website menu is a json file that stores menu data, and a php file that renders html. For this super-simple requirement, mysql is a small application and a file is used.

Depending on your needs.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.