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
700
Other Decks in Programming
See All in Programming
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
520
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
120
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
260
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
450
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
430
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
540
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
950
SONY CISC-NEWS NWS-1750 + NWB-225 フレームバッファの NetBSD/news68k ドライバ実装 / OSC2026Hiroshima
tsutsui
0
150
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
260
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
110
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
18
17k
スマート反転とウェブアクセシビリティ
camiha
0
210
Featured
See All Featured
The Curious Case for Waylosing
cassininazir
1
540
Embracing the Ebb and Flow
colly
88
5.2k
The Language of Interfaces
destraynor
162
27k
Building Applications with DynamoDB
mza
96
7.2k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
470
The Cost Of JavaScript in 2023
addyosmani
55
10k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
600
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
66k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
310
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