In order to enable understanding of database internals among UnderGrad CS projects, I am writing the SQL level, the mongodb level, and the KV level beneath that, using vanilla javascript as the language of demonstration and preference. github.com/malbrain/database github.com/malbrain/javascript-database The approach to keys is simplified by keeping a bit map deduplication array to filter in the KV level as the keys are returned by the btree level. Each key needs a small value structure hierarchy used by the plugins.