Skip to content

How to disable the fixed prefix "user" for the key? #30

@luchao2424631502

Description

@luchao2424631502

Key

The minimum key size is 5 bytes (4 bytes for "user" + 1 byte for single digit like "0").
Regarding key generation, it depends on the insertorder option:

ordered: Keys are generated sequentially starting from 1 (user1, user2, user3, ...)
hashed: Keys use hashed 64-bit values for random distribution

You can also use the zeropadding option to fix the key length. For example, with zeropadding=20, keys would look like:

user0000000000000000001
user0000000000000000002
user1234567890123456789

This ensures all keys have the same 24-byte length.

Value

Here's what a typical record might look like:

Key: user1234567890
Value: field0=<100 bytes of data>, field1=<100 bytes of data>, ..., field9=<100 bytes of data>

Here, the field can be thought of as a column in SQL. However, since columns are not supported in key-value stores, they are encoded as follows.

Field Name Length: 32-bit length of field name
Field Name: field name ("field0", "field1", etc.)
Field Value Length : 32-bit length of field value
Field Value: actual field value

So field each is 114 bytes.

Originally posted by @ls4154 in #25
Hello author, now I want to remove the fixed prefix "user" from the key. How can I do that? I didn't see the relevant control parameters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions