This problem has been bothering me for the past two days.
(1) large objects exist in the Database
(2) large objects are stored in the file system and connected to the database.
In the first case, the advantage is obvious: data consistency and maintainability are good, but the disadvantage is that the efficiency is relatively high. If there are more than a dozen concurrent records, the efficiency of the database is relatively low. Of course, the advantages and disadvantages of the first type are the opposite of those of the second type. The second type of problem is how to solve the synchronization problem, that is, the files in the file system are deleted, the database connection should be invalid. after reading some references on the internet, I think this is also a good practice. I 'd like to give you some comments.
Large objects are incorporated into the database and stored in the file system, and the database retains the connection of this large object in the file system.
In this case, when the user requests, go to the file system to find the object. If yes, download the object directly. If no, restore the large object in the database to the file system and download the object to the user.
In addition, the database is directly stored in the file system without backup. A file monitor directly updates the database when you perform any operations on files in the file system. the purpose is to maintain consistency.
Storage of large objects has always been a big problem. If you have good suggestions, please share them with us.