Storing Images In MySQL

2004-09-29 Thread Ed Lazor
I figured I'd post a follow-up to the discussion earlier this week on issues
relating to storing images in MySQL.  

In my opinion.  

Whether you store images in MySQL ultimately depends on whether you can
setup a caching accelerator (like Squid) between you and your visitors.
Storing images in the database adds a minimum of around 28 ms of latency.
Cacheing makes this a mute point since images are once again stored as
files.  The main benefit is that you can more easily manage a large number
of images by storing them in the database.

Most people, those on shared hosting services, aren't going to likely have
access to a caching accelerator, so originally storing images as files is
probably going to be the best approach.  The most common approach that I've
seen is to create some sort of directory hiearchy and divide images in
groups of 1000.

Two other points came up while I was playing around with this.  

People on dial-up accessing test pages didn't notice any difference in
performance - their average ping times to the server were around 120ms.  I'm
guessing their connection latency helped to buffer the difference between
the two approaches.

Pulling images from the database usually involves a script with a parameter
that indicates which image to display.  For example, like this:

   img src='http://www.myhost.com/display_image.php?id=5'

Locally installed firewalls (Zone Alarm, McAfee Internet Security, and
Norton Internet Security) all blocked the display of images that were served
with a script like this.  Getting the images to display required renaming
the script, using Apache forcetype commands, and manually parsing the URL to
get the image id to display.  In other words, the url ended up like this:

img src='http://www.myhost.com/display_image/5'

Anyone who sends me a request can get copies of the scripts and help on
trying to set something up to duplicate what I did.

Thanks to everyone who helped me with this - especially Dreamwerx.

-Ed




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Storing Images in MySQL

2003-03-28 Thread vernon

Hey all,

I'm using phpNewsAds and am wanting to store images in MySQL. I have this 
working on my Red Hat 7.2 Box and am moving to a new server running Red Hat 
7.3 and of course, after moving the database the images are not being 
dispalyed. The database, however, is working.

I'm assuming that maybe something in MySWL needs to me turned on and I have 
no idea what that is. Anyone have any ideas?

Thanks.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Storing Images in MySQL

2003-03-28 Thread Dathan Vance Pattishall
I assumed to store the data in mysql you did something like uuencode and
inserted that data into the db?
Could the decode method be different on redhat 7.3?

-Original Message-
From: vernon [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 28, 2003 2:19 PM
To: [EMAIL PROTECTED]
Subject: Storing Images in MySQL


Hey all,

I'm using phpNewsAds and am wanting to store images in MySQL. I have
this 
working on my Red Hat 7.2 Box and am moving to a new server running Red
Hat 
7.3 and of course, after moving the database the images are not being 
dispalyed. The database, however, is working.

I'm assuming that maybe something in MySWL needs to me turned on and I
have 
no idea what that is. Anyone have any ideas?

Thanks.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Storing Images in MySQL

2003-03-28 Thread William R. Mussatto
 I assumed to store the data in mysql you did something like uuencode and
 inserted that data into the db?
 Could the decode method be different on redhat 7.3?

 -Original Message-
 From: vernon [mailto:[EMAIL PROTECTED]
 Sent: Friday, March 28, 2003 2:19 PM
 To: [EMAIL PROTECTED]
 Subject: Storing Images in MySQL


 Hey all,

 I'm using phpNewsAds and am wanting to store images in MySQL. I have
 this
 working on my Red Hat 7.2 Box and am moving to a new server running Red
 Hat
 7.3 and of course, after moving the database the images are not being
 dispalyed. The database, however, is working.

 I'm assuming that maybe something in MySWL needs to me turned on and I
 have
 no idea what that is. Anyone have any ideas?

 Thanks.

Why not just store it in a binary field?

That said, if you are going to use any programming language, why not store
the pointer in the database and the image on the disk?  Only case where
this would be a problem would be if the numbers of images were so large
that the file look up mechanism of the file system began to be a factor. 
In cases like that I use a tree of subdirectories tied to something like
ISBM number.

William R. Mussatto, Senior Systems Engineer
Ph. 909-920-9154 ext. 27
FAX. 909-608-7061



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Storing images in MySQL bad idea, performance-wise?

2002-07-08 Thread René Fournier

I'm working on a simple content management system that uses PHP and 
MySQL for updating a web site's text (stored in a MySQL database). (The 
PHP scripts that do the updating (my stuf) live on one web server, the 
actual DB data to be updated (my client's stuff) live on another.) So 
far, I've only had to he able to update the text content of a 
site--therefore, I've only had to bother to store textual data in the 
client's DB. But now the client wants to be able to upload/change/delete 
certain pictures on their web site--using my CMS tool--so I am faced 
with the following problem:

Do I store all such images in the DB? (Which I understand reduces 
performance.)

Or do I--somehow--store the images as files on the client's web server? 
And if so, how? (Because my PHP scripts are being executed on a 
different server.)

...Rene

---
René Fournier,
[EMAIL PROTECTED]

Toll-free +1.888.886.2754
Tel +1.403.291.3601
Fax +1.403.250.5228
www.smartslitters.com

SmartSlitters International
#33, 1339 - 40th Ave NE
Calgary AB  T2E 8N6
Canada


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Storing images in MySQL bad idea, performance-wise?

2002-07-08 Thread Gerald R. Jensen

Rene:

I think a good deal depends on the size of the image files themselves. There
are a number of apps that store small files (i.e.: icons, small gif's,
etc.), which seems to make sense.

Larger files may be problematic. There was quite a discussion on this issue
here just last week ... do a search of the list archive for 'blob versus
file' and read some informed opinions.

Gerald Jensen

- Original Message -
From: René Fournier [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, July 08, 2002 5:34 PM
Subject: Storing images in MySQL bad idea, performance-wise?


I'm working on a simple content management system that uses PHP and
MySQL for updating a web site's text (stored in a MySQL database). (The
PHP scripts that do the updating (my stuf) live on one web server, the
actual DB data to be updated (my client's stuff) live on another.) So
far, I've only had to he able to update the text content of a
site--therefore, I've only had to bother to store textual data in the
client's DB. But now the client wants to be able to upload/change/delete
certain pictures on their web site--using my CMS tool--so I am faced
with the following problem:

Do I store all such images in the DB? (Which I understand reduces
performance.)

Or do I--somehow--store the images as files on the client's web server?
And if so, how? (Because my PHP scripts are being executed on a
different server.)

...Rene

---
René Fournier,
[EMAIL PROTECTED]

Toll-free +1.888.886.2754
Tel +1.403.291.3601
Fax +1.403.250.5228
www.smartslitters.com

SmartSlitters International
#33, 1339 - 40th Ave NE
Calgary AB  T2E 8N6
Canada


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




storing images in MYSQl database

2001-09-22 Thread phani krishna

hi ,
how to store the images in mysql database and how to
retrieve the images onto teh VB form.how to do it.
 please mail me the suggestions.

   thanx
  phani


=
S.V.PHANI KRISHNA
STESALIT LIMITED
10,BELVEDERE ROAD,
ALIPORE KOLKATTA - 700027
PHONE NUMBERS 4498346,4498345,4498342
MAIL: [EMAIL PROTECTED],[EMAIL PROTECTED]


Do You Yahoo!?
Send a newsletter, share photos  files, conduct polls, organize chat events. Visit 
http://in.groups.yahoo.com

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: storing images in MYSQl database

2001-09-22 Thread Carl Troein


phani krishna writes:

 how to store the images in mysql database and how to
 retrieve the images onto teh VB form.how to do it.

What about it? Lemme guess, you're wondering how to do it,
right? Two points:
1) Images are just like any other data. Just store them
in a BLOB. As with all other data you need to escape
certain characters, but hopefully you knew that already.
2) Don't store that sort of data in the database. There
are a larg number of reasons why this is a bad thing to do.
Store them in the file system and just let your database
contain information about the images, such as where to find
them in the file system.

//C

-- 
 Carl Troein - Círdan / Istari-PixelMagic - UIN 16353280
 [EMAIL PROTECTED] | http://pixelmagic.dyndns.org/~cirdan/
 Amiga user since '89, and damned proud of it too.


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php