Home > Back-end >  Using database to store images, can lead to database is slow? Or little effect?
Using database to store images, can lead to database is slow? Or little effect?

Time:04-16

1, with a database to store the image, will cause data damage easily?
2, the database performance will be much worse?

CodePudding user response:

Not, to TB level of database is no problem, but using a database to store a lot of binary files, there are two problems:
1. The database files will not automatically shrink after enlarged, even if you delete all the data, the database file is so big, you need to use the database matching the shrink tools or built-in command can reduce disk space occupied
2. The database file damage after data loss a greater risk of
So, general store large amounts of binary method is only stored in the database file link (location/filename), and the file itself and stored in a file server

CodePudding user response:

Database damage has nothing to do with store content, save images will not affect performance,
If it is a small amount of pictures, can exist within the database (sometimes write code less it feels convenient, only need to use to the database operation, for example), if there is a lot of pictures, advice is the way to save the file,
  • Related