Is the file name and path stored in the database or the image converted to binary data stored in the database? Which method is generally used? Is the file name and path stored in the database or the image converted to binary data stored in the database? Which method is generally used?
Reply content:
Is the file name and path stored in the database or the image converted to binary data stored in the database? Which method is generally used?
Store the file name and path in the database.
It is best to drop the image into CDN.
It is usually placed on the server and the data inventory path.
What are the application scenarios?
Reading files is faster than reading database records, but the limit is that you can only read local paths (of course, remote files can be shared using NFS or other methods ). In addition, when the file size is inconsistent (for example, the size is as small as two or three KB, and the size is as large as two or three GB), the file content cannot be stored in the database.
Save the path to the database.