Results 1 to 12 of 12
  1. #1
    mudit222 is offline Member
    Join Date
    Apr 2010
    Posts
    16
    Rep Power
    0

    Red face problem regarding for storage of images in database

    hi, i am using oracle 9i as a database in my project. tell me the procedure to store images in oracle 9i database.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,928
    Rep Power
    19

  3. #3
    flyfisherman is offline Member
    Join Date
    Mar 2010
    Posts
    26
    Rep Power
    0

    Default

    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,...

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,928
    Rep Power
    19

    Default

    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.

  5. #5
    flyfisherman is offline Member
    Join Date
    Mar 2010
    Posts
    26
    Rep Power
    0

    Default

    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 ?

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,928
    Rep Power
    19

    Default

    Yes I can...why not?

    And a remote server doesn't solve the synching of data (or transactions).

  7. #7
    flyfisherman is offline Member
    Join Date
    Mar 2010
    Posts
    26
    Rep Power
    0

    Default

    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)...

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,928
    Rep Power
    19

    Default

    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.

  9. #9
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    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-

  10. #10
    flyfisherman is offline Member
    Join Date
    Mar 2010
    Posts
    26
    Rep Power
    0

    Default

    Quote Originally Posted by Tolls View Post
    Do you take the same view with all documents?
    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 ?

  11. #11
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,928
    Rep Power
    19

    Default

    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.

  12. #12
    flyfisherman is offline Member
    Join Date
    Mar 2010
    Posts
    26
    Rep Power
    0

    Default

    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

  1. Replies: 2
    Last Post: 04-01-2010, 04:35 AM
  2. Mass storage
    By MIA6 in forum New To Java
    Replies: 4
    Last Post: 11-02-2009, 06:22 PM
  3. Array storage
    By Stev0 in forum New To Java
    Replies: 6
    Last Post: 04-17-2008, 07:18 AM
  4. String byte storage
    By bozovilla in forum New To Java
    Replies: 1
    Last Post: 11-24-2007, 06:35 AM
  5. j2me.storage.RandomAccessStream certificate error
    By asdfghjkl in forum CLDC and MIDP
    Replies: 1
    Last Post: 11-09-2007, 03:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •