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
410
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
710
Other Decks in Programming
See All in Programming
sbt 2.0: takeoff
eed3si9n
0
160
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
220
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
790
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
180
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.6k
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
280
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
APNsからLive Activityを開始する話
yumnumm
0
170
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
3.9k
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
33k
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
220
Featured
See All Featured
Designing Experiences People Love
moore
143
24k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
890
Site-Speed That Sticks
csswizardry
13
1.6k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
730
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
830
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Done Done
chrislema
187
17k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
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