LSM Compaction Strategy

2018-12-19  本文已影响10人  chenfh5

Outline

0. Overview
1. Amplification
2. Size-tiered Compaction
3. Leveled Compaction
4. Summary
5. Lucene Merge Policy
6. Reference

Overview

Compaction operations are expensive in terms of CPU, memory, and Disk I/O,而由于immutable特质,该操作在LSM架构上有必不可少。

Log Structured Merge (LSM)

data过来之后会写到memory table (MemTable),当mem满了之后,会flush到disk形成不可变的immutable Sorted String Table (SSTable)。当SSTable太多,os所打开的文件句柄也会过多,所以此时需要将多个同质的SSTable合并成一个SSTable。

leveldb architecture

Amplification


Size-tiered Compaction

tiered (num same,size grow)

Leveled Compaction

leveled (num grow,size same)

Summary

Size-tiered Compaction vs. Leveled Compaction Scylla compaction summary

Lucene Merge Policy

这里同样有三个放大问题,


Reference

上一篇下一篇

猜你喜欢

热点阅读