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 を実装しながら学ぶ/cybozulabs-youth10-yamamoto
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Cybozu
PRO
March 31, 2021
Technology
580
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
DBMS を実装しながら学ぶ/cybozulabs-youth10-yamamoto
Cybozu
PRO
March 31, 2021
More Decks by Cybozu
See All by Cybozu
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
12
93k
新卒1年目QAが リリース基準の"なぜ"をたどってみた
cybozuinsideout
PRO
1
930
kintone リサーチ副部/UXリサーチャー 業務紹介
cybozuinsideout
PRO
0
200
私たちが『JaSST協賛』から『外部コネクト』チームになった理由
cybozuinsideout
PRO
0
610
LLMでもいつものテスト技術〜意外と半分はこれまでのテストでした〜
cybozuinsideout
PRO
1
1.2k
kintone開発のプラットフォームエンジニアの紹介
cybozuinsideout
PRO
1
1.7k
LLMアプリの品質保証
cybozuinsideout
PRO
1
900
技術広報チームに丸投げしない!「一緒につくる」スポンサー活動
cybozuinsideout
PRO
0
320
テクニカルライター (グループウェア) について
cybozuinsideout
PRO
0
320
Other Decks in Technology
See All in Technology
M5Stackで作る BLEマウス GPSログの世界
tomokusaba
0
420
分析AIエージェントを育てる、動く環境を育てる
codatum
1
1.1k
夫婦で子育てするための育児標準化
codmoninc
PRO
0
320
10年後、Engineering 行為を剥奪されるとして、わたしたちは、どう、何を創ればいいだろうか。 / If Engineering Is Taken Away in 10 Years, How and What Should We Create?
bitkey
PRO
1
190
LambdaWebFunctionsを試してみた / exploring-lambda-web-functions
koukihosaka
1
320
今さら理解するウェブフォントver.2026
takanorip
3
750
アウトプット初心者、半年間のふりかえり
4o1sobblue
0
430
ソフトウェア ファクトリー - 再現性のあるソフトウェアの工場づくり / Software factory
iktakahiro
6
4.9k
[JAWS-UG彩の国埼玉#12]そろそろ準備する?re:Invent2026をやさしく解説 / reinvent2026-sainokuni
sh_fk2
1
340
Active Record Connection Adaptersにおける長年の課題に再び取り組む
yahonda
0
140
実践! SRE × AI - ABEMA における AIOps -
tetsuya28
8
3.1k
実践!Cloud Run ハンズオン!! / Cloud Run handson
y0hgi
2
280
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Mobile First: as difficult as doing things right
swwweet
225
10k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
330
Bash Introduction
62gerente
615
220k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
570
Exploring anti-patterns in Rails
aemeredith
4
540
Abbi's Birthday
coloredviolet
4
10k
Test your architecture with Archunit
thirion
2
2.4k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.4k
Transcript
DBMSを実装しながら学ぶ 山本祥平 1
自己紹介 ・山本祥平 ・芝浦工業大学大学 3年 ・サイボウズ・ラボユース研究生 10期生 ・セキュリティ・キャンプでデータベースゼミが開講されていたことから、DBMSに興味を持つ 2
活動内容 ・RDBMS(Relational Database Management System) の学習 ・『Database Design and Implementation』で紹介され
ているJavaのプログラムを参考にC言語でRDBMSを 実装 Database Design and Implementation ( http://www.cs.bc.edu/~sciore/simpledb/ ) 3
プログラムの構成 File Manager : ファイル入出力を行う Buffer Manager : Buffer Pool(メモリ内で持つデータの集合)の
管理を行う Log Manager : Logの書き込みを行う Transaction Manager ◦ Recovery Manager : Logの読み書きを行う。また、Logを用いて クラッシュリカバリを行う ◦ (Concurrency Manager : トランザクションの同時実行制御を行 う) Table Manager : 登録されるテーブルとフィールドの情報の管 理を行う Table Iterator : システムのファイルに保存されるTableの情報 に対し、参照・変更・追加・削除 File Manager Buffer Manager Log Manager Transaction Manager Table Manager / Table Iterator ユーザ テーブルに対する処理 トランザクションの 開始・終了 4
実装したLoggingの手法 Undo Logging : リカバリ時に、未完了のトランザクションのUndoのみを行うLoggingの手法 ・値の変更を行う際のディスクへの書き込み順序 1. Log FileにUpdate Logを書き込む
2. DB本体の値の変更を書き込む 3. Log Fileに変更を行ったトランザクションのCommit Logを書き込む 古い値 Log File DB本体 ・クラッシュ後とその際のリカバリ後のディスク 古い値 DB本体 クラッシュ後 リカバリ後 (ディスクへの書き込みが 無いときにクラッシュする) なにもしない 5
・クラッシュ後とその際のリカバリ後のディスク(続き) Update Log 古い値 Log File DB本体 古い値 古い値 DB本体
クラッシュ後 リカバリ後 Undoする Update Log 古い値 新しい値 Log File DB本体 新しい値 古い値 DB本体 Undoする Update Log Commit Log 新しい値 Log File DB本体 新しい値 DB本体 なにもしない (Update Logがディス クに書き込まれた後 にクラッシュする) (新しい値がディスク に書き込まれた後に クラッシュする) (Commit Logがディス クに書き込まれた後 にクラッシュする) 6
実行結果① ・insert ・update ・delete insert update delete insert 7
実行例② ・rollback (変更を加えたトランザクションをcommitではなく、rollbackで終了させると、 テーブルがそのトランザクション開始前の状態に戻っていることが確認できる) 8
実行結果③ ・リカバリ機能の確認 (変更を加えたトランザクションをcommitせず終了) (DBを起動し直し、commitしていないトランザクションの開始前の 状態に戻っていることが確認できる) 9
まとめ ・DBMSを学びながら、C言語で実装をした ◦ (最終的にできるようになったDBの操作の列挙 update/insert/print table/rollback/commit) ・大きなプログラムを実装する上で必要なコードの書き方を知ることができた ・これから ◦ トランザクションに関わる研究に触れたい
◦ 並行性制御(Concurrency Control)を持ったDBを実装したい 10 このような貴重な機会を頂きありがとうございました。