This project is written in typescript, and runs in nodejs.
To get started:
- Install nodejs (I dont really know what minimum version you need, I used 20.10.0)
- Run
npm install
- Run the tests with
npm run test
- Run the "application" with
npm run cli
- Keys and values are only strings
- Object/hashmaps/dictionaries/sets/etc are not considered databases
- We don't actually care about concurrency/transaction management between sessions, just that we can hold temporary state correctly.
- It is acceptable to duplicate key/values to make "indexes", even though
it is not acceptable to duplicate the database for a transaction.
- It is acceptable for transactions to duplicate the things they have modified (e.g. records and correlated indexes), including doubling the size of memory if every row is mutated.
- Example 4 should probably pass as well...
- We dont actually need to serialize state or support storing data larger than available memory.
- The runtime performance of heavily nested transactions is not as critical as scaling with large datasets, e.g. handling 10000 nested transactions is less vital than handling 10000 rows.
- It is less critical to shrink the database when keys or values are removed
- Set and Object lookups are O(1).
- ... more to come ...