adamfowleruk / groundupdb

Creating a database from the ground up in C++ for fun!
Apache License 2.0
109 stars 25 forks source link

Implement hash based storage not raw key #11

Closed adamfowleruk closed 3 years ago

adamfowleruk commented 3 years ago

[Who] As a programmer using a database [What] I want to be able to use any form of key name with any characters (not just ones acceptable for file names) [Value] So I'm not constrained in my application design, and can design exactly for my users' needs without needing to worry about the underlying database storage mechanism

The chosen approach is to use the existing highwayhash wrapper class to create a key hash and use that hash value (a 64 bit number currently) in key-value file names. This will also necessitate a new file - the HASH.key file to link the hash to its original value.

(Note: In future don't assume each hash has only one value - support the resolution of hash clashes based on timestamp and change number. (part of AOF or MVCC implementation). Out of scope for now.)