Bipartite Unique Identifier
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
basex
.gitignore
LICENSE
README.md
badger_test.go
buid.go
buid_gen.go
buid_gen_test.go
buid_test.go

README.md

buid: Bipartite Unique Identifier

A BUID is a 128-bit unique ID composed of two 64-bit parts: shard and key.

It is not only a unique ID, but also contains the sharding information, so that the messages with the same BUID could be stored together within the same DB shard.

Also, when a message is stored in a shard, the shard part of the BUID can be trimmed off to save the space, and only the key part needs to be stored as the primary key.

Bigendian is chosen to make each part byte-wise lexicographic sortable.

The string representation uses basex 62 encoding.

TODO:

  • monotonic clock to pretect ID generation from clock going backward