Why is the default key size 21 byte?
hamsterdb tries to take advantage of modern processor’s caching mechanism. Cache lines are usually 32 bytes large. Each Database key has an internal overhead of 11 bytes. If the total key size is 32 bytes, and you substract the overhead of 11 bytes, the remaining 21 bytes are for the key data. Benchmarks show that a total key size of 32 bytes result in a (small) performance advantage (i.e. compared to a size of 40 or 50 bytes). However, if your keys are smaller, a total key size of 16 bytes (which means a payload of 5 bytes) would be better, because more keys would fit on a Database page, and less page splits would happen.