Options

db or file

winnjewettwinnjewett Registered Users Posts: 329 Major grins
edited August 31, 2005 in SmugMug Support
I would like to pick the brains of the many talented people here. Is it better to store images directly in a database, or as files with the location and other information stored in a database?

I guess scale might matter. I am talking about very small scale operations (nothing along the lines of what smugmug deals with).

Thanks,
Winn

Comments

  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited August 29, 2005
    File system
    winnjewett wrote:
    I would like to pick the brains of the many talented people here. Is it better to store images directly in a database, or as files with the location and other information stored in a database?

    I guess scale might matter. I am talking about very small scale operations (nothing along the lines of what smugmug deals with).

    Thanks,
    Winn
    I think in pretty much all cases, you want to store the images in the file system. You can then make a separate decision whether you want to use a cataloging program to search, catalog and view your files based on their meta data, but even if you do use one of those, I'd still keep the images themselves in the file system and just use the cataloging program for the ability to do faster searches or create separate views of the images on disk. This is the way that most cataloging programs work, including Photoshop Album/Elements, Portfolio, ACDSee, etc...

    I think an important consideration is that whatever cataloging program you use also stores all of it's metadata in the file itself as industry standard IPTC data. While, it may keep it's own copy of the data for indexing and searching purposes, if use a program that stores all the metadata in the files itself, you will not get "stuck" with your cataloging program if it doesn't meet your needs in the future. Instead, you will be able to move to a different cataloging program without losing all of your cataloging information.

    --John
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Options
    RichardRichard Administrators, Vanilla Admin Posts: 19,929 moderator
    edited August 30, 2005
    winnjewett wrote:
    I would like to pick the brains of the many talented people here. Is it better to store images directly in a database, or as files with the location and other information stored in a database?

    I guess scale might matter. I am talking about very small scale operations (nothing along the lines of what smugmug deals with).

    Thanks,
    Winn
    I agree with John's comments. In general, there are many disadvantages to storing images in a database. Mainly, you lose flexiility because your only path to the images is through the database software. Depending on the software, you may also pay a size penalty which ranges from small to grotesque. The one advantage I can think of is security. If access to the images is restricted, the password and other security mechanisms of database management systems can solve this easily. This might apply to, say, the ID tag images in a Human Resources system, but is unlikely to be required by photographers.

    What, exactly, are you trying to do?
  • Options
    winnjewettwinnjewett Registered Users Posts: 329 Major grins
    edited August 31, 2005
    Thanks for your suggestions, guys. I think you are right. Files are the way to go, especially since I don't need the security a db offers.

    -winn
  • Options
    Mac WriteMac Write Registered Users Posts: 208 Major grins
    edited August 31, 2005
    Well I am becoming paranoid about people ripping off, downloading my photos. Using PHP can you store the images outside of the web folder and include them that way to prevent right clicking to view image in separate window, direct access etc? or better yet use a
    images.php?cat=xxx&image-xxx to full the image from a none web folder?
    My Photos | Use this referral code and get $5 off your first year of Smugmug! PIKZSgEQUVtu2 or just click here
    Get busy living or get busy dying
    --Stephen King
  • Options
    pumpkinpumpkin Registered Users Posts: 25 Big grins
    edited August 31, 2005
    Mac Write wrote:
    Well I am becoming paranoid about people ripping off, downloading my photos. Using PHP can you store the images outside of the web folder and include them that way to prevent right clicking to view image in separate window, direct access etc? or better yet use a
    images.php?cat=xxx&image-xxx to full the image from a none web folder?

    You could, sort of... it wouldn't prevent someone from right clicking a loaded image on a page, but you could generate a random image session ID (hash together image name, time, and any other stuff you can think of, or something) that could be used once, and any page using the image would have a means to generate one, while anyone from the outside seeing a session id would only be able to see expired ones, from used pages.

    Of course, this whole scheme would fail as soon as someone used wget or curl just to grab the webpage and then manually extracted the image using again one of those programs. Or often just saving an image will save the version the browser has in memory and not download it again. Right click preventing scripts have similar vulnerabilities. You're probably safest steganographically encoding data traceable back to you into your images, and hoping no one notices it so if they do steal your images, they still have information in them that you can retrieve in the event you need to prove they got them from you.

    Just a couple of cents :)
Sign In or Register to comment.