Forum Moderators: phranque

Message Too Old, No Replies

Web Development Advise

Database, web development, asp, php, mysql

         

mrfori

10:11 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

jatar_k

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

WebmasterWorld Administrator 10+ Year Member



store in DB the products images filenames only and store the images themselves on server filesystem

that's the right way to do it, storing the images just wastes process and makes queries very slow and cumbersome.

As far as backup and publishing from one db to another, it really depends on what you need to do and what is the most efficient for your system and the most intuitive for the people that have to use it. I don't there is a blanket solution.

mep00

5:27 am on Feb 13, 2004 (gmt 0)

10+ Year Member



storing the images just wastes process and makes queries very slow and cumbersome.
While it does add overhead, it doesn't add as much as you're implying. For a large number of pictures, the added benifit of ease of maintenance could easily out weight the small increase in system overhead. Besides, if because of site activity the increase causes a problem, upgrading the hardware is probibly more cost effective than the increase in labor costs.

Computers are there to lighten our burden--not the other way around.

web server outside the firewall
Who says that the Web server shouldn't be inside the fire wall. To not protect your Web server with a fire wall is asking for trouble. Also, it's possible that the db server can sit on a different machine than the Web server.

There are many levels of security which can be implimented depending on your needs and your budget. From whom or from what are you seeking protection? Answering that question (and don't forget that problems can originat on either side of a fire wall; e.g., Joe Newbie accidentally drops a table) and determing the value of your data should guide you in what precausions you need to take. If you don't know, then it's either time to learn or hire someone who does know, or both.

The bottom line is that there are no right answers. Since we live in an imperfect world, the bst you can due is try to find the right balance between costs (monitary or otherwise) and benifits.

There is a saying: "Build a system which is fool proof and only a fool will want to use it."

mrfori

12:50 am on Feb 16, 2004 (gmt 0)

10+ Year Member



Thank you very much guys.

My question really was .. how big online selling companies implement their systems.

Do they have one and only one Master DB with all stock inv, billing systems, accounting, users where the websites queries and work with.

Or they have a different or few Master DB somewhere. and the site work only with Views or on Read only data.

thanks again

chris_jt

8:54 pm on Feb 16, 2004 (gmt 0)

10+ Year Member



First thing is to know how much budget you have, existing resources to work and compare that to the project requiurements. You can look at what the big boys are doing, but know they have deeper pockets. And what works for one may not work for another.
Optimally a data architecture has redundancy in the case of outtages. With a redundancy you also address disaster recovery by having that kind of failover. Every system should have a regular back-up schedule as well. If you do have a redundancy, you gotta put replication into place across servers.
Ideally, you have a server for website delivery and another for handling financials and both of those on replicated machines.
As for image handling... put them in your database. If you have redundancy in your web server architecture then you don't have to worry about server resident images having to be transferred across. Storing everything in your database gives you global accessibility. Also, having it all in your database makes moving a website from one server to another no more complicated than migrating your code. Helpful?

Netizen

2:54 pm on Feb 17, 2004 (gmt 0)

10+ Year Member



My vote would be for putting the image locations in the db, not the images themselves. If the web server and db server are located on different machines then you have added bandwidth usage in retrieving the image from the database. If the images are based on the filesystem then they can end up being stored in the filesystem cache which means a web request just involves copying data from one area of memory to another, which is very fast. You can also either run a dedicated image server or, if you are running RedHat linux you can run tux (RedHat Content Accelerator) in front of your normal web server (Apache, say) so that tux handles all requests for static content and Apache only handles script requests. This can greatly improve throughput and server load.

As an aside, I am not sure why there is a need for two database servers, one behind a firewall, one within, if they both hold the same data.