使用jquery创建自动完成字段的最佳方法是什么(使用mySql或XML?)

使用jquery创建自动完成字段的最佳方法是什么(使用mySql或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

alt text

我的自动填充字段: http://www.faressoft.org/autocomplete/ p>

使用jquery创建自动填充字段的最佳方法是什么(使用mySql或XML ?),原因是什么? 如何最大限度地减少服务器资源的消耗? p>

如果我有一个大型数据库或小型数据库,最好的方法是什么? strong> p>

mySql strong>或 XML strong> p>

p> div>

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."