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
LevelDB入門
Search
Yosuke Furukawa
PRO
June 27, 2014
Programming
10
12k
LevelDB入門
InfluxDB勉強会用資料
Yosuke Furukawa
PRO
June 27, 2014
Tweet
Share
More Decks by Yosuke Furukawa
See All by Yosuke Furukawa
tc39 x jsconf.jp Panel Discussion 2024
yosuke_furukawa
PRO
0
150
Removing Corepack
yosuke_furukawa
PRO
9
1.2k
JavaScript Runtime とはなにか
yosuke_furukawa
PRO
15
2.5k
Strip Types と Storage
yosuke_furukawa
PRO
4
330
Module Harmony について
yosuke_furukawa
PRO
3
1.5k
LTのやり方
yosuke_furukawa
PRO
16
2.1k
AppRouter Panel Talk
yosuke_furukawa
PRO
3
700
Node.js v22 で変わること
yosuke_furukawa
PRO
13
5.2k
リアーキテクトと開発生産性について
yosuke_furukawa
PRO
25
9.6k
Other Decks in Programming
See All in Programming
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
1k
Content Security Policy入門 セキュリティ設定と 違反レポートのはじめ方 / Introduction to Content Security Policy Getting Started with Security Configuration and Violation Reporting
uskey512
1
490
Jakarta EE meets AI
ivargrimstad
0
250
C++でシェーダを書く
fadis
6
4k
EventSourcingの理想と現実
wenas
6
2.2k
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
530
Quine, Polyglot, 良いコード
qnighy
4
630
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.1k
推し活としてのrails new/oshikatsu_ha_iizo
sakahukamaki
3
2k
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
4
650
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
550
Ethereum_.pdf
nekomatu
0
380
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Six Lessons from altMBA
skipperchong
27
3.5k
Visualization
eitanlees
145
15k
YesSQL, Process and Tooling at Scale
rocio
168
14k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Designing for Performance
lara
604
68k
Automating Front-end Workflow
addyosmani
1366
200k
Faster Mobile Websites
deanohume
305
30k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Transcript
LevelDBೖ @yosuke_furukawa
@yosuke_furukawa Node.jsϢʔβʔάϧʔϓද / DeNAॴଐ
None
None
LevelDBೖهࣄॻ͖·ͨ͠
ࠓͦΕͷ͓͞Β͍ + InfluxDB x LevelDBͷ
LevelDBͱ?
GoogleͷBigTableΛϕʔεʹ͠ ͯ։ൃ͞ΕͨܰྔͷKey-Valueܕ σʔλετΞ
༻్ΉͬͪΌ͍
LevelDBಛ
LevelDBಛ • σʔλkeyͰιʔτ͞Εͯ֨ೲ͞ΕΔ • جຊతͳૢ࡞ Put(key, value), Get(key), Delete(key)Ͱ ͋Γɺγϯϓϧɻ
• ෳͷมߋΛatomicͳॲཧʹ͢Δ͜ͱ͕Ͱ͖Δ • consistentͳσʔλͷviewΛಘΔͨΊ(ॻ͖ࠐΈதͰ readͰ͖ΔΑ͏ʹ͢ΔͨΊ)ʹtransient ͳ snapshotΛ࡞ Δ͜ͱ͕Ͱ͖Δ
Architecture
None
8SJUF࣌ʹ-PH 4PSUFE 5BCMF'JMFTʹॻ͘ 3FBE࣌ʹ$BDIF -PH 4PSUFE5BCMF'JMF͔ ΒಡΈࠐΉ
4PSUFE5BCMF
LevelDBཧղͷҰ൪ͷ؊ Sorted String Table
Sorted String Table LFZ P⒎TFU BBB CCC DDD
JOEFY 445 BBB CCC IPHFGVHBʜ DDD ʜ
Sorted String Table LFZ P⒎TFU BBB CCC DDD
JOEFY 445 BBB CCC IPHFGVHBʜ DDD ʜ LFZͰTPSU͞Ε͓ͯΓɺ JOEFYʹϑΝΠϧͷͲ͔͜ΒಡΈࠐ Ή͔ P⒎TFU ͕ॻ͍ͯ͋Δ LFZWBMVFͷॱংͰҰଓ͖Ͱ ϑΝΠϧʹॻ͔ΕΔ
-FWFM -FWFM -FWFM Sorted String Table 445 445 445 445
445 445 445 445 445 445 445 445 445 445
-FWFM -FWFM -FWFM Sorted String Table 445 445 445 445
445 445 445 445 445 445 445 445 445 445 -FWFM%#Ͱ͜ͷ445Λ ֊Խ ͕͜͜-FWFM%#ͷ༝དྷ ͯ͠ཧ͍ͯ͠Δɻ -FWFM͕ਂ͘ͳΕͳΔ΄Ͳ ཧ͢Δ༰ྔ͕૿͑Δ -FWFMͰ.# -FWFMͰ.# -FWFMͰ(# ͱେମഒִؒͰ૿͑ͯ͘
-FWFM -FWFM -FWFM Sorted String Table 445 445 445 445
445 445 445 445 445 445 445 445 445 445 ͜͏͢Δ͜ͱͰԿ͕خ͍͔͠ ֊͕ए͍-FWFM༰ྔগ ͳ͘ɺJOEFYͷ࠶࡞ίετ͕ ͍ɻ JOTFSU͕සग़͢ΔΑ͏ͳ໘Ͱ XSJUFͷੑೳΛޮԽͰ͖Δ
String Sorted Table ઌ΄Ͳͷུ֓ਤΛ445ͷͱ͜ Ζ͚ͩৄࡉʹ͢Δͱ ͜Μͳײ͡ʹͳΔɻ
Put/Get/Deleteͷࡉ͔͍ಈ͖
Put -FWFM NFNUBCMF NFNUBCMFTOBQTIPU 1VU DPQZ MPH EVNQUPEJTL 445 -FWFM
.# 445 445 445 ʜ -FWFM .# 445 445 445 ʜ
Put -FWFM NFNUBCMF NFNUBCMFTOBQTIPU 1VU DPQZ MPH EVNQUPEJTL 445 -FWFM
.# 445 445 445 ʜ -FWFM .# 445 445 445 ʜ શͯͷߋ৽ॲཧҰ୴ .FNUBCMFͱ-PHʹॻ͘
Put -FWFM NFNUBCMF NFNUBCMFTOBQTIPU 1VU DPQZ MPH EVNQUPEJTL 445 -FWFM
.# 445 445 445 ʜ -FWFM .# 445 445 445 ʜ Ұఆྔஷ·Δͱ 4OBQTIPUΛ࡞ͬͯɺ 445ʹEVNQ͢Δ
Put -FWFM NFNUBCMF NFNUBCMFTOBQTIPU 1VU DPQZ MPH EVNQUPEJTL 445 -FWFM
.# 445 445 445 ʜ -FWFM .# 445 445 445 ʜ -FWFM͕ҰഋʹͳͬͨΒ -FWFMʹҠಈͤ͞Δ
Get -FWFM NFNUBCMF (FU MPH 4FBSDI 445 -FWFM .# 445
445 445 ʜ -FWFM .# 445 445 445 ʜ #MPPN'JMUFS -FWFMʹ͋ΔՄೳ ੑ͕͋Δ 4LJQ 4FBSDI 4LJQ
Get -FWFM NFNUBCMF (FU MPH 4FBSDI 445 -FWFM .# 445
445 445 ʜ -FWFM .# 445 445 445 ʜ #MPPN'JMUFS -FWFMʹ͋ΔՄೳ ੑ͕͋Δ 4LJQ 4FBSDI 4LJQ NFNUBCMF -FWFM -FWFM -FWFMͱݟ͍ͯͬͯώοτ ͨ͠Βฦ͢ɻ
Get -FWFM NFNUBCMF (FU MPH 4FBSDI 445 -FWFM .# 445
445 445 ʜ -FWFM .# 445 445 445 ʜ #MPPN'JMUFS -FWFMʹ͋ΔՄೳ ੑ͕͋Δ 4LJQ 4FBSDI 4LJQ ແବͳ୳ࡧͷࢬמΓΛ͢Δͨ Ίʹ#MPPN'JMUFSʹΑͬͯଘࡏ ͢Δ͔Ͳ͏͔Λ֬ೝ͢Δ
Delete -FWFM %FMFUF NFSHF MPH 445 -FWFM .# 445 445
445 ʜ -FWFM .# 445 445 445 ʜ EFMFUFqBH LFZ WBMVF EFMFUFE BCD EFG HIJ EFMFUFqBH LFZ WBMVF EFG HIJ
Delete -FWFM %FMFUF NFSHF MPH 445 -FWFM .# 445 445
445 ʜ -FWFM .# 445 445 445 ʜ EFMFUFqBH LFZ WBMVF EFMFUFE BCD EFG HIJ EFMFUFqBH LFZ WBMVF EFG HIJ جຊతʹ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InfluxDB x **DB 5IF3PDLT%# QFSGPSNBODFJT BNB[JOHMZQPPS IUUQTHJTUHJUIVCDPNIZDFBBCFGC -.%#ͷ࡞ऀ͕ଌఆ͠ͳ͓ͨ͠Β-.%#࠷ڧʹͳͬͨΓͱ ڥʹΑͬͯҟͳΔ༷ࢠɻ
InfluxDB x **DB -.%#࡞ऀ͕ܭଌ͠ͳ͓ͨ͠Βܶతʹվળ͞ΕͯͨΓɺ IBSEXBSFʹΑͬͯมΘΔͷͰɺࣈͯʹ͠ͳ͍΄͏͕͍͍͔ʜ
·ͱΊ • LevelDBͱ • Architecture • Performance • LevelDB x
InfluxDB • InfluxDB x **DB
ࢀߟ • https://www.igvita.com/2012/02/06/ sstable-and-log-structured-storage- leveldb/ • http://yosuke-furukawa.hatenablog.com/ entry/2014/05/05/095207 • https://speakerdeck.com/smly/influxdb-
and-leveldb-inside-out