First off all I know:
Premature optimization is the root of all evil
But I think wrong autocomplete can really blow up your site.
I would to know if there are any libraries out there which can do autocomplete efficiently(serverside) which preferable can fit into RAM(for best performance). So no browserside javascript autocomplete(yui/jquery/dojo). I think there are enough topic about this on stackoverflow. But I could not find a good thread about this on stackoverflow (maybe did not look good enough).
For example autocomplete names:
names:[alfred, miathe, .., ..]
What I can think off:
- simple SQL like for example:
SELECT name FROM users WHERE name LIKE al%
.- I think this implementation will blow up with a lot of simultaneously users or large data set, but maybe I am wrong so numbers(which could be handled) would be cool.
- Using something like solr terms like for example:
http://localhost:8983/solr/terms?terms.fl=name&terms.sort=index&terms.prefix=al&wt=json&omitHeader=true
.- I don't know the performance of this so users with big sites please tell me.
- Maybe something like in memory redis trie which I also haven't tested performance on.
- I also read in this thread about how to implement this in java (lucene and some library created by shilad)
What I would like to hear is implementation used by sites and numbers of how well it can handle load preferable with:
- Link to implementation or code.
- numbers to which you know it can scale.
- It would be nice if it could be accesed by http or sockets.
Many thanks,
Alfred