Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To store files/images in a database or not

 
John Cogan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This is probably one of those questions that spans a couple of saloon's.
I am constructing a web application, using MVC servlets, jsps and mySQL, to store articles and images.
Users of the website are allowed upload images and word documents. I'm wondering what is received wisdom regarding storage.
Is it best to upload these files to a directory and store the file names in the database or is it best to store the whole file as a blob in the database?
Any comments would be gratefully received.
John
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have always read and heard that storing images and files in general in a database will hinder performance. Personally, I always store them seperately and store the location in the database.
I would also like to hear other opinions on this though..
 
Sainudheen Mydeen
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:
Personally, I always store them seperately and store the location in the database.

I will go with Gregg. I had done the same thing in one of my projects and I found it to be good approach. Resulted in a better data management and performance.
-Sainudheen
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic