You are here: Re: Where to store pictures, in DB or in files? « PHP Programming Language « IT news, forums, messages
Re: Where to store pictures, in DB or in files?

Posted by Chung Leong on 07/07/06 21:43

romayankin@gmail.com wrote:
> I'm making some kind of news-board site on PHP (tthat's why I guess
> it's the right place to post the question here). Each entry would
> have a small picture (less then 100kb). Taking into consideration all
> pros and cons the question is where to store these pictures in DB or in
> files?

Keeping images in the database makes them easier to manage. No worry
about duplicate filename. If your database supports cascade delete then
the images are purged automatically when the article is removed. And a
foreign key constraint could guarantee that the images won't go
missing. Keeping them in the database also makes backup easier.

The downside is performance and resource usage. The web server is
extremely efficient at serving static files. Loading an image from the
database is relatively slow, on the other hand, and uses a good chunk
of memory.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация