在web应用程序的上下文中,我的老老板总是说在数据库中放置一个对图像的引用,而不是图像本身.我倾向于同意在数据库中存储url和图像本身是一个好主意,但在我现在工作的地方,我们在数据库中存储了很多图像.
我能想到的唯一原因可能是它更安全?你不想让别人直接链接到网址吗?但如果是这种情况,您可以始终让网站/服务器处理图像,就像ASP.NET中的处理程序一样,这样用户就需要进行身份验证才能查看图像.我还认为从数据库中取出图像会影响性能.为什么在数据库中存储图像可能是个好主意,也可能不是什么好主意,还有什么其他原因吗?
Exact Duplicate: User Images: Database or filesystem storage?
Exact Duplicate: Storing images in database: Yea or nay?
Exact Duplicate: Should I store my images in the database or folders?
Exact Duplicate: Would you store binary data in database or folders?
Exact Duplicate: Store pictures as files or or the database for a web app?
Exact Duplicate: Storing a small number of images: blob or fs?
Exact Duplicate: store image in filesystem or database?