Posts: 3,176
Name: Thierry
Location: I'm the uber Spaminator !
|
Quote:
Originally Posted by twhdir
It is always the good practice not to store images to the database. Because as the more rows are getting added to the database, your database server performance will go down. Hence, you should store the images on the file system and just save the link to the image in the database.
All popular application saves the attachments this way, The best example is Kayako helpdesk software.
|
No, it should not....
If you design your db well enough, it sure will take some milliseconds more, but the "performances" won't degrade.
Beside, saying that pictures should always be stored outside a db is just a myth, and can be misleading.
I have programmed a web service that takes screenshots of web pages, and I do not store them as files.
I store them in a postgresql DB and in a memcached server instance.
Why !?
Because the db adds only a minor overhead, if no overhead at all. Mind you, the filesystem management is an overhead too...
Because I can have several server working together, and having files shared between them is just like sleeping under an anvil, something is bound to happen. Be it name conflict, locking error or network problems.
So, storing files in a DB can be a well more suitable way to handle them than a filesystem only one.
But as for the OP question, it's true that storing the pics in the DB would be overkill.
But if your question still torment you, there is a good article there: http://www.phpriot.com/articles/images-in-mysql
__________________
Only a biker knows why a dog sticks his head out the window.
Last edited by tripy; 08-09-2009 at 08:40 PM..
|