> For the complete documentation index, see [llms.txt](https://gunkim.gitbook.io/undefined/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gunkim.gitbook.io/undefined/lsm-tree.md).

# lsm-tree

### 배운 개념

* 단순한 "파일 쓰기"가 아니라 디스크 헤더를 움직이지 않는 \*\*순차 I/O(Append-only)\*\*라는 본질적 하드웨어 메커니즘을 기반으로 함.
* 인덱스가 없는 것이 아님. 메모리의 MemTable과 디스크의 SSTable(희소 인덱스)을 통해 검색을 지원하지만, 여러 테이블을 뒤져야 해서 읽기 성능은 B 트리보다 느림.

### 오답 및 정정

> \[!WARNING] **오개념**: LSM 트리는 쓰기에만 집중하고 인덱스가 아예 없다. **정정**: MemTable과 희소 인덱스를 엄연히 가지며, 단지 여러 파편화된 SSTable을 찾아봐야 하기 때문에 B 트리 대비 읽기가 느린 것임.

### 복습 체크

* [ ] LSM 트리가 B 트리보다 쓰기 속도가 빠른 근본적인 디스크 I/O 레벨의 이유는 무엇인가?
* [ ] MemTable과 SSTable의 역할은 각각 무엇인가?

\[\[b-tree]] \[\[compaction-strategies]] \[\[bloom-filter]]


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gunkim.gitbook.io/undefined/lsm-tree.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
