What is the best way to make autocomplete field using jquery (With mySql or XML ?)
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
开发者_如何学JAVAAccess 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."
精彩评论