dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Storing images in MySQL vs Filesystem

  1. #1
    Join Date
    Jun 2004
    Location
    California, USA
    Posts
    264

    Cool Storing images in MySQL vs Filesystem

    Howdy,

    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.

    Seth

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,633
    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.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

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



Recent Articles