A custom storage engine of Nethermind, benefiting from the alignment of the underlying data structure with the layout of State & Storage trees of Ethereum.
This PR introduces a BottomPage that allows accumulating a lot of data changes before flushing them out as a DataPage. To make it work a BottomPage provides two pointers Left and Right that allow to divide keys to two buckets only. Then, on the next level, grandchildren are created if needed. This allows right now to create 7 bottom pages (1 on the 0th level, 2 on the 1st level, 4 on the 3rd level) which greatly reduces greedy fan outs. This could be pushed further with the next level and some more overflow logic if needed.
The structure can be optimized to be used to roll up DataPage on delete. At the same time such big deletes seem to be unlikely.
Similar to #387
Benchmarks
Database size reduced to 269GB, comparing to RocksDb of Nethermind with 158GB. Access times seem to be not impacted at all. Usually it can be up to 1 more level to query.
This PR introduces a
BottomPage
that allows accumulating a lot of data changes before flushing them out as aDataPage
. To make it work aBottomPage
provides two pointersLeft
andRight
that allow to divide keys to two buckets only. Then, on the next level, grandchildren are created if needed. This allows right now to create 7 bottom pages (1 on the 0th level, 2 on the 1st level, 4 on the 3rd level) which greatly reduces greedy fan outs. This could be pushed further with the next level and some more overflow logic if needed.The structure can be optimized to be used to roll up
DataPage
on delete. At the same time such big deletes seem to be unlikely.Similar to #387
Benchmarks
Database size reduced to
269GB
, comparing toRocksDb
of Nethermind with158GB
. Access times seem to be not impacted at all. Usually it can be up to 1 more level to query.