Results 1 to 12 of 12
- 04-13-2010, 06:52 AM #1
Member
- Join Date
- Apr 2010
- Posts
- 16
- Rep Power
- 0
- 04-13-2010, 10:41 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,460
- Rep Power
- 16
JDBC.
setBinaryStream().
- 04-14-2010, 10:26 AM #3
Member
- Join Date
- Mar 2010
- Posts
- 26
- Rep Power
- 0
Is it smart to store images in database... Why don't you store images on the disk and save only path to image in one varchar field ? DB will be smaller, backup faster,...
- 04-14-2010, 10:39 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,460
- Rep Power
- 16
On the other hand backups will actually represent reality.
That is, you will not get a mismatch between your data (which you have now split into two if you save it to the file system).
As for backups, are you suggesting you don't backup the file system? If you do, then the size of the db is irrelevant.
- 04-14-2010, 10:53 AM #5
Member
- Join Date
- Mar 2010
- Posts
- 26
- Rep Power
- 0
Of course you need to backup your filesystem but it can be done with rsync for example. Also, files can be located on remote server separated from the database.
For example, Facebook keeps 4 different sizes for every image. can you imagine to store this images in database ?
- 04-14-2010, 11:05 AM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,460
- Rep Power
- 16
Yes I can...why not?
And a remote server doesn't solve the synching of data (or transactions).
- 04-14-2010, 11:34 AM #7
Member
- Join Date
- Mar 2010
- Posts
- 26
- Rep Power
- 0
I appreciate your opinion and it has advantages but I still think that database is not the appropriate place for storing images.
At least microstock sites who has millions of images doesn't save images directly in database (as I know)...
- 04-14-2010, 11:48 AM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,460
- Rep Power
- 16
Do you take the same view with all documents?
Seems an odd thing to do, splitting your data up...
And, just for the record, I've worked in lots of places where the images are stored in the db, and served from there.
- 04-14-2010, 08:31 PM #9
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
Indeed, a file system is in essence a specialized database. Depending on the particular database's storage strategy, there may be overhead involved in storing images in the database, but it's not necessarily worse than storing them in a file system.
-Gary-
- 04-14-2010, 11:35 PM #10
Member
- Join Date
- Mar 2010
- Posts
- 26
- Rep Power
- 0
I store in the database only the things I can search. For images I need two fields: tags and file path (optional fields can be size, type, quality etc)
What do you think about shutterstok.com for example, istockphoto or fotolia.com ? Do they save their images in database ?
- 04-15-2010, 08:58 AM #11
Moderator
- Join Date
- Apr 2009
- Posts
- 10,460
- Rep Power
- 16
I have no idea what they do, but I do know most companies will store employee images (ie for security passes) in the db along with their details, because they are part of the data. I do know banks that store the customers online application forms in the db as a CLOB (usually XML). I could go on.
And they do this because the image, file, whatever, though not searchable, is tied closely to the record itself, so any backup has to be consistent, and any transaction has to reflect reality.
Databases are not about searching...they are also about storing data relevant to a record, ensuring (as best one can) that what goes into the db is accurate. The most accurate way of storing important information like that is to stick it all in the db, not split it up between two system which can get out of synch.
- 04-15-2010, 10:37 PM #12
Member
- Join Date
- Mar 2010
- Posts
- 26
- Rep Power
- 0
Their business relies on images, consistency and backups.
I'm just a hobby programmer and don't have to many experience in this, but if the biggest players in the world don't use databases for storing images, then there could be something about that...
I don't have anything more to say about this so I won't troll your topic and I'm sorry for starting this discussion. It is good to have two different opinions in the same place with its own cons and pros ...
Best regards and stay cool :)Last edited by flyfisherman; 04-15-2010 at 10:42 PM.
Similar Threads
-
Inserting Multiple Images into oracle database using JDBC
By raihan26 in forum JDBCReplies: 2Last Post: 04-01-2010, 04:35 AM -
Mass storage
By MIA6 in forum New To JavaReplies: 4Last Post: 11-02-2009, 06:22 PM -
Array storage
By Stev0 in forum New To JavaReplies: 6Last Post: 04-17-2008, 07:18 AM -
String byte storage
By bozovilla in forum New To JavaReplies: 1Last Post: 11-24-2007, 06:35 AM -
j2me.storage.RandomAccessStream certificate error
By asdfghjkl in forum CLDC and MIDPReplies: 1Last Post: 11-09-2007, 03:27 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks