Log-Structured Merge Tree
https://www.youtube.com/watch?v=i_vmkaR1x-I
https://www.linkedin.com/pulse/day-storage-engines-lsm-tree-farhan-khan/
참고: 데이터베이스와 자료구조 요약
- Red-Black Tree: 삽입/삭제가 빠름.
- B-Tree: 대규모 데이터에서 검색과 범위 쿼리에 최적화됨. SQL-like 연산에 적합.
- 자료구조 선택:
- 데이터베이스는 사용 목적에 따라 다른 자료구조를 선택함.
- Redis: B-Tree 대신 Sorted Sets 등 간단한 구조 사용 (캐시 중심).
MemTable (메모리테이블)
- key값으로 정렬
- balanced binary tree (RedBlack Tree)
- 일정 사이즈에 도달하면 disk의 SSTable에 데이터를 flush 한다.

- in memory hash map을 사용해 각각의 key의 값이 disk의 어디에 있는지 memTable에 저장

- SSTable 이 정렬되어 있기 때문에 메모리에 모든 key의 index를 유지할 필요가 없다
SSTable (Sorted String Table)