Forum Moderators: coopster

Message Too Old, No Replies

Storing content in databases

         

supermanjnk

3:03 am on Dec 6, 2004 (gmt 0)

10+ Year Member



I'm debating storing all my content in a database. what I was wondering was if thats a good idea. By good idea, I mean speed wise, and search engine wise, or is it a better idea to just keep it in the actuall document instead of calling it from sql?

bubone2

3:09 am on Dec 6, 2004 (gmt 0)

10+ Year Member



I would say that it depends on how you need to use this information. Is it something that has no need to be stored for future use? If so, then just handle it by virtue of $_POST or other form handling methods. Guess I need to know a little more about your situation.

But in general it has been my experience (an someone feel free to enlighten me if this is off) that MySQL queries process very quickly. The times that I have had slow results were on import scripts with big data sets (4000 records). However, in that situation I was also writing to a file (which is what I think made the overall process slow).

So I would say, if you have a need to use that data sometime down the road, MySQL dbs are very useful and I would encourage you to use them.

Josh

ergophobe

4:49 am on Dec 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Using the filesystem directly is, speaking on a percentage basis, quite a bit faster than using the DB, but as Josh just said, on an absolute basis, the DB is very fast.

My rule of thumb is to use a DB if I think it will make life easier. If there's a speed penalty, it's probably worth paying. If it's a low traffic site like mine are, who cares? The speed issue is only a problem when the server load gets high and things start slowing down. If it's a high-traffic site, presumably you have the financial resources to put some computing horsepower into it.

If it's a site with just a handful of relatively static pages and it is certain that it will stay that way, I just use the file system as I don't see any advantage to using a database. One site I have has about 6,000 constantly updating pages and they are almost always accessed via a local search. In that case, a DB is the only way to go.

Tom