What key/value Pair is used in mongo-rocks?
Opened this issue · 2 comments
Mukesh0606 commented
Couldn't understand what key/value pair is used inside mongo-rocks?
Mukesh0606 commented
while connecting mongodb with rocksdb,
Which attribute is Key?
Which attribute is Value?
wolfkdy commented
For data ident, rocksdb user-key is formated as
[4Byte CollectionPrefix][8Byte RecordId]
RecordId is a collection(or table in SQL) level global incremental unique field to identify a row.
value is simplely formated as the raw bson data user inserted.
For index ident, things are a little more complex, it depends on the index-type, unque or not, and so on.
Take a simple but not precise example, rocksdb user-key is formated as
[4Byte IndexPrefix][var len KeyString]
KeyString is an internal datastructure used in mongodb to represent the index data in an ordered way.