Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Talk on Database (ja)

Talk on Database (ja)

筑波大学の2013年度の情報システム特別講義Dのスライド

E1923013dacab39eb231a2fffbf7b33c?s=128

UENISHI Kota

January 31, 2014
Tweet

Transcript

  1. σʔλϕʔεͷ͸ͳ͠ Basho Japan KK Kota UENISHI 2014/1/31

  2. ͲͪΒ༷Ͱ͔͢ʁ •  @kuenishi •  NTTݚڀॴ ˠ Basho •  Erlang/OTPΛॻ͍ͯ࢓ࣄΛ͍ͯ͠·͢ • 

    ෼ࢄσʔλϕʔεɾ෼ࢄγεςϜͷ঎༻։ൃྺ 6೥ •  ϛυϧ΢ΣΞతͳ΋ͷ͕ൺֱతಘҙͰ͢
  3. •  Riakͱ͍͏OSSͷ෼ࢄσʔλϕʔε Λ࡞ͬͯച͍ͬͯ·͢ •  Riak CSͱ͍͏OSSͷΫϥ΢υετ ϨʔδΛ࡞ͬͯଧ͍ͬͯ·͢ •  ʮ෼ࢄਥʯΧϯϑΝϨϯεRicon.io • 

    Basho.com 3
  4. ͖͔͚ͬ 4 தུ ʮ಺༰ͱͯ͠͸riakͱ ɹNoSQLΛؚΊͯ ɹ௖͚ͨΒʯ

  5. ࠓ೔͓΅͑ͯ΋Β͏͜ͱ •  NoSQL͸όζϫʔυͰ͋Γɺఆٛ͸ͳ͍ •  ͍Ζ͍ΖͳσʔλετΞͱͦͷ෼ྨɺ࢖͍෼͚ͷίπ •  ෼ࢄγεςϜ΍σʔλϕʔεपลͷ໰୊ɺ၆ᛌਤ •  Riak͸ૉ੖Β͍͠σʔλϕʔεͰ͋Δ

  6. ͦ΋ͦ΋ σʔλϕʔεͱ͸Կʁ •  ΞϓϦέʔγϣϯͷσʔλΛίϯϐϡʔλʹอଘ͢Δ ͨΊͷιϑτ΢ΣΞʢϥΠϒϥϦ or αʔόʔʣ 6 01010110100001001011 11001010101010100101

    01001010101001010100 10101010010111111110 00000101111100101010 00000010010101001001 01001010010010100
  7. อଘ͢Δͱ͖ͷཁٻ •  σʔλΛਖ਼͘͠ॻ͖ࠐΉ͜ͱɺσʔλͷߋ৽͕த్൒ ୺ͳঢ়ଶͰࣦഊ͠ͳ͍͜ͱ •  ॻ͖ࠐΜͩσʔλΛਖ਼͘͠ಡΈग़͢͜ͱ •  ॻ͖ࠐΜͩσʔλΛผܗࣜʹม׵ͯ͠ಡΈͩ͢͜ͱ •  ϋʔυ΢ΣΞੑೳͷݶք·Ͱߴ଎ʹอଘ͢Δ͜ͱ

    •  ϋʔυ΢ΣΞੑೳͷݶք·Ͱߴ଎ʹಡΈग़͢͜ͱ •  σʔλ͕ফ͑Δ৚͕݅ਖ਼֬ʹ൑໌͍ͯ͠Δ͜ͱ 7
  8. ྺ্࢙ͷσʔλϕʔε •  IDS (GE, 1963) •  ֊૚ܕDB •  IMS (IBM,

    1966 -), •  ωοτϫʔΫܕDB •  CODASYL (1969, COBOL), •  ࠓ΋ಈ͍͍ͯΔ੡඼΋͋Δ 8
  9. 1977೥ System R (IBM) •  ؔ܎୅਺ͷཧ࿦ʹج͍ͮͨσʔλૢ࡞ݴޠ SQLΛ࣮૷ͨ͠ੈքॳͷσʔλϕʔε •  Ұ؏ͨ͠σʔλʹର͢Δෳ਺ͷૢ࡞Λશͯ ੒ޭɾશࣦͯഊʹ·ͱΊɺෳ਺ͷߋ৽ཁٻ

    Λฒߦ੍ޚ͠ɺσʔλΛӬଓԽ͢Δτϥϯ βΫγϣϯॲཧΛ࣮૷ͨ͠ੈքॳͷσʔλ ϕʔε •  ۀ຿ॲཧͷϞσϧʹඇৗʹΑ͘Ϛονͨ͠ ͨΊɺരൃతʹීٴɹˠISOͰඪ४Խ •  1983೥ Oracle v3 •  1987೥ Sybase SQL Server (ݱMicrosoft SQL Server) 9
  10. ͸͡Ί͔ΒSQLͩͬͨΘ͚Ͱ΋ϦϨʔγϣφϧ ͩͬͨΘ͚Ͱ΋ͳ͍ ͭ·Γ… 10

  11. RDBMSͷ࣌୅ •  ACIDಛੑʹج͍ͮͨτϥϯβΫγϣϯ؅ཧ •  SQLͱ͍͏౷Ұ͞ΕͨΠϯλʔϑΣʔε •  ੈքதͷΤϯλʔϓϥΠζͷσʔλ؅ཧ͸ΦϑΟεͷOA ԽɾγεςϜͷΦʔϓϯԽʹ൐͍RDBMS͕ओྲྀʹ •  εέʔϧΞοϓͷ࣌୅Ͱ΋͋Δ

    •  1995೥ͷHDDͷGB୯Ձ: ~7.5ສԁ/ GB 11
  12. •  2003೥ʙɹITόϒϧ่յޙ •  Ոఉ༻ίϯϐϡʔλɺϒϩʔυόϯυͷීٴ •  Web 2.0ɺϒϩάɺWikipediaɺEϝʔϧɺWebݕࡧɺEC •  1998೥ Google૑ۀ

    •  1995೥ Amazon૑ۀ •  “Web Scale” ͷσʔλྔ 12 Webͷ࣌୅
  13. •  ٻΊΒΕΔ͜ͱ͕มԽ: ߏ଄͸؆୯Ͱ΋ɺྔ΍τϥ ϑΟοΫɺϨεϙϯεɺՄ༻ੑͳͲͷཁٻ͕ଟ༷ Խɾߴ౓Խ •  σʔλͷ୯Ձ͕͍҆etc •  RDBMSͰ͸ղܾͰ͖ͳ͍Φʔμʔ·Ͱσʔλྔ͕ ૿Ճ͢ΔʹैͬͯɺͦΕΛղܾ͢Δٕज़͕ొ৔

    •  ؔ܎ϞσϧɺSQLͰ͸ѻ͍ʹ͍͘σʔλϞσϧʢ୯ ७͕ͩΑ͘มԽ͢Δσʔλߏ଄ʣ •  2003೥ͷHDDͷGB୯Ձ: 100ԁ / GBɹ(120GB) 13 “Web Scale”
  14. 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. ຊ౰ʹղ͖͍ͨ໰୊ 15

  16. εέʔϦϯάͷ໰୊ 16

  17. εέʔϦϯάͷํ๏ •  ෳ਺୆ͷϊʔυʹσʔλΛ෼ࢄอ࣋ͯ͠ྔΛՔ͙ •  ʮͲͷσʔλ͕Ͳͷαʔόʔʹೖ͍ͬͯΔ͔ʁʯ 17

  18. 18

  19. ϋογϡతϧʔςΟϯά •  Riak, Cassie, DynamoͳͲ •  Կ͕Ͳ͜ʹ͋Δ͔ Θ͔Γʹ͍͘ •  εέʔϧΞ΢τɺ

    ෛՙ෼ࢄ͕؆୯ 19 node1 node2 node3 node4
  20. “ϋογϡత” •  ΩʔͱϊʔυIDΛϋογϡԽͯ͠ಉ໊͡લۭؒʹஔ͘ •  ϋογϡͷ୯ҐͰσʔλΛ෼ׂͯ͠഑ஔ •  ϊʔυ௥Ճɾ࡟আͷͱ͖ͷσʔλ࠶഑ஔΛ࠷খݶʹͰ ͖Δ 20 {foo,

    SomeData}! Hash(foo)%N! Hash(node1)%N!
  21. 21 Locality vs Load Balancing - Use Cases • ઌಡΈΛޮ͔ͤͯόϧΫͰγʔέϯγϟϧΞ

    Ϋηε • - HBase, BigTable, etc • ϋογϡͰ෼ࢄͤͯ͞ෛՙ෼ࢄͯ͠ϥϯμϜ ΞΫηε • - Riak, Cassie, etc
  22. ੔߹ੑͷ໰୊ 22

  23. Q. ੔߹ੑͬͯͳΜͩͱ ͓΋͍·͔͢ʁ 23

  24. ੔߹ੑʹ͸2ͭͷจ຺͕͋Δ •  ڞ௨͢Δͷ͸ʮ୭͕ݟͯ΋ಉ͡Α͏ʹݟ͑Δ͜ͱʯ •  ෳ਺छྨͷσʔλؒͷInvariant͕कΒΕ͍ͯΔ͜ͱ •  “ACID” తͳAnomaly͕ൃੜ͠ͳ͍͜ͱ •  Phantom

    Read, Write Skew, etc etc… •  ෳ਺ͷσʔλͷίϐʔ͕ಉ͡Ͱ͋Δ͜ͱ •  ෳ਺ͷίϐʔΛ҆શʹߋ৽Ͱ͖Δ͜ͱ •  ผʑͷਓͰ΋ಉ͡σʔλΛݟΕ͍ͯΔ͜ͱ
  25. 25 Consistent Replication is Difficult • ϨϓϦέʔγϣϯ͸ॱ൪͕ೖΕସΘΔ • CPUͷΞ΢τΦϒΦʔμʔ࣮ߦͱಉ͡ w1

    w1 w1 w2 w2 w2 Actor 0 Actor 1 Actor 2 w2 w2 w1
  26. ෼ࢄ߹ҙ໰୊ •  ʮෳ੡͕͢΂ͯಉ͡Ͱ͋Δʯ •  ʹʮશһ͕ͻͱͭͷ஋ʹ߹ҙͰ͖͍ͯΔঢ়ଶʯ •  ΞϠγ͍ಈ࡞Λ͢ΔՄೳੑ͕͋Δ΋ͷ •  ωοτϫʔΫ • 

    ߹ҙ͢Δ૬ख •  ੍ݶ࣌ؒɿແݶ 26
  27. ·͡Ίʹॻ͘ͱ… •  ͍ͭͰ΋յΕΔՄೳੑͷ͋Δෳ਺ͷϊʔυ͕ɺ •  յΕͯ·ͨ෮ؼ͢ΔՄೳੑ΋͋Δ •  ฦࣄ͕஗͍͚ͩͷ৔߹΋ •  ৴པੑͷ௿͍ϊʔυؒ௨৴Λ࢖ͬͯ • 

    ΋ͷ͘͢͝஗Ԇ͍ͯ͠Δ͚Ͳ࣮͸ಧ͘ •  ͻͱͭͷ஋Λ߹ҙ͢ΔʢͷʹͲͷΑ͏ͳ৚݅ͱϓϩτ ίϧ͕͋Ε͹Α͍͔ʁʣ 27
  28. ͳͥ೉͍͠ͷ͔ •  ࢮ׆؂ࢹ͕೉͍͠ •  ϦʔμʔΛఘΊΔɺϚελʔΛఘΊΔɺetc •  ࢳి࿩Ͱࢮ׆؂ࢹ͢Δ࿅श •  ނোϞσϧͷ͸ͳ͕͍͠Ζ͍Ζ͋Δ 28

  29. ࢮ׆؂ࢹ͸೉͍͠ •  ʮࢮΜͩ͜ͱʯΛਖ਼͘͠ݟ͚ͭΔͷ͸೉͍͠ •  ࣮ݧʢ͕࣌ؒ͋Ε͹ʣ 29

  30. ʮࢮΜͰ͍Δʯ is Կ 30 © ʮ๺ేͷݓʯݪ఩෉ɺ෢࿦ଚ

  31. ނোతࠔΔ͜ͱͷ෼ྨ Crash Failure ɹ (fail-stop, fail-safe) ނোͨ͠Βࢭ·Δɺࢭ·ͬͨ͜ͱ͕͢ ͙ʹ෼͔Δ Crash Failure

    (fail-silent) ໧ͬͯࢮ͵ Crash Recovery ނোͨ͠ϑϦͯ͠஌ΒΜ΀Γͯ͠ؼͬͯ ͘Δ Omission Failure (receive / send) ϝοηʔδܽམ Timing Failure ·ͱ΋ͳ଎౓Ͱಈ͔ͳ͘ͳΔ Response Failure Ϩεϙϯε͕͓͔͍͠ʢσʔλ͕յΕͯ ͍Δetcʣ Arbitrary Failure Ϗβϯνϯނোɺѱҙͷ͋ΔϠπ͕͍Δ 31
  32. ෼ࢄ߹ҙͷछྨ •  ʮΞτϛοΫϒϩʔυΩϟετϓϩτίϧʯ •  ͓͓·͔ʹ͍ͬͯ෼ࢄ߹ҙ͢ΔͨΊͷϓϩτίϧΛ ૯শͯ͠ •  ΞτϛοΫ͡Όͳ͍ϒϩʔυΩϟετ΋୔ࢁ͋ͬͯͦ ΕͳΓʹಈ͍͍ͯΔ • 

    ୅දతͳ΋ͷPaxos, Rafter, ZAB 32
  33. 33 Consensus Based Replication • ϨϓϦέʔγϣϯͷϦʔμʔΛଟ਺ܾͰબग़ • or ϨϓϦέʔγϣϯຖʹଟ਺ܾ w1

    w1 w1 w2 w2 w2 Actor 0 Actor 1 Actor 2 w2 w2 w1
  34. 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. 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. Մ༻ੑͷ໰୊ •  σʔλΛ͍͟ॻ͖ࠐ΋͏ͱࢥͬͨॠؒʹσʔλ͕σʔλϕʔε ͕མ͍ͪͯͨΓݻ·͍ͬͯͯ͸ϏδωενϟϯεΛಀ͢ 36

  37. CAPఆཧ ͲΜͳނোʹରͯ͠΋ QBSUJUJPOUPMFSBODF  σʔλ͸ৗʹ੔߹͓ͯ͠Γ DPOTJTUFODZ  γεςϜ͕ࢭ·Δ͜ͱ͸ͳ͍ BWBJMBCJMJUZ 

    • ͜ͷ3ͭΛಉ࣌ʹຬͨ͢γεςϜ͸ଘࡏ͠ͳ͍ • ͜Ε·ͰͷRDBMS͸CAॏࢹ 37
  38. CAPఆཧʢCॏࢹͷ৔߹ʣ •  n1ͱn2ͷϨϓϦΧΛৗʹ੔߹͓ͤͯ͘͞ •  ωοτϫʔΫ͕੾ΕͨΓނোͨ͠ΒࢭΊΔˠՄ༻ੑˣ 38 w1 w2 n1 n2

  39. CAPఆཧʢAॏࢹͷ৔߹ʣ •  n1ͱn2ͷϨϓϦΧΛৗʹ࢖͑ΔΑ͏ʹ͢Δ •  ωοτϫʔΫ͕੾ΕͨΓނোͯ͠΋ॻ͚Δˠ੔߹ੑˣ 39 w1 w2 n1 n2

  40. CAPఆཧʢPॏࢹͷ৔߹ʣ •  n1ͱn2ͷϨϓϦΧΛΤεύʔʹ͢Δ •  ωοτϫʔΫ͕੾ΕͨΒਖ਼͍͠ํ͕Θ͔ΔˠՄ༻ੑͪ ΐͬͱˣ 40 w1 w2 n1

    n2
  41. Amazon’s Dynamo •  ʮσʔλϕʔε͸ϦϨʔγϣφϧ͚ͩ͡Όͳ͍ɺ੔߹ ੑ͚ͩ͡Όͳ͍ɺՄ༻ੑ͕େࣄͳ৔߹΋͋ΔΜͩʯ •  ΞϚκϯͷγϣοϐϯάΧʔτʹ࢖ΘΕ͍ͯͨ •  Vector Clocks

    •  Handoff •  (CRDT in Riak) 41
  42. ʮͱΓ͋͑ͣॻ͘ʯͱ͍͏ߟ͑ •  “Hinted Handoff” Ϧϯάͷ࣍ͷਓ ʹͱΓ͋͑ͣ౉͓ͯ͘͠ •  ނো͔Β໭͖ͬͯͨΒฦ͢ •  ॻ͖ࠐΈ͕ॏෳͨ͠Βʁ

    42 w1
  43. ͱΓ͋͑ͣॻ͍͓͍ͯͯ ॻ͖ࠐΈ͕িಥͨ͠Βʁ •  ྆ํ͓͍࣋ͬͯͯɺিಥͨ͠σʔ λͷʮҼՌؔ܎ʯΛ໌Β͔ʹ͢Δ •  “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. 44 CRDT • CRDT (Conflict-Free Replicated Data Types • “AP”

    Λαϙʔτ • Counter, Register, Sets, Maps • →ผεϥΠυʁ
  45. 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
  46. ACID vs BASE ACID BASE ੔߹͍ͯ͠ͳͯ͘΋ ৗʹσʔλʹΞΫη εͰ͖Δ Basically Avaiable

    Atomicity ෳ਺ͷૢ࡞ͷ੒ޭɾ ࣦഊΛ·ͱΊΔ Consistency ৑௕Խ͞Εͨσʔλ ΍ෳ਺ͷϦϨʔγϣ ϯ͕ৗʹ੔߹͍ͯ͠ Δ ࠷ऴతʹ੔߹ͨ͠ঢ় ଶʹͳΔ͜ͱ͕อূ ͞Ε͍ͯΕ͹Α͍ Eventually Consistent Isolation ฒߦ؅ཧͯ͠ߋ৽్ தͷঢ়ଶΛݟͤͳ͍ Durability σʔλΛӬଓԽͯ͠ ࣦΘͳ͍ ϨϓϦΧ͸ܾఆ࿦త Ͱ͸ͳ͘ɺ֬཰తͰ ͋ͬͨΓɺάϩʔό ϧʹҰ؏͍ͯ͠ͳ͘ ͯ΋Α͍ Soft-state 46
  47. σʔλετΞͷ෼ྨ࣠ 47

  48. ΫΠζɿͲ͜·Ͱ͕DB? Ͳ͔͜Β͕NoSQL? ACIDͳτϥϯβΫγϣϯ τϥϯβΫγϣϯͳ͠ SQLΠϯλʔϑ Σʔε Oracle MySQL PostgreSQL SQL

    Server, DB2 Cassandra (CQL) Hive, Presto Impala ಠࣗAPI InnoDB BerkeleyDB FoundationDB Riak MongoDB Redis 48
  49. ςετʹग़ͳ͍ຊ౰ͷ͜ͱ 49

  50. CAPఆཧ͔ΒΈͨ੡඼ͷ෼ྨ •  CAॏࢹ •  RDBMS, MongoDB, HBase, etc… •  ੔߹ੑҡ࣋ͷͨΊͷ෼ࢄ߹ҙʢਖ਼͘͠ϑΣΠϧΦʔ

    όʔ͢ΔͨΊʣͷ࢓૊Έ͕ඞཁ •  APॏࢹ •  Cassandra, Riak, CouchDB •  ෼ࢄ߹ҙͷ࢓૊Έ͕ෆཁʹ࣮૷΋ӡ༻΋؆୯ 50
  51. ͜͜·Ͱͷ·ͱΊ: ͱͯ΋ᐆດͳද CAॏࢹ APॏࢹ RDBMS HBase MongoDB Cassandra CouchDB Riak

    51
  52. ϦϨʔγϣφϧϞσϧΛఘΊΔ 52 •  ςʔϒϧߏ଄ => KVS (Mapߏ଄) •  Pkey͸ΧϥϜͷͻͱ͔ͭΒબͿ΋ͷ=> ඞਢͷ΋ͷ

    •  JOINΛͤ͞ͳ͍ •  ͜ΕʹΑΓεέʔϧΞ΢τܕͷ෼ࢄ͕Մೳʹ •  εΩʔϚΛࣄલఆٛ͠ͳ͍
  53. εΩʔϚ: σʔλϕʔεͷσʔλߏ଄ΛܾΊΔ΋ͷ •  εΩʔϚΛࣄલʹఆٛ: ϦϨʔγϣφϧϞσϧʹԊͬͨ࢖͍ํ •  Pros: σʔλߏ଄ʹڧྗͳ੍໿Λ՝ͨ͢Ί࠷దԽ͠΍͍͢ˍΞϓϦ Λ։ൃ͠΍͍͢ • 

    Cons: ΞϓϦͷมߋίετ͕ߴ͍ˍ࠷ॳʹద੾ʹઃܭ͠ͳ͍ͱ͔ͳ Γมߋʹऑ͍ •  εΩʔϚΛࣄલʹܾΊΔඞཁ͕ͳ͍৔߹ •  Pro: σʔλߏ଄Λޙ͔ΒͰ΋͔ͳΓॊೈʹมߋͰ͖Δ •  Con: ςετ͕ͳ͍ͱόά͕ग़΍͍͢ɺσʔλߏ଄͕ෳࡶͩͱ࠷ద Խ͠ʹ͍͘ 53
  54. ৽͍͠σʔλϞσϧ ΧϥϜࢦ޲ •  ΧϥϜΛ͍͘ΒͰ΋૿΍ ͢͜ͱ͕Ͱ͖Δ •  Query LanguageΛ࡞Δ •  ʮΧϥϜϑΝϛϦʔʯ

    •  HBase, Cassandra υΩϡϝϯτࢦ޲ •  ݸʑͷϨίʔυ͕ࣗ༝ͳ ܗࣜΛ࣋ͭ •  MapReduceͰΫΤϦ •  XML, JSON, etc … •  CouchDB, MongoDB 54
  55. ͜͜·Ͱͷ·ͱΊ: ͱͯ΋ᐆດͳද2 CAॏࢹ APॏࢹ SQL RDBMS - ΧϥϜࢦ޲ HBase Cassandra

    υΩϡϝϯτࢦ޲ MongoDB CouchDB (blob) Riak 55
  56. ΋͏ͻͱͭσʔλϞσϧ Graph •  Semantic Webతͳσʔλߏ଄Λѻ͏ͨΊͷDB •  ;ͨͭͷํ޲ੑ •  ϊʔυͱΤοδΛਂ͘୳ࡧ͍ͨ͠ • 

    ϊʔυͱΤοδ͕ଟ͗͢Δ 56
  57. σʔλϕʔε͕ಈ͘ॲཧܥ •  ωΠςΟϒ •  ଎͍ɺϝϞϦ؅ཧɺGC͕ͳ͍ •  JVM •  ଎͍ɺϝϞϦ؅ཧ͠ͳ͍͍ͯ͘ɺGC͕ى͖Δ • 

    Erlang VM •  ͦͦ͜͜଎͍ɺϝϞϦ؅ཧ͠ͳ͍͍ͯ͘ɺGCͰࢭ ·Βͳ͍ 57
  58. 58

  59. ͍··Ͱઆ໌͖ͯͨ͠ͷͰ؆୯ ໰୊ Riak͸Ͳ͏͍ͯ͠Δ͔ εέʔϦϯά ϋογϡతϧʔςΟϯάͰGossipͳਫฏ෼ࢄ ੔߹ੑͷ؅ཧ Vector Clocks, CRDTͳͲRead࣌ʹղܾ 2.0Ͱ͸Paxos΋ೖΔ

    Մ༻ੑͷอূ Hinted HandoffΛ࢖ͬͯৗʹॻ͖ࠐΈ͕Ͱ͖ΔΑ͏ ʹ͍ͯ͠Δ σʔλϞσϧ Blob + Document Based ΠϯσοΫεΛ͸ΕΔ MapReduce͕Ͱ͖Δ ॲཧܥ Erlang VM 59
  60. ࣮૷໘ͰͷRiakͷಛ௃ •  ʮ໷தʹΞϥʔτͰى͜͞Εͳ͍ʯ͜ͱΛ໨ࢦͨ͠ •  Erlang VMΛ࢖༻ •  GCʹΑΔఀࢭ͕࣌ؒͳ͍ •  ແఀࢭͰͷύονద༻ɺղੳɺૢ࡞͕Մೳ

    •  ίϚϯυମܥɾϑΝΠϧߏ଄ɾσʔλߏ଄ΛͳΔ΂͘γϯϓϧʹઃ ܭ͠ӡ༻ෛ୲Λ௿ݮ •  ҆ఆੑΛॏࢹͨ͠ઃܭ •  ίϯύΫγϣϯɺ༧ଌՄೳੑ 60
  61. ݁ہɺͲ͏͍͏ͱ͖ʹͲΕΛ࢖͑͹Α͍ͷ͔ʁ 61

  62. ࣮૷໘΋ߟྀͨ͠ ੡඼બ୒ͷϙΠϯτ •  JOINͳͲσʔλͷਖ਼نԽ͕ඞཁͳͱ͖: RDBMS •  ΦϯϝϞϦͰ࠷৽ͷ࣌ܥྻσʔλΛݟ͍ͨͱ͖: MongoDB •  ΧϥϜΛ͍͘ΒͰ΋૿΍͍ͨ͠ͱ͖

    •  SQL෩ͷΫΤϦΛ͍ͨ͠ͱ͖ or Մ༻ੑ: Cassandra •  େྔσʔλʹޮ཰తʹόονॲཧΛ͍ͨ͠ͱ͖: Hbase •  σʔλΛͳ͘͞ͳ͍&μ΢ϯλΠϜΛͳ͍ͨ͘͠ͱ͖: Riak 62
  63. ·ͱΊ •  σʔλϕʔεͷྺ࢙తʹNoSQL͸৽͘͠͸ͳ͍ •  SQLͱACID͸ผͷ͸ͳ͠ɺNoSQLͱ͍͏ΑΓNoACID •  εέʔϦϯά͸ʢཧ۶͸ʣ೉͘͠ͳ͍ •  ੔߹ੑ͸ཧ۶͔Βͯͦ͠΋ͦ΋೉͍͠ • 

    Մ༻ੑ͸ͦΜͳʹ೉͘͠ͳ͍ •  Riak͸Մ༻ੑͱεέʔϥϏϦςΟ͕ಘҙ 63
  64. Questions? 64 ࢀߟจݙϦετ: https://gist.github.com/kuenishi/8296883#refs