Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
DBMS自作によるトランザクション処理の学習
Search
Yutaro Oguri
March 26, 2024
Programming
400
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
DBMS自作によるトランザクション処理の学習
Yutaro Oguri
March 26, 2024
More Decks by Yutaro Oguri
See All by Yutaro Oguri
gokartの分散並列化ライブラリkannonの紹介 @【Sansan×エムスリー】gokartで爆速開発!MLOps勉強会
yutarooguri
0
4.4k
MLパイプラインをk8sで並列分散化するOSS "kannon"の開発
yutarooguri
1
520
デバッガを自作してみよう (M3 tech talk)
yutarooguri
1
690
Other Decks in Programming
See All in Programming
Webの地図
yosuke_furukawa
PRO
6
4.3k
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
4k
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
3
530
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
2k
Security issues being discussed on Web Platforms
petamoriken
0
810
【DroidKaigi 2026】「アクセシビリティを利用するとき、 アクセシビリティもまたこちらを利用している」 〜マルウェアによる攻撃と防衛について〜
halunoyo
0
450
Heart of Swift Concurrency
koher
0
300
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
370
PHPプロジェクトの結合バランスを可視化する #php_night
kajitack
0
240
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
670
AIは賢い。でも実行環境は? CLIおじさんがAI時代に伝えたいこと ~ CLIおじさんがAI時代に伝えたいこと ~
curekoshimizu
1
240
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
0
150
Featured
See All Featured
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
We Are The Robots
honzajavorek
0
370
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
270
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
830
How to Think Like a Performance Engineer
csswizardry
28
2.8k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
450
From π to Pie charts
rasagy
0
360
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.6k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
Transcript
DBMSࣗ࡞ʹΑΔ τϥϯβΫγϣϯॲཧͷֶश খ܀༔ଠ 1
自己紹介 • 小栗 悠太郎 (Yutaro Oguri) • 東京大学 工学部 電子情報工学科
B4 • GitHub: maronuu • 研究: Approximate Nearest Neighbor Search (ベクトル検索) • 興味: 検索, DBMS, データ基盤, k8s, … 2
概要 • ラボユース: 2023/10〜活動開始 • ”Database Design and Implementation”という本を ベースにDBMSについて学びながらC++で自作
• トランザクション処理に注目 • 展望: ベクトル検索拡張機能の追加 3
DBMSの全体像 • File Manager ◦ ファイルI/O • Log Manager ◦
Logの書き込み • Buffer Manager ◦ Buffer pool (on RAM) • Recovery Manager ◦ Logを元に復元 • Concurrency Manager ◦ 並行制御 4
DBMSの全体像 • File Manager ◦ ファイルI/O • Log Manager ◦
Logの書き込み • Buffer Manager ◦ Buffer pool (on RAM) • Recovery Manager ◦ Logを元に復元 • Concurrency Manager ◦ 並行制御 5 実装したい部分
トランザクション • 1つ以上の処理をまとめた操作の単位 • 例: 2人のユーザが同一データに対して write / readをする場合 •
インタフェース ◦ Read(x), Write(x, val) ◦ Abort(), Commit() • 適切に Lock を取るなどして対処 • lockをとる対象 ◦ Block, value, file, … 6 Image is from https://qiita.com/kumagi/items/5262ff4551ba19943b70
自作DBMSにおけるLockプロトコル • Lockをとる対象: block ◦ tx.pin(block) • 2PLプロトコル ◦ Readする直前に、対象Blockに対してshared
lock (read lock) をとる ◦ Writeする直前に、対象Blockに対してexclusive lock (write lock) をとる ◦ Commit / Rollback後に全てのlockを解放する 7
現状 • File Manager ◦ ファイルI/O • Log Manager ◦
Logの書き込み • Buffer Manager ◦ Buffer pool (on RAM) • Recovery Manager ◦ Logを元に復元 • Concurrency Manager ◦ 並行制御 8 クエリ言語を介する File / Log / Buffer までは実装済み
今後の展望: ベクトル検索拡張機能 • ベクトル検索とは? ◦ ベクトルの集合から最もクエリベクトルに近いベクトルを探す ◦ 深層学習モデルによる埋め込みベクトルの活用 • 例)
sqlite-vss ◦ SQLiteでベクトル検索を可能にする拡張機能 ◦ SELECT papers.*, vss_papers.distance FROM vss_papers JOIN papers ON vss_papers.rowid = papers.id WHERE vss_search(vss_papers.summary_embedding, vss_search_params(?, 10)) 9
今後の展望: ベクトル検索拡張機能 必要となる変更 • ベクトル形式の レコードのサポート • 並行制御をどうする? ◦ ベクトル検索では
Readが圧倒的 ◦ とりあえずなし? 10