views:

48

answers:

1

I need to store records in a key value store, and I have considered XML, JSON, or YAML, and pretty much decided on YAML.

However, I am wondering how this will perform when searching through millions of records as alot of text processing is needed. Would it be better to use individual keys for differents columns or use YAML. For example, in YAML I could do:

- record
    id:   34
    type: person
    name: John
    age:  50

and in a key/value store I could use:

person_34_name: john
person_34_age:  50
A: 

Since you have a specific string to search for with a key/value store it would be easyer to find something you're looking for. Otherwise you would have to look for the record id after looking for the specific value.

But in the end, it won't make your search algorithm much more/less efficient.

My question here would be though, why don't you want to use a database for storing "millions of records"? Any fast search system depends on indexes being used for a reason :)

WoLpH
With the particular case I am discussing I need to implement tables on top of a key value store and I dont have a choice.
Zubair
Assuming you've sorted the key/value store by person it would be just as fast.
WoLpH