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

Use a varint encoding for the IID? #299

Open
vlovich opened this issue Oct 24, 2022 · 1 comment
Open

Use a varint encoding for the IID? #299

vlovich opened this issue Oct 24, 2022 · 1 comment

Comments

@vlovich
Copy link

vlovich commented Oct 24, 2022

Today it sounds like Sonic uses a fixed-length 32-bit integer for the IID which limits it to 4B objects per bucket. Would it make sense to switch to a varint encoding for the IID? That would let you handle 64-bit IIDs while also achieving a greater space reduction vs 32-bit IIDs.

@valeriansaliou
Copy link
Owner

valeriansaliou commented Oct 25, 2022

That would unfortunately not work 'as-is' based on the current binary data storage model Sonic uses. It relies on predictible offsets, that is, the size of each block of data (IIDs) must be known in advance.

However, variable length IIDs would be a nice idea, both to increase the max. cardinality of IIDs that can be stored and possibly compact 32 bit IIDs even further eg. to 16 bits if the expected max cardinality is less than 4B.

This would however require substantial refactorings so that this can work.

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