Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
LSMツリー
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
北村
September 01, 2025
0
21
LSMツリー
北村
September 01, 2025
Tweet
Share
More Decks by 北村
See All by 北村
LLMの出力を構造化したい
shu_kita
0
240
Azure Container Appsを使ってみた
shu_kita
0
170
ギャルのパンティおくれ
shu_kita
1
170
掲示板への不適切な投稿を防ぐ
shu_kita
0
170
正規表現エンジンを自作した話
shu_kita
0
17
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.9k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
910
A better future with KSS
kneath
240
18k
The Limits of Empathy - UXLibs8
cassininazir
1
220
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
120
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
220
Between Models and Reality
mayunak
1
190
Rails Girls Zürich Keynote
gr2m
96
14k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
590
4 Signs Your Business is Dying
shpigford
187
22k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
240
Transcript
LSM-Tree shu-kita
自己紹介 • 出身 ◦ 大阪府枚方市 ◦ 3年前から札幌住み • 業務 ◦
SIer ◦ デバイスドライバ関係 • 趣味 ◦ テニス、フットサルやってます ◦ お笑いが好きです
話すこと • LSM-Tree について ◦ LSM-Treeとは ◦ 全体像 ◦ Get
(Read) ◦ Put (Write) ◦ Delete ◦ Compaction • デモ(時間あれば)
LSM-Treeとは データベースで使用されるストレージエンジンの一種 特徴 • NoSQLデータベースで使用されることが多い ◦ Cassandra, HBase など •
書き込みの負荷が高いワークロードに適している
全体像 • MemTable ◦ データ読み書き用のメモリバッファ ◦ データが溜まったら ファイル(SSTable)に書き込む • SSTable(Sorted
String Table) ◦ キーでソートされたファイル ◦ MemTableの内容をキーで並び変えて、 作成されるファイル • WAL(Write Ahead Log) ◦ DBに対する変更ログ ◦ 障害復旧などで使用する サーバ ストレージ メモリ WAL SSTable MemTable SSTable
Get (Read) 処理 サーバ ストレージ メモリ WAL SSTable MemTable SSTable
クライアント get “key1” ①メモリにあれば、メ モリから返す ②メモリになければ、 ファイル(SSTable) を読んで返す
Put (Write) 処理 サーバ ストレージ メモリ WAL SSTable MemTable SSTable
クライアント put “key1” “value1” ②メモリにデータを格 納 ③メモリが一定のサイズを超えた ら、新しくSSTableを作成する(この 動作をFlushと呼ぶ) ①WALに更新情報を 書き込む
Delete 処理 サーバ ストレージ メモリ WAL SSTable MemTable SSTable クライアント
delete “key1” ②削除フラグを立てたデー タを格納(※) ③メモリが一定のサイズを超えた ら、新しくファイルを作成する (Flush) ①WALに更新情報を 書き込む ※やっている事は Put と変わらない =データ削除のたびにファイルを書き換える必要がない ③メモリが一定のサイズを超えた ら、新しくSSTableを作成する(この 動作をFlushと呼ぶ)
Compaction 処理 サーバ ストレージ メモリ WAL SSTable MemTable 複数の SSTable
から一つの新しい SSTable を作成する(Compaction) この時に古いデータを削除する。 サーバ ストレージ メモリ WAL SSTable1 MemTable key1 : value1 SSTable2 key1 : value2 key1 : value2 ※SSTable2は、SSTable1より新しいとする Compatcion前 Compatcion後