aspose file tools*
The moose likes JDBC and the fly likes Image Databases Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Image Databases" Watch "Image Databases" New topic
Author

Image Databases

V Bose
Ranch Hand

Joined: Jul 10, 2003
Posts: 113
Does anyone know of a platform/DB environment which supports storage and retreival of a large number of images.
Eventually I want to be able to access and retrieve images based once I store each image with its custom header tag.
Any pointers/hints ? Thanks in advance...
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

I don't know of any image-specific solutions but every database I've worked with (MSSQL, Oracle, MySQL) supported binary large objects (BLOB). I just used a field of that type to store the image.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Joe Ess:
I don't know of any image-specific solutions but every database I've worked with (MSSQL, Oracle, MySQL) supported binary large objects (BLOB). I just used a field of that type to store the image.

Joe is correct. With that being said, however, storing large amounts of binary data in a database will kill your performance. You would be better off storing the image on the hard drive somewhere and just storing the location of that image in the database.


GenRocket - Experts at Building Test Data
SJ Adnams
Ranch Hand

Joined: Sep 28, 2001
Posts: 925

yea, storing things in databases is useless. I think you should put all your data in flat files & just use the database for filenames!

Mr Bose, don't listen to Gregg, he's just winding you up. Like Joe says every commercial database supports binary (i.e. picture) fields. And will give you better performance than using a (non caching) filesystem.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Simon Lee:

yea, storing things in databases is useless. I think you should put all your data in flat files & just use the database for filenames!

Mr Bose, don't listen to Gregg, he's just winding you up. Like Joe says every commercial database supports binary (i.e. picture) fields. And will give you better performance than using a (non caching) filesystem.

Why can't Mr. Bose listen to me? I stated my opinion, based on personal research BTW, that gives Mr. Bose another option to solve his problem.
Although the "Be Nice" rule is typically reserved for the Meaningless Drivel forum, it does apply throughout this Board. So please, be nice!
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Article with hard data regarding BLOB vs. filesystem performance in Mysql (BLOB 30% slower.)
Another discussion, same conclusion.
Another point neither of these articles make but that's very important in big installations: if you use BLOBs, then your image data will be replicated on all slave servers; if you just store filenames, then a single server can serve all the images with far better caching.
Gregg knows what he's talking about, Mr. Lee. BLOBs aren't evil or anything, but their (small) convenience factor is very often outweighed by performance issues. Since you can't index on the actual image data, there's really no compelling reason to store images as BLOBs at all.
[ December 17, 2003: Message edited by: Ernest Friedman-Hill ]

[Jess in Action][AskingGoodQuestions]
SJ Adnams
Ranch Hand

Joined: Sep 28, 2001
Posts: 925
hey I was being nice
wait till I get drunk
SJ Adnams
Ranch Hand

Joined: Sep 28, 2001
Posts: 925
(hic!)
not sure if this link will work Ask Tom - Storing Images in database as BLOB Vs storing images on file system on Application Server
To be honest I was a bit shocked by the stats that the filesystem is faster. However remember that the webserver can memory cache pages served up by the appserver just as well as pages (images) from the filesystem.
I also think that 1st URL is comparing apples with oranges. In the php script he already knows the filename (rather than making a trip to the database to get the filename).
I think the point Tom makes about large number of images. is very valid. Certainly I know that if you set up usenet server you need to format the hard disk to deal with the thousands of small files. With a database you don't need to worry about this ( spreading the tablespace over many disks etc..).
Anyway I kind of get the impression that the comments were more about my attitude than my suggestion, so I'll try & behave myself in future. :roll:
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

Anyway I kind of get the impression that the comments were more about my attitude

Exactly. Rather than "Don't listen to Gregg...", perhaps something along the lines of "I'm not sure that I agree with Gregg about..."
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Image Databases