Forum Moderators: open

Message Too Old, No Replies

xml for search?

         

ag_47

4:49 am on May 3, 2008 (gmt 0)

10+ Year Member



First off I am working on site where people make posts in different categories. When people want to view posts in a categoy, instead of searching through an sql table -- which would get slower as the table grows -- I was thinking of creating an xml document with say contains posting IDs, Titles and category and used for quick results of posts. Then if they want to view a specific post, it can be retrieved using the ID nice and easy from the db. Is this a good/bad idea? Would this increase efficiency in any way?
When new posts are aded to the database, they will also be added to the specific xml file too... Or maybe xml is a bad idea?

cmarshall

11:48 am on May 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That depends. I know there are XML-based DB schemas. I haven't used them.

A DB is a DB. It will get slower as it gets bigger no matter what tech you use. The cure for that is Big Iron. Throw more horsepower into the DB engine, whether that be an SQL DB or a file parser.

One problem a lot of XML people have is the "If your only tool is a hammer, all problems become nails." syndrome.

XML is way kewl, and I don't think that it gets enough good press, but I think that most of the problems people have with it stem from trying to shoehorn it into purposes for which there are more efficient solutions.

That being said, I have heard mention a number of times of XML-based DBs, and they may be very good. The XML structure lends itself very well to searching, because of the hierarchical structure of most XML implementations. If that can be reliably indexed, it might do very well.

ag_47

4:02 pm on May 3, 2008 (gmt 0)

10+ Year Member



I see, thanks. Well, I am very enthusiastic in trying this.
Just a quick thought tough, I haven't had experience with this, how fast is PHP with xml? My XML catalogues may grow into thousands of lines (20-50 kb is size I suppose) - would PHP choke at this point? I'm intending to use the newer SimpleXML - seems simple enough, and as long as it will be faster than going through the same 1000 entries in an sql table I willing to give it a try..