Forum Moderators: buckworks

Message Too Old, No Replies

Advise Web Development

Database, web development, asp, php, mysql

         

mrfori

10:13 pm on Feb 12, 2004 (gmt 0)

10+ Year Member



Hi guys,

I am developing a e-catalog on the web for a company where users can find and purchase products.

I use MySQl. I want to store in DB the products images filenames only and store the images themselves on server filesystem in a directory. My boss wants me to store the images themselves on the DB as BLOB. What is your advise on this?

Also, He wants to have two copies of DB, the master copy inside the company firewall that will push data regulary to another DB running on web server outside the firewall. This is the DB the website will query. Again, whats your advise on this?

thanks in advance

Frank

ThomasB

11:22 am on Feb 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Frank, from my experience I would store the images in a filesystem and just the image-names in the DB.

The data pushing thing sounds good to me if the firewall allows these connections.

tolachi

9:44 am on Feb 17, 2004 (gmt 0)

10+ Year Member



Your boss sounds kind of silly.

I agree about not storing images as blobs. I faced making this decision a few years ago and there just doesn't seem to be any good reason to do it. It can apparently be a pain in the butt, let's say you want to manipulate the image. Good luck doing that while it is in a database, you'll have to pull it out and store it as a file temporarily. If you do decide to use the database for images consider making a separate table for your blobs.

I don't understand why your boss want two copies of the database, a master and a slave. Let's say you want to accept orders, are you going to let the website access the database behind the firewall to insert new orders? It all sounds like the beginnings of a major headache.

badtzmaru

3:41 pm on Feb 17, 2004 (gmt 0)

10+ Year Member



Hello Frank,

Storing the images as BLOB fields is an extremely bad idea and database performance could suffer seriously as a result.

Having the data exist on a master server behind the firewall and then get pushed to a slave server in front of the firewall is OK, assuming there is some reason to do this. With a well-designed system, this could greatly facilitate security and/or scalability.

cashmere

5:03 pm on Feb 17, 2004 (gmt 0)

10+ Year Member



re: pushing
I have a local MySQL db which I work on then upload to the website server. I love it. I also use the local db for a complete local replica of the site so I can enter orders locally. So I have a total of 5 dbs - local product, remote product, local and remote cart customer, and master customer.
My consulant highly recommended a flat file as the product data "master" because it's easier to edit. There's a lot of truth to that and it's worth considering. What tipped me away from that is MySQL Studio - a windows MySQL frontend. check it out.