2 ms·
My take is that a B-tree + an LSM + periodic merging of the LSM portion into the B-tree is the right solution. In fact, that's a lot like what ZFS w/ ZIL is.
by cryptonector 5y ago
My take is that a B-tree + an LSM + periodic merging of the LSM portion into the B-tree is the right solution.
In fact, that's a lot like what ZFS w/ ZIL is. The ZFS ZIL is not really an intent log, and its name is a misnomer. The ZFS ZIL is a log of past transactions, and the only intent is to merge them into the filesystem's B-tree-like structure.
B-trees are the best data structure for databases, except for write transactions: those are slow in a B-tree due to write magnification associated with the B-tree itself. A log amortizes the cost of writing to the B-tree. But the log also increases the cost of reads, so the log itself has to be indexed, which is what LSMs effectively achieve.