index

Identifier number size does not matter for storage space and readability

2021-10-17


Because storage size needed to store a number is logarithmic to the size of the number, big identifier numbers do not take much more space than small numbers.

A Variable length quantity of three bytes can express (2^7)^3 = 2 097 152 distinct numbers which is enough for most purposes when used for identifying entities. Adding one more byte explodes the space of available numbers to over 200 millions.

Because of this, reading big numbers is also not too difficult especially when using 64 as the base. Here is the same number written in different bases:

Each digit in base 64 encoding encodes six bits. Thus a four digit base 64 encoded number can encode a three byte i.e. 24 bit number with the maximum value of : 16 777 216


Variable length quantity
2021-06-16
2021-06-21
2021-08-24
2021-08-26
byte size prefixed values
timestamps as offsets
encoding the byte count of values
struct vs record
random ids versus id sequence
how to maintain id sequences?
should we have separate sequence for the children of each parent entity?
how to maintain id sequences?
timestamps as offsets
Variable length quantity
using custom offset for millisecond precision unix epoch is not worth it
2021-06-17
using custom offset for millisecond precision unix epoch is not worth it
shifted integers
timestamps as offsets

This site is generated with zetgen