when designing an attachment storage table for a system, do you use decentralized storage of information to each required table? Or do you centrally store the attachment information in a table and then associate it in the table you need to use? Or are there other plans?
for example, the picture information of the user profile is stored in a field of the user table, and the picture information of the product is stored in a field of the product table. I call this storage method decentralized storage.
all the companies I"ve worked with have been stored in this way.
all the attachments uploaded by users are stored in a table, and then when the query data needs image information, the data is obtained by associating with the id field in other tables. I call this storage method centralized storage.
Please talk about the pros and cons of these two ways.
if there is a better way, please do not hesitate to share.