Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2010

    How to store images?

    Dear all,

    I have an idea for a web app. I'm using Django to make it, if that makes any difference.

    This app of mine will basically be an image repository where the images themselves are very "light". 3KB each max. However, I envisage at least 30-50 thousand of them.

    What's the best way of storing these images on the server? Do I store the images themselves in the database, or do I store the images on the server and their paths in the database?

    Thanks in advance

  2. #2
    Join Date
    Jan 2003
    You have a few options. One is take shelter, because you have unwittingly hit on one of the "holy wars" in DBMS theory.

    The images in your case are small enough that they should not cause most RDBMSs too many problems with storage, but you should check with your vendor to make sure about the particulars.

    Storing images on the filesystem and storing the paths in the database can get tricky. You usually end up having to reconcile what is on the filesystem with what is in the database. And at 30-50 thousand images, you will likely have some sort of random naming system to keep the individual files unique, which can cause headaches when you troubleshoot mapping a row to an image.

    Some RDBMSs now come with a hybrid or a dedicated approach to the problem (SQL Server's Filestream, and Oracle's SecureFiles, and DBFS), so this question may very well come down to what database engine are you using.

  3. #3
    Join Date
    Mar 2010
    Haha I like the "take shelter" route

    I'm planing on using Postgresql.

Posting Permissions

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