Forum Moderators: buckworks
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
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.
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.