Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Advantages and disadvantages of file system and database

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

If you are hesitant about choosing the best way to save files uploaded to the server, if you are used to storing files in the file system and think that the file system was created to save files, or if you are not worried about the advantages of using a database to save files in some cases, it is time to reconsider your choice.

File system

Advantages of the file system

Performance may be better than when executed in a database. To prove this, it may degrade performance if you store large files in a database, where accessing files is simple and lightweight. Saving the file and downloading it to the file system is much easier than in the database, because the simple Save as feature can help you. You can complete the download by addressing the URL using the location of the saved file. Migrating data is a simple process. You can copy and paste the folder to the desired destination location, while ensuring that write permissions are provided for the target.

Disadvantages of the file system

1) loose packing. There is no ACID (atomicity, consistency, isolation, persistence) operation in relational mapping, which means that there is no guarantee. Consider a situation where you delete your files manually or through some guys. You may not know if the file exists.

2) low security. Because your files can be saved in a folder where you should provide write permissions, it is easy to have security problems and cause problems, such as *. If you can't compromise on security, it's best to avoid saving it in the file system.

Database

Advantages of database

ACID consistency, including rollbacks that are updated when files are stored outside the database. The file will be synchronized with the database and cannot be isolated, which has the upper hand in tracking transactions. Backups automatically include file binaries. It is more secure than saving it in the file system.

Shortcomings of the database

Files may have to be converted to blob before they can be stored in the database. Database backups will be heavier and heavier. Typically, RDBMS is driven by RAM, so all data must first go into RAM. What happens when RDBMS has to find and sort data? RDBMS tracks each data page-even if the least amount of data is read and written-it must track whether it is in memory, or whether it is on disk, indexed, or physically classified, and so on.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report