Welcome to the OzoneAsylum FaqWiki
Frequently Asked Questions
Server Side Coding
MySQL

Should I store Images in MySQL Pages that link to <a href="https://ozoneasylum.com/backlink?for=5704" title="Pages that link to Should I store Images in MySQL" rel="nofollow" >Should I store Images in MySQL\

One word: No!

Short Explanation:
Storing images in a database is at least 10 times slower when retrieving than storing just a filename which then get's delivered by the webserver.

Longer explanation:
Ok, Step one: For every image, you'll need an additional query. It will have to be read of the mysql server, transported to your webservers memory, pushed out to the user's browser and then thrown away in your webserver memory. Repeat ad nausaum.
Now, if it's stored as a file, it's faster to begin with (no database queries, and filesystems are really really fast, nowadays), plus it will also be cached in your webservers memory if it's asked for a lot making it as fast as the line will take it.



(Added by: Tyberius Prime on Fri 20-Jun-2003)

« BackwardsOnwards »

Show Forum Drop Down Menu