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
Talk on Database (ja)
Search
UENISHI Kota
January 31, 2014
Technology
14
14k
Talk on Database (ja)
筑波大学の2013年度の情報システム特別講義Dのスライド
UENISHI Kota
January 31, 2014
Tweet
Share
More Decks by UENISHI Kota
See All by UENISHI Kota
Metadata Management in Distributed File Systems
kuenishi
2
470
Behind The Scenes: Cloud Native Storage System for AI
kuenishi
2
330
Apache Ozone behind Simulation and AI Industries
kuenishi
0
300
Distributed Deep Learning with Chainer and Hadoop
kuenishi
3
1.1k
A Few Ways to Accelerate Deep Learning
kuenishi
0
1k
Introducing Retz
kuenishi
5
1.1k
Introducing Retz and how to develop practical frameworks
kuenishi
3
680
Formalization and Proof of Distributed Systems (ja)
kuenishi
10
6.3k
Mesos Frameworkの作り方 (How to Make Mesos Framework)
kuenishi
7
2.3k
Other Decks in Technology
See All in Technology
kargoの魅力について伝える
magisystem0408
0
200
マイクロサービスにおける容易なトランザクション管理に向けて
scalar
0
120
AWS re:Invent 2024 ふりかえり
kongmingstrap
0
130
podman_update_2024-12
orimanabu
1
270
権威ドキュメントで振り返る2024 #年忘れセキュリティ2024
hirotomotaguchi
2
740
LINE Developersプロダクト(LIFF/LINE Login)におけるフロントエンド開発
lycorptech_jp
PRO
0
120
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
310
LINEヤフーのフロントエンド組織・体制の紹介【24年12月】
lycorp_recruit_jp
0
530
オプトインカメラ:UWB測位を応用したオプトイン型のカメラ計測
matthewlujp
0
170
第3回Snowflake女子会_LT登壇資料(合成データ)_Taro_CCCMK
tarotaro0129
0
190
生成AIをより賢く エンジニアのための RAG入門 - Oracle AI Jam Session #20
kutsushitaneko
4
220
C++26 エラー性動作
faithandbrave
2
730
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Making the Leap to Tech Lead
cromwellryan
133
9k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Become a Pro
speakerdeck
PRO
26
5k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
BBQ
matthewcrist
85
9.4k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Producing Creativity
orderedlist
PRO
341
39k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Transcript
σʔλϕʔεͷͳ͠ Basho Japan KK Kota UENISHI 2014/1/31
ͲͪΒ༷Ͱ͔͢ʁ • @kuenishi • NTTݚڀॴ ˠ Basho • Erlang/OTPΛॻ͍ͯࣄΛ͍ͯ͠·͢ •
ࢄσʔλϕʔεɾࢄγεςϜͷ༻։ൃྺ 6 • ϛυϧΣΞతͳͷ͕ൺֱతಘҙͰ͢
• Riakͱ͍͏OSSͷࢄσʔλϕʔε Λ࡞ͬͯച͍ͬͯ·͢ • Riak CSͱ͍͏OSSͷΫϥυετ ϨʔδΛ࡞ͬͯଧ͍ͬͯ·͢ • ʮࢄਥʯΧϯϑΝϨϯεRicon.io •
Basho.com 3
͖͔͚ͬ 4 தུ ʮ༰ͱͯ͠riakͱ ɹNoSQLΛؚΊͯ ɹ͚ͨΒʯ
ࠓ͓΅͑ͯΒ͏͜ͱ • NoSQLόζϫʔυͰ͋Γɺఆٛͳ͍ • ͍Ζ͍ΖͳσʔλετΞͱͦͷྨɺ͍͚ͷίπ • ࢄγεςϜσʔλϕʔεपลͷɺ၆ᛌਤ • RiakૉΒ͍͠σʔλϕʔεͰ͋Δ
ͦͦ σʔλϕʔεͱԿʁ • ΞϓϦέʔγϣϯͷσʔλΛίϯϐϡʔλʹอଘ͢Δ ͨΊͷιϑτΣΞʢϥΠϒϥϦ or αʔόʔʣ 6 01010110100001001011 11001010101010100101
01001010101001010100 10101010010111111110 00000101111100101010 00000010010101001001 01001010010010100
อଘ͢Δͱ͖ͷཁٻ • σʔλΛਖ਼͘͠ॻ͖ࠐΉ͜ͱɺσʔλͷߋ৽͕த్ ͳঢ়ଶͰࣦഊ͠ͳ͍͜ͱ • ॻ͖ࠐΜͩσʔλΛਖ਼͘͠ಡΈग़͢͜ͱ • ॻ͖ࠐΜͩσʔλΛผܗࣜʹมͯ͠ಡΈͩ͢͜ͱ • ϋʔυΣΞੑೳͷݶք·Ͱߴʹอଘ͢Δ͜ͱ
• ϋʔυΣΞੑೳͷݶք·ͰߴʹಡΈग़͢͜ͱ • σʔλ͕ফ͑Δ͕݅ਖ਼֬ʹ໌͍ͯ͠Δ͜ͱ 7
ྺ্࢙ͷσʔλϕʔε • IDS (GE, 1963) • ֊ܕDB • IMS (IBM,
1966 -), • ωοτϫʔΫܕDB • CODASYL (1969, COBOL), • ࠓಈ͍͍ͯΔ͋Δ 8
1977 System R (IBM) • ؔͷཧʹج͍ͮͨσʔλૢ࡞ݴޠ SQLΛ࣮ͨ͠ੈքॳͷσʔλϕʔε • Ұ؏ͨ͠σʔλʹର͢Δෳͷૢ࡞Λશͯ ޭɾશࣦͯഊʹ·ͱΊɺෳͷߋ৽ཁٻ
Λฒߦ੍ޚ͠ɺσʔλΛӬଓԽ͢Δτϥϯ βΫγϣϯॲཧΛ࣮ͨ͠ੈքॳͷσʔλ ϕʔε • ۀॲཧͷϞσϧʹඇৗʹΑ͘Ϛονͨ͠ ͨΊɺരൃతʹීٴɹˠISOͰඪ४Խ • 1983 Oracle v3 • 1987 Sybase SQL Server (ݱMicrosoft SQL Server) 9
͡Ί͔ΒSQLͩͬͨΘ͚ͰϦϨʔγϣφϧ ͩͬͨΘ͚Ͱͳ͍ ͭ·Γ… 10
RDBMSͷ࣌ • ACIDಛੑʹج͍ͮͨτϥϯβΫγϣϯཧ • SQLͱ͍͏౷Ұ͞ΕͨΠϯλʔϑΣʔε • ੈքதͷΤϯλʔϓϥΠζͷσʔλཧΦϑΟεͷOA ԽɾγεςϜͷΦʔϓϯԽʹ͍RDBMS͕ओྲྀʹ • εέʔϧΞοϓͷ࣌Ͱ͋Δ
• 1995ͷHDDͷGB୯Ձ: ~7.5ສԁ/ GB 11
• 2003ʙɹITόϒϧ่յޙ • Ոఉ༻ίϯϐϡʔλɺϒϩʔυόϯυͷීٴ • Web 2.0ɺϒϩάɺWikipediaɺEϝʔϧɺWebݕࡧɺEC • 1998 Googleۀ
• 1995 Amazonۀ • “Web Scale” ͷσʔλྔ 12 Webͷ࣌
• ٻΊΒΕΔ͜ͱ͕มԽ: ߏ؆୯Ͱɺྔτϥ ϑΟοΫɺϨεϙϯεɺՄ༻ੑͳͲͷཁٻ͕ଟ༷ ԽɾߴԽ • σʔλͷ୯Ձ͕͍҆etc • RDBMSͰղܾͰ͖ͳ͍Φʔμʔ·Ͱσʔλྔ͕ ૿Ճ͢ΔʹैͬͯɺͦΕΛղܾ͢Δٕज़͕ొ
• ؔϞσϧɺSQLͰѻ͍ʹ͍͘σʔλϞσϧʢ୯ ७͕ͩΑ͘มԽ͢Δσʔλߏʣ • 2003ͷHDDͷGB୯Ձ: 100ԁ / GBɹ(120GB) 13 “Web Scale”
Web ScaleͷΞϓϩʔν • Ոఉ༻ίϯϐϡʔλͱಉ͡HW • LAMP + Memcached(2003) • Redis
(2009) • Google: GFS(2003), BigTable(2006) • Hadoop (2006), HBase (2006) • Amazon: Dynamo(2006) • Cassandra (2008), Riak (2009) 14
ຊʹղ͖͍ͨ 15
εέʔϦϯάͷ 16
εέʔϦϯάͷํ๏ • ෳͷϊʔυʹσʔλΛࢄอ࣋ͯ͠ྔΛՔ͙ • ʮͲͷσʔλ͕Ͳͷαʔόʔʹೖ͍ͬͯΔ͔ʁʯ 17
18
ϋογϡతϧʔςΟϯά • Riak, Cassie, DynamoͳͲ • Կ͕Ͳ͜ʹ͋Δ͔ Θ͔Γʹ͍͘ • εέʔϧΞτɺ
ෛՙࢄ͕؆୯ 19 node1 node2 node3 node4
“ϋογϡత” • ΩʔͱϊʔυIDΛϋογϡԽͯ͠ಉ໊͡લۭؒʹஔ͘ • ϋογϡͷ୯ҐͰσʔλΛׂͯ͠ஔ • ϊʔυՃɾআͷͱ͖ͷσʔλ࠶ஔΛ࠷খݶʹͰ ͖Δ 20 {foo,
SomeData}! Hash(foo)%N! Hash(node1)%N!
21 Locality vs Load Balancing - Use Cases • ઌಡΈΛޮ͔ͤͯόϧΫͰγʔέϯγϟϧΞ
Ϋηε • - HBase, BigTable, etc • ϋογϡͰࢄͤͯ͞ෛՙࢄͯ͠ϥϯμϜ ΞΫηε • - Riak, Cassie, etc
߹ੑͷ 22
Q. ߹ੑͬͯͳΜͩͱ ͓͍·͔͢ʁ 23
߹ੑʹ2ͭͷจ຺͕͋Δ • ڞ௨͢Δͷʮ୭͕ݟͯಉ͡Α͏ʹݟ͑Δ͜ͱʯ • ෳछྨͷσʔλؒͷInvariant͕कΒΕ͍ͯΔ͜ͱ • “ACID” తͳAnomaly͕ൃੜ͠ͳ͍͜ͱ • Phantom
Read, Write Skew, etc etc… • ෳͷσʔλͷίϐʔ͕ಉ͡Ͱ͋Δ͜ͱ • ෳͷίϐʔΛ҆શʹߋ৽Ͱ͖Δ͜ͱ • ผʑͷਓͰಉ͡σʔλΛݟΕ͍ͯΔ͜ͱ
25 Consistent Replication is Difficult • ϨϓϦέʔγϣϯॱ൪͕ೖΕସΘΔ • CPUͷΞτΦϒΦʔμʔ࣮ߦͱಉ͡ w1
w1 w1 w2 w2 w2 Actor 0 Actor 1 Actor 2 w2 w2 w1
ࢄ߹ҙ • ʮෳ͕ͯ͢ಉ͡Ͱ͋Δʯ • ʹʮશһ͕ͻͱͭͷʹ߹ҙͰ͖͍ͯΔঢ়ଶʯ • ΞϠγ͍ಈ࡞Λ͢ΔՄೳੑ͕͋Δͷ • ωοτϫʔΫ •
߹ҙ͢Δ૬ख • ੍ݶ࣌ؒɿແݶ 26
·͡Ίʹॻ͘ͱ… • ͍ͭͰյΕΔՄೳੑͷ͋Δෳͷϊʔυ͕ɺ • յΕͯ·ͨ෮ؼ͢ΔՄೳੑ͋Δ • ฦࣄ͕͍͚ͩͷ߹ • ৴པੑͷ͍ϊʔυؒ௨৴Λͬͯ •
ͷ͘͢͝Ԇ͍ͯ͠Δ͚Ͳ࣮ಧ͘ • ͻͱͭͷΛ߹ҙ͢ΔʢͷʹͲͷΑ͏ͳ݅ͱϓϩτ ίϧ͕͋ΕΑ͍͔ʁʣ 27
ͳ͍ͥ͠ͷ͔ • ࢮ׆ࢹ͕͍͠ • ϦʔμʔΛఘΊΔɺϚελʔΛఘΊΔɺetc • ࢳిͰࢮ׆ࢹ͢Δ࿅श • ނোϞσϧͷͳ͕͍͠Ζ͍Ζ͋Δ 28
ࢮ׆ࢹ͍͠ • ʮࢮΜͩ͜ͱʯΛਖ਼͘͠ݟ͚ͭΔͷ͍͠ • ࣮ݧʢ͕࣌ؒ͋Εʣ 29
ʮࢮΜͰ͍Δʯ is Կ 30 © ʮేͷݓʯݪɺଚ
ނোతࠔΔ͜ͱͷྨ Crash Failure ɹ (fail-stop, fail-safe) ނোͨ͠Βࢭ·Δɺࢭ·ͬͨ͜ͱ͕͢ ͙ʹ͔Δ Crash Failure
(fail-silent) ͬͯࢮ͵ Crash Recovery ނোͨ͠ϑϦͯ͠ΒΜΓͯ͠ؼͬͯ ͘Δ Omission Failure (receive / send) ϝοηʔδܽམ Timing Failure ·ͱͳͰಈ͔ͳ͘ͳΔ Response Failure Ϩεϙϯε͕͓͔͍͠ʢσʔλ͕յΕͯ ͍Δetcʣ Arbitrary Failure Ϗβϯνϯނোɺѱҙͷ͋ΔϠπ͕͍Δ 31
ࢄ߹ҙͷछྨ • ʮΞτϛοΫϒϩʔυΩϟετϓϩτίϧʯ • ͓͓·͔ʹ͍ͬͯࢄ߹ҙ͢ΔͨΊͷϓϩτίϧΛ ૯শͯ͠ • ΞτϛοΫ͡Όͳ͍ϒϩʔυΩϟετࢁ͋ͬͯͦ ΕͳΓʹಈ͍͍ͯΔ •
දతͳͷPaxos, Rafter, ZAB 32
33 Consensus Based Replication • ϨϓϦέʔγϣϯͷϦʔμʔΛଟܾͰબग़ • or ϨϓϦέʔγϣϯຖʹଟܾ w1
w1 w1 w2 w2 w2 Actor 0 Actor 1 Actor 2 w2 w2 w1
34 What is PAXOS? – Example Two phase election
– phase 1 Larger n is prior 21:32 8ß: ¼ ÛËÙêîĝ 21:36 O2Ě 21:35 [_ÕðJK 21:36 O2ÙÐÄorz 21:38 O2ÙÐÞorz n=3 n=1 n=2 8
35 What is PAXOS? – Example Two phase election
– phase 2 confirmation 21:42 Ãğ 21:41 O2ÙÀÀ ëÞĝĚ 21:43 a~Å… 21:44 Ãğ 21:43 GJ proposer 21:43 ÀêO2ÚyÁËÚ Ù|N`çÜßÙ n=4 9
Մ༻ੑͷ • σʔλΛ͍͟ॻ͖ࠐ͏ͱࢥͬͨॠؒʹσʔλ͕σʔλϕʔε ͕མ͍ͪͯͨΓݻ·͍ͬͯͯϏδωενϟϯεΛಀ͢ 36
CAPఆཧ ͲΜͳނোʹରͯ͠ QBSUJUJPOUPMFSBODF σʔλৗʹ߹͓ͯ͠Γ DPOTJTUFODZ γεςϜ͕ࢭ·Δ͜ͱͳ͍ BWBJMBCJMJUZ
• ͜ͷ3ͭΛಉ࣌ʹຬͨ͢γεςϜଘࡏ͠ͳ͍ • ͜Ε·ͰͷRDBMSCAॏࢹ 37
CAPఆཧʢCॏࢹͷ߹ʣ • n1ͱn2ͷϨϓϦΧΛৗʹ߹͓ͤͯ͘͞ • ωοτϫʔΫ͕ΕͨΓނোͨ͠ΒࢭΊΔˠՄ༻ੑˣ 38 w1 w2 n1 n2
CAPఆཧʢAॏࢹͷ߹ʣ • n1ͱn2ͷϨϓϦΧΛৗʹ͑ΔΑ͏ʹ͢Δ • ωοτϫʔΫ͕ΕͨΓނোͯ͠ॻ͚Δˠ߹ੑˣ 39 w1 w2 n1 n2
CAPఆཧʢPॏࢹͷ߹ʣ • n1ͱn2ͷϨϓϦΧΛΤεύʔʹ͢Δ • ωοτϫʔΫ͕ΕͨΒਖ਼͍͠ํ͕Θ͔ΔˠՄ༻ੑͪ ΐͬͱˣ 40 w1 w2 n1
n2
Amazon’s Dynamo • ʮσʔλϕʔεϦϨʔγϣφϧ͚ͩ͡Όͳ͍ɺ߹ ੑ͚ͩ͡Όͳ͍ɺՄ༻ੑ͕େࣄͳ߹͋ΔΜͩʯ • ΞϚκϯͷγϣοϐϯάΧʔτʹΘΕ͍ͯͨ • Vector Clocks
• Handoff • (CRDT in Riak) 41
ʮͱΓ͋͑ͣॻ͘ʯͱ͍͏ߟ͑ • “Hinted Handoff” Ϧϯάͷ࣍ͷਓ ʹͱΓ͓͋͑ͣͯ͘͠ • ނো͔Β͖ͬͯͨΒฦ͢ • ॻ͖ࠐΈ͕ॏෳͨ͠Βʁ
42 w1
ͱΓ͋͑ͣॻ͍͓͍ͯͯ ॻ͖ࠐΈ͕িಥͨ͠Βʁ • ྆ํ͓͍࣋ͬͯͯɺিಥͨ͠σʔ λͷʮҼՌؔʯΛ໌Β͔ʹ͢Δ • “Vector Clock” • {a:
1, b:2, c:1} ͱ {a: 2, b:2, c:1} • {a: 1, b:2, c:1} ͱ {a: 1, c:1, d:1} • িಥͨ͠ͷΞϓϦͰղܾ 43 w1 w2 r
44 CRDT • CRDT (Conflict-Free Replicated Data Types • “AP”
Λαϙʔτ • Counter, Register, Sets, Maps • →ผεϥΠυʁ
45 CRDTͰͷRead • ॱ൪͕ೖΕସΘͬͯ݁Ռ͕มΘΒͳ͍ܕ • update(w1, update(w2, Data0) = update(w2,
update(w1, Data0) = Data w1 w1 w1 w2 w2 w2 Actor 0 Actor 1 Actor 2 w1(w2(Data0)) => Data w1(w2(Data0)) => Data w2(w1(Data0)) => Data
ACID vs BASE ACID BASE ߹͍ͯ͠ͳͯ͘ ৗʹσʔλʹΞΫη εͰ͖Δ Basically Avaiable
Atomicity ෳͷૢ࡞ͷޭɾ ࣦഊΛ·ͱΊΔ Consistency Խ͞Εͨσʔλ ෳͷϦϨʔγϣ ϯ͕ৗʹ߹͍ͯ͠ Δ ࠷ऴతʹ߹ͨ͠ঢ় ଶʹͳΔ͜ͱ͕อূ ͞Ε͍ͯΕΑ͍ Eventually Consistent Isolation ฒߦཧͯ͠ߋ৽్ தͷঢ়ଶΛݟͤͳ͍ Durability σʔλΛӬଓԽͯ͠ ࣦΘͳ͍ ϨϓϦΧܾఆత Ͱͳ͘ɺ֬తͰ ͋ͬͨΓɺάϩʔό ϧʹҰ؏͍ͯ͠ͳ͘ ͯΑ͍ Soft-state 46
σʔλετΞͷྨ࣠ 47
ΫΠζɿͲ͜·Ͱ͕DB? Ͳ͔͜Β͕NoSQL? ACIDͳτϥϯβΫγϣϯ τϥϯβΫγϣϯͳ͠ SQLΠϯλʔϑ Σʔε Oracle MySQL PostgreSQL SQL
Server, DB2 Cassandra (CQL) Hive, Presto Impala ಠࣗAPI InnoDB BerkeleyDB FoundationDB Riak MongoDB Redis 48
ςετʹग़ͳ͍ຊͷ͜ͱ 49
CAPఆཧ͔ΒΈͨͷྨ • CAॏࢹ • RDBMS, MongoDB, HBase, etc… • ߹ੑҡ࣋ͷͨΊͷࢄ߹ҙʢਖ਼͘͠ϑΣΠϧΦʔ
όʔ͢ΔͨΊʣͷΈ͕ඞཁ • APॏࢹ • Cassandra, Riak, CouchDB • ࢄ߹ҙͷΈ͕ෆཁʹ࣮ӡ༻؆୯ 50
͜͜·Ͱͷ·ͱΊ: ͱͯᐆດͳද CAॏࢹ APॏࢹ RDBMS HBase MongoDB Cassandra CouchDB Riak
51
ϦϨʔγϣφϧϞσϧΛఘΊΔ 52 • ςʔϒϧߏ => KVS (Mapߏ) • PkeyΧϥϜͷͻͱ͔ͭΒબͿͷ=> ඞਢͷͷ
• JOINΛͤ͞ͳ͍ • ͜ΕʹΑΓεέʔϧΞτܕͷࢄ͕Մೳʹ • εΩʔϚΛࣄલఆٛ͠ͳ͍
εΩʔϚ: σʔλϕʔεͷσʔλߏΛܾΊΔͷ • εΩʔϚΛࣄલʹఆٛ: ϦϨʔγϣφϧϞσϧʹԊ͍ͬͨํ • Pros: σʔλߏʹڧྗͳ੍Λ՝ͨ͢Ί࠷దԽ͍͢͠ˍΞϓϦ Λ։ൃ͍͢͠ •
Cons: ΞϓϦͷมߋίετ͕ߴ͍ˍ࠷ॳʹదʹઃܭ͠ͳ͍ͱ͔ͳ Γมߋʹऑ͍ • εΩʔϚΛࣄલʹܾΊΔඞཁ͕ͳ͍߹ • Pro: σʔλߏΛޙ͔ΒͰ͔ͳΓॊೈʹมߋͰ͖Δ • Con: ςετ͕ͳ͍ͱόά͕ग़͍͢ɺσʔλߏ͕ෳࡶͩͱ࠷ద Խ͠ʹ͍͘ 53
৽͍͠σʔλϞσϧ ΧϥϜࢦ • ΧϥϜΛ͍͘ΒͰ૿ ͢͜ͱ͕Ͱ͖Δ • Query LanguageΛ࡞Δ • ʮΧϥϜϑΝϛϦʔʯ
• HBase, Cassandra υΩϡϝϯτࢦ • ݸʑͷϨίʔυ͕ࣗ༝ͳ ܗࣜΛ࣋ͭ • MapReduceͰΫΤϦ • XML, JSON, etc … • CouchDB, MongoDB 54
͜͜·Ͱͷ·ͱΊ: ͱͯᐆດͳද2 CAॏࢹ APॏࢹ SQL RDBMS - ΧϥϜࢦ HBase Cassandra
υΩϡϝϯτࢦ MongoDB CouchDB (blob) Riak 55
͏ͻͱͭσʔλϞσϧ Graph • Semantic WebతͳσʔλߏΛѻ͏ͨΊͷDB • ;ͨͭͷํੑ • ϊʔυͱΤοδΛਂ͘୳ࡧ͍ͨ͠ •
ϊʔυͱΤοδ͕ଟ͗͢Δ 56
σʔλϕʔε͕ಈ͘ॲཧܥ • ωΠςΟϒ • ͍ɺϝϞϦཧɺGC͕ͳ͍ • JVM • ͍ɺϝϞϦཧ͠ͳ͍͍ͯ͘ɺGC͕ى͖Δ •
Erlang VM • ͍ͦͦ͜͜ɺϝϞϦཧ͠ͳ͍͍ͯ͘ɺGCͰࢭ ·Βͳ͍ 57
58
͍··Ͱઆ໌͖ͯͨ͠ͷͰ؆୯ RiakͲ͏͍ͯ͠Δ͔ εέʔϦϯά ϋογϡతϧʔςΟϯάͰGossipͳਫฏࢄ ߹ੑͷཧ Vector Clocks, CRDTͳͲRead࣌ʹղܾ 2.0ͰPaxosೖΔ
Մ༻ੑͷอূ Hinted HandoffΛͬͯৗʹॻ͖ࠐΈ͕Ͱ͖ΔΑ͏ ʹ͍ͯ͠Δ σʔλϞσϧ Blob + Document Based ΠϯσοΫεΛΕΔ MapReduce͕Ͱ͖Δ ॲཧܥ Erlang VM 59
࣮໘ͰͷRiakͷಛ • ʮதʹΞϥʔτͰى͜͞Εͳ͍ʯ͜ͱΛࢦͨ͠ • Erlang VMΛ༻ • GCʹΑΔఀࢭ͕࣌ؒͳ͍ • ແఀࢭͰͷύονద༻ɺղੳɺૢ࡞͕Մೳ
• ίϚϯυମܥɾϑΝΠϧߏɾσʔλߏΛͳΔ͘γϯϓϧʹઃ ܭ͠ӡ༻ෛ୲Λݮ • ҆ఆੑΛॏࢹͨ͠ઃܭ • ίϯύΫγϣϯɺ༧ଌՄೳੑ 60
݁ہɺͲ͏͍͏ͱ͖ʹͲΕΛ͑Α͍ͷ͔ʁ 61
࣮໘ߟྀͨ͠ બͷϙΠϯτ • JOINͳͲσʔλͷਖ਼نԽ͕ඞཁͳͱ͖: RDBMS • ΦϯϝϞϦͰ࠷৽ͷ࣌ܥྻσʔλΛݟ͍ͨͱ͖: MongoDB • ΧϥϜΛ͍͘ΒͰ૿͍ͨ͠ͱ͖
• SQL෩ͷΫΤϦΛ͍ͨ͠ͱ͖ or Մ༻ੑ: Cassandra • େྔσʔλʹޮతʹόονॲཧΛ͍ͨ͠ͱ͖: Hbase • σʔλΛͳ͘͞ͳ͍&μϯλΠϜΛͳ͍ͨ͘͠ͱ͖: Riak 62
·ͱΊ • σʔλϕʔεͷྺ࢙తʹNoSQL৽͘͠ͳ͍ • SQLͱACIDผͷͳ͠ɺNoSQLͱ͍͏ΑΓNoACID • εέʔϦϯάʢཧ۶ʣ͘͠ͳ͍ • ߹ੑཧ۶͔Β͍ͯͦͦ͠͠ •
Մ༻ੑͦΜͳʹ͘͠ͳ͍ • RiakՄ༻ੑͱεέʔϥϏϦςΟ͕ಘҙ 63
Questions? 64 ࢀߟจݙϦετ: https://gist.github.com/kuenishi/8296883#refs