Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the differences between the term SSTable and LSM Tree

Are these two terms used interchangeably?

I have read about how SSTable works, and usually, articles just start mentioning LSM Tree. However, they seem to be the same thing.

When should I use one term over the other?

like image 479
Kakayou Avatar asked Sep 30 '19 13:09

Kakayou


2 Answers

It is very well explained in LSM-based storage techniques: a survey paper in section 1 and 2.2.1

LSM-tree consists of some memory components and some disk components. Basically SSTable is just a one implemention of disk component for LSM-tree.

SSTable is explained by above mentioned paper:

An SSTable (Sorted String Table) contains a list of data blocks and an index block; a data block stores key-value pairs ordered by keys, and the index block stores the key ranges of all data blocks.

like image 89
Łukasz Ślusarczyk Avatar answered Oct 05 '22 02:10

Łukasz Ślusarczyk


Sorted Strings Table (SSTable) is a key/value string pair based file, sorted by keys.

enter image description here

However, LSM Tree is different:

In computer science, the log-structured merge-tree (or LSM tree) is a data structure with performance characteristics that make it attractive for providing indexed access to files with high insert volume, such as transactional log data. LSM trees, like other search trees, maintain key-value pairs. LSM trees maintain data in two or more separate structures, each of which is optimized for its respective underlying storage medium; data is synchronized between the two structures efficiently, in batches.

https://en.wikipedia.org/wiki/Log-structured_merge-tree

https://upload.wikimedia.org/wikipedia/commons/f/f2/LSM_Tree.png

like image 35
Istvan Avatar answered Oct 05 '22 02:10

Istvan