开发者

Is YAML suitable for storing records in a key value store?

开发者 https://www.devze.com 2022-12-22 15:33 出处:网络
I need to store records in a key value store, and I have considered XML, JSON, or YAML, and pretty much decided on YAML.

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:  5开发者_如何学C0


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 :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号