Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What key/value Pair is used in mongo-rocks? #203

Open
Mukesh0606 opened this issue Sep 6, 2022 · 2 comments
Open

What key/value Pair is used in mongo-rocks? #203

Mukesh0606 opened this issue Sep 6, 2022 · 2 comments

Comments

@Mukesh0606
Copy link

Couldn't understand what key/value pair is used inside mongo-rocks?

@Mukesh0606
Copy link
Author

while connecting mongodb with rocksdb,
Which attribute is Key?

Which attribute is Value?

@wolfkdy
Copy link
Collaborator

wolfkdy commented Sep 8, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants