Re: binary data (php/mysql) - comments wanted
| From: | Ignacio Vazquez-Abrams | Date: | Sat, 25 Nov 2000 21:52:16 +0000 |
| Subject: | Re: binary data (php/mysql) - comments wanted | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27186@lists.php.net to get a copy of this message | ||
On Fri, 24 Nov 2000, Jon Rosenberg wrote:
> I've got my script working with PHP 4 and storing binary data (JPGs and
> GIFs) in a mysql db for m,y personals program I'm writing. When all is said
> and done, I expect an average of 700-1000 pictures to in the db at any given
> time, with each picture averageing about 50KB. What, if any
> reliablity/preformance problems am I going to introduce witth using this
> amount of binary data in conjunction with mysql/php4? Would I be better off
> having my PHP script upload the file to a directory and then storing the
> link necessary to retrieve that file in the db and subsequently outputting
> that to the html page generated? Thanks for all your comments/suggestions.
>
> Jon
>
If the web server and the MySQL server are the same machine, and if the
machine is powerful enough (P2/266 or better), and you can't expect more
than 10-20 pictures to be requested per second, then by all means feel free to
put the images in MySQL. This is a technique that I use, and while the images
aren't massive (smaller IS better, of course), the performance is
perfect. Make sure that you store the MIME type along with the data,
though. And you might be better off storing the data after using
base64_encode().
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>