which is the efficient db for autosuggest for some million datas

988 views Asked by At

i need to know which will be the best db for an autosugest db with some 80 million records...

    1)Redis
    2)tokyoCabinet
    3)Kyoto Cabinet
2

There are 2 answers

0
Jordan On

This site may have what you're looking for: http://perfectmarket.com/blog/not_only_nosql_review_solution_evaluation_guide_chart

You have several things to consider:

  1. Volume of data - the database should be able to handle lots of records and large files
  2. List item
  3. Speed of inserts and retrieval
  4. Stability - you don't want to go down because you're hammering the DB with lots of hits, as is common with an autosuggest

I know it isn't on your list, but I would go with MongoDB. If you can't then I would go with Redis, simply for the speed factor.

0
coleifer On

Redis is a great fit for autosuggest because of its sorted sets (implemented as a skiplist). The schema I've used w/success basically has each partial word as a key (so "python" would map to keys: "py", "pyt", "pyth", "pytho", and "python"). The data associated with each key is a sorted set where the value is there to provide lexical ordering of the original phrase (provide sorting of the results) and the key is an id mapping to the data you wish to return. I then store the ids and data in a hash.

schema

Here is a sample project written in python, with more details: https://github.com/coleifer/redis-completion