Results 1 to 2 of 2

Thread: Storing images in MySQL vs Filesystem

  1. #1
    Join Date
    Jun 2004
    California, USA

    Cool Storing images in MySQL vs Filesystem


    Is it better to save images uploaded by users into a MySQL database or to the filesystem? I figure its easier to manage the files if they are in the database, however the database will quickly grow in size due to the images. Although, if you save the images to the filesystem there might be issues of versioning the images and handling browser caching when users replace old images.

    What do you guys typically do? I'm interested to hear arguments from both sides.

    Thank you,
    MIDI Delight - Free Ringtones and MIDI Files

  2. #2
    Join Date
    Aug 2004
    I prefer to store the images as files in the file system and only information about the images in the database (including data like file name and possibly directory name, if applicable, to use for <img> tags or otherwise accessing the file when needed). After all, you are (probably) never going to need to search the actual binary image data, so if you store it in the DB all you are doing is using a different means to save it to a file that requires additional overhead to access it.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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