hi, i am using oracle 9i as a database in my project. tell me the procedure to store images in oracle 9i database.
Printable View
hi, i am using oracle 9i as a database in my project. tell me the procedure to store images in oracle 9i database.
JDBC.
setBinaryStream().
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,...
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.
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 ?
Yes I can...why not?
And a remote server doesn't solve the synching of data (or transactions).
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)...
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.
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-
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 ?
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.
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 :)