You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current approach where everything is stored in memory, if not larger than memory, the database can use a lot of memory; that is not always possible because okvs needs to share memory with other systems.
With an on disk page-based storage layer, called book, it is possible to have a bigger than memory database. The gist of the idea: make it possible to load one page at a time, one piece of the database at a time, spreading the memory usage over time.
book is made of several page of fixed length
the length of pages is fixed so that it is easier to re-use space because it simplifies defragmentation;
On top of the abstraction book, and using one or more page, there is a concept of chapter, where page identifiers of a chapter are not monotonically increasing, nor sorted e.g., a chapter may be read starting at 10, then 3, followed by 7... 42, etc...
Each chapter has its structure, it is not necessarily a linked list;
A primordial chapter is the chapter called 'recycling' that stores the identifiers of the pages that were once useful, and can now be re-used;
Another chapter may be a write-ahead-log;
There are also chapters called level
A level will be an instance of lbst that is serialized until a b+tree is implemented, and immutable as a chapter in a book. A level will be a double linked list of of key-value pairs, with a trie index.
At any time, there is $1 + n$ structure. The first level is stored in memory. When that level reaches the byte size limit, e.g. 10 MB, it is serialized to disk as the most recent level. The n levels are sorted from most recent (newest), to least recent (oldest).
An operation inside an lbst looks for the relevant key, traversing one tree. In the new architecture, there are several sorted trees, a forest of trees: one is in memory, on disk the newest level, to the oldest level. To query for a key, one needs to consider the $1 + n$ trees; hence the time complexity is $O(n * log(m))$ where $m$ is the size of the database including deleted keys. It is possible to keep $n$ under control, and reduce the impact of deleted keys using a merge operation e.g. merging the two levels $n - 1$ and $n - 2$, to produce one, and new $n - 2$ level replacing both previous $n - 2$, and $n -1$. The algorithm used to query simultaneously $1 + n$ trees is called the "zigzag forest traversal" algorithm (it is not the order traversal zigzag algorithm for one tree).
Issues
None
Requirements
a write transaction does not block read-only transactions
The current approach where everything is stored in memory, if not larger than memory, the database can use a lot of memory; that is not always possible because
okvsneeds to share memory with other systems.With an on disk page-based storage layer, called
book, it is possible to have a bigger than memory database. The gist of the idea: make it possible to load one page at a time, one piece of the database at a time, spreading the memory usage over time.bookis made of severalpageof fixed lengthbook, and using one or morepage, there is a concept ofchapter, where page identifiers of a chapter are not monotonically increasing, nor sorted e.g., a chapter may be read starting at 10, then 3, followed by 7... 42, etc...levelAA level will be a double linked list of of key-value pairs, with a trie index.levelwill be an instance oflbstthat is serialized until a b+tree is implemented, and immutable as a chapter in a book.At any time, there is$1 + n$ structure. The first level is stored in memory. When that level reaches the byte size limit, e.g. 10 MB, it is serialized to disk as the most recent level. The
nlevels are sorted from most recent (newest), to least recent (oldest).An operation inside an lbst looks for the relevant key, traversing one tree. In the new architecture, there are several sorted trees, a forest of trees: one is in memory, on disk the newest level, to the oldest level. To query for a key, one needs to consider the$1 + n$ trees; hence the time complexity is $O(n * log(m))$ where $m$ is the size of the database including deleted keys. It is possible to keep $n$ under control, and reduce the impact of deleted keys using a merge operation e.g. merging the two levels $n - 1$ and $n - 2$ , to produce one, and new $n - 2$ level replacing both previous $n - 2$ , and $n -1$ . The algorithm used to query simultaneously $1 + n$ trees is called the "zigzag forest traversal" algorithm (it is not the order traversal zigzag algorithm for one tree).
Issues
Requirements
NON TODO
TODO
high priority
okvs-set! forest key valueokvs-clear!book;The text was updated successfully, but these errors were encountered: