Indexing JSON or XML -


what used technique in indexing json or xml string when storing on nosql database redis?

i know database mongodb provides already, want understand how implement when using key-value store, redis or voldemort.

such that:

  • it allow smooth search or query node entity key or values

with pure key/value store, supposed maintain additional set of keys simulate secondary index.

for instance can store:

user:1   ->   { id:1, firstname:bilbo, lastname:baggins, race:hobbit } user:2   ->   { id:2, firstname:peregrin, lastname:took, race:hobbit } 

and then:

firstname:bilbo   -   > [1] lastname:baggins     -> [1] firstname:peregrin   -> [2]     lastname:took        -> [2] race:hobbit          -> [1,2] 

to find hobbit users, value of race:hobbit, , each returned id, user:id.

of course pure key/value store (memcached instance), difficult manage indexes low cardinalities (ie. lots of entries given value).

with redis, easier due support of set , hash datatypes. also, intersection/union of redis sets convenient way implement queries logical and/or expressions.

see following questions:

how have relations many many in redis

porting sqlite redis

project voldemort supports list storage can used similar purpose (provided there not many entries per value).


Comments