File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes image repository in DB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "image repository in DB" Watch "image repository in DB" New topic

image repository in DB

Nitin Raodeo

Joined: Jul 27, 2002
Posts: 21
What are the pro and cons of storing the images in DB as compared to storing on File system of the server?
Consider a medium size internet application , with 500 concurrent users requesting for products with images.

Image sizes could vary from 10 KB to 200 KB.

1) SCJP 1.4<br />2) SCBCD (EJB 2.0)<br />3) IBM WebSphere Portal<br />4) WSAD (exam 287)
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33113

I would store those in the file system. If you have a web server, store them there. If not, store them on the application server.

If the users are reasonably likely to be accessing the images, you want them to link to the images. If the users could somehow search by image (by bytes or something), there would be an advantage to keeping them in the database. Another reason to keep images in a database is if they change often.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: image repository in DB
jQuery in Action, 3rd edition