I'm sure this has been discussed a lot, I see alot of advantages to storing images in the database as a blob or longblob.. however I'm wondering how doing this would stack up on a site like flickr or myspace... vs. on the disk...
Does anyone have any insight as to whether this would be a good idea or not, also, when storing images in a db, can people save as on the images or would it just be a php file.. like img.php?id=5, is it posible to have it be an actual image xxx.jpg, etc.
Thanks!!
storing images in the database
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Re: storing images in the database
Yes, it has been discussed a lot.GeXus wrote:I'm sure this has been discussed a lot
I see very very few advantages. Advantages that are far outweighed by the disadvantages in fact.GeXus wrote:I see alot of advantages to storing images in the database as a blob or longblob
Done right, the browser shouldn't notice a difference.GeXus wrote:can people save as on the images or would it just be a php file..
Yes.GeXus wrote:is it posible to have it be an actual image xxx.jpg, etc.
Re: storing images in the database
feyd wrote:Yes, it has been discussed a lot.GeXus wrote:I'm sure this has been discussed a lot
I see very very few advantages. Advantages that are far outweighed by the disadvantages in fact.GeXus wrote:I see alot of advantages to storing images in the database as a blob or longblob
Done right, the browser shouldn't notice a difference.GeXus wrote:can people save as on the images or would it just be a php file..
Yes.GeXus wrote:is it posible to have it be an actual image xxx.jpg, etc.
Well, I guess the advantages that I see are that all data will be stored in a central location, easy for backup, etc.. (not that its exactly hard to copy files)... it just seems a lot more organized.
My understanding is that while in a DB it will use resources, the same is true when doing disk writes all day long. you disagree?
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
With a database it will use nearly, if not, twice as many resources and system performance will suffer.
Why twice as many? When you request an image the database has to load it into memory, then php has to copy that memory into its memory.
Why will system performance suffer? You will need separate requests to the image display script for every image. PHP will have to load and run each of those requests separately too.
Why twice as many? When you request an image the database has to load it into memory, then php has to copy that memory into its memory.
Why will system performance suffer? You will need separate requests to the image display script for every image. PHP will have to load and run each of those requests separately too.