views:

42

answers:

1

My autocomplete field: http://www.faressoft.org/autocomplete/

What is the best way to make autocomplete field using jquery (With mySql or XML ?) and what is the reason ? How to minimize consumption of server resources ?

What is the best way if i have a big database or a small batadase ?

mySql or XML

alt text

+2  A: 

Access to database will be always faster than xml, maintain tasks are easier and it is more extensible.

Parsing XML is always resource consuming.

Regardless of which nodes you want to access, you have to read and parse the entire document.

If you were using it for reading some settings, I would suggest XML is a good option, caching it it would improve performance (this is something we do more commonly in .NET: http://www.asp.net/data-access/tutorials/caching-data-with-the-objectdatasource-cs)

But I think you're doing searches with the autocomplete, so it seems to me it's more inefficient the db.

As another user said in a stackoverflow question:

"XML is not a database. XML is a data interchange format, and using it as a database is generally an abuse."

netadictos
If XML is not a database, so what is it ? I think it's used for saving a data !
faressoft
@faressoft: in itself it's not a database, you could construct an Xml-based database in any case. This doesn't solve the question. It is a question of performance. A limousine is a very attractive car, but I wouldn't use it for a F1 race.
netadictos