我正试图确定从数据库中收集大量名单的最佳方法,然后在客户方面展示和过滤结果。 让我举一个例子:
<>>Example: 我用客户数据检索一个数据库,目前它包含大约2000年的记录。 这一数字在不断增加。 在我的网站上,我有一页希望能够根据姓名、电子邮件、电话号码等信息查询该数据库,当然也显示结果(Smith的用户类别将包含Smith的所有记录归来)。 我正计划使用非洲宇宙航空研究开发机构,以便我能够查询数据库,并展示类似于“角”的飞行结果。 当用户开始搜索时,结果将随着发现而开始在网页上展示。
Possible Solutions: Unfortunately I am stumped on how to go about implementing something like this. I am considering using a ValueList pattern. When the user first loads the page, should I be querying the database and storing every record in a collection and then searching that collection list and displaying the results on my jsp page? Essentially creating a java database. The thing I like about the ValueList pattern is that I take one huge hit on page load and dump the entire database in objects stored in a list. What if the database is larger though, say 2,000,000 records?
Or should I be using a simple DOA pattern without the ValueList and query the database for each individual search? This would result in a LOT of database queries, especially considering that I plan on returning results as the user types in the search box.
Edit: The more I think about this, the more it is an AJAX question. My biggest concern should be how to query my database while the user is typing. Do I set some sort of listener to listen for the user to stop typing and then perform the query?