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

Why Riak? Why SoftLayer?

Why Riak? Why SoftLayer?

Riakで何ができるのか?SoftLayer上で動かすと何がさらに嬉しいのか?という基本的な話から、Riakを構成する基本的な技術を解説します。

http://softlayer.connpass.com/event/6864/

E1923013dacab39eb231a2fffbf7b33c?s=128

UENISHI Kota

July 25, 2014
Tweet

Transcript

  1. Why Riak? Why SoftLayer? 2014/7/25 SoftLayerษڧձ #2 @kuenishi

  2. ࣗݾ঺հ •UENISHI Kota @ kuenishi •github, twitter, … •Erlangྺ5೥ɺ෼ࢄγεςϜྺ6೥ •࠷ۙ͸

    Riak CS ͷ։ൃ
  3. Riak is Կ •ʮNoSQLσʔλϕʔεʯ •ErlangͰॻ͔Ε͍ͯΔΒ͍͠ •…ͱ͍ΘΕ͍ͯΔ͕ৄ͍͠࿩͸ޙ΄Ͳ

  4. What?

  5. Yay!!

  6. 1೥Ҏ্લ͔Β ࢖͑ͯ·ͨ͠

  7. Why Riak?

  8. Riak࢖͍υίϩ •Մ༻ੑ͕େࣄͳ৔໘ •εέʔϧΞοϓɾμ΢ϯͳͲӡ༻ •ϑΣΠϧΦʔόʔ is େม •ωοτϫʔΫ͕੾ΕͨΒ •ϊʔυ௥Ճɾ࡟আͷίετ

  9. σʔλϕʔεͷ Մ༻ੑʹର͢ΔڴҖ •ϋʔυ΢ΣΞނোʢωοτϫʔΫ΋ʣ ʹΑΔϑΣΠϧΦʔόʔ •ΞοϓάϨʔυɺϝϯςφϯε •աෛՙ •όοΫΞοϓ

  10. ϑΣΠϧΦʔόʔ 1. ϚελʔͷނোΛݕग़ʢ>10s secondsʣ 2. εϨʔϒʹ੾Γସ͑ʢ> ??ʣ 3. ϚελʔΛम෮ (>hours)

    4. Ϛελʔʹ੾Γ໭͠ (> ??) ͏͠Ζ͕Shared DiskͩΖ͏͕ɺShared NothingͩΖ͏͕ɺ DBϓϩηεͷϑΟΤϧΦʔόʔத͸ΞΫηεͰ͖ͳ͍
  11. ωοτϫʔΫނো •ಛผͳ޻෉Λ͠ͳ͍ݶΓɺϚϧνϚελ ʢSplit Brainʣঢ়ଶʹͳͬͯσʔλ͕ͣΕ ͯ͠·͏→म෮ෆೳ •ӡ༻Λ޻෉ͯ͠ͲͪΒ͔ΛϚελʹͯ͠΋ɺ ϚελͰͳ͍ํͷωοτϫʔΫͰ͸ɺσʔ λϕʔε͕࢖͑ͳ͘ͳΔ ? ?

  12. ΞοϓάϨʔυ •σʔλϕʔεͷΞοϓάϨʔυ͸ϚΠφʔ όʔδϣϯͰ͋ͬͯ΋େม •Ͳ͜ΛͲ͏ࢭΊΔɺͲ͏ىಈ͢Δ 1.↑ 2.↑

  13. աෛՙ •جຊํ਑ɿ ෛՙΛԼ͛Δ BUSY!!!

  14. όοΫΞοϓ •ࢭΊΕΔͱ΋ͷָ͘͢͝ͳΜ͚ͩͲ… 1.→ 2.→

  15. With Riak:

  16. Quorum ϨϓϦέʔγϣϯ •NݸͷϊʔυʹσʔλΛෳ੡ •ॻࠐ࣌͸ W ݸͷAck͕͋Ε͹Α͍ •ʢ௨ৗɺN͸ح਺ʣ •ಡΈग़࣌͠͸ R ݸͷAck͕͋Ε͹Α͍

    • R + W > N ͱͳ͍ͬͯΕ͹Α͍ σϑΥϧτ: (R, W, N) = (2, 2, 3) ͻͱΓ͘Β͍յΕ͍ͯͯ΋WriteՄೳ
  17. Consistent Hashing • 160-bit Ωʔۭؒ • ۭؒΛ౳෼͢Δ • ύʔςΟγϣϯ͸ϊʔυ͕ ݸผ؅ཧ

    • ϨϓϦΧ͸NݸͷύʔςΟ γϣϯʹίϐʔ͞ΕΔ OPEF OPEF OPEF OPEF hash(“meetups/spamham”) N=3
  18. Ұ࣌ނোͷͱ͖ • Ϧϯά্ͷ࣍ͷύʔςΟγϣ ϯʹͱΓ͋͑ͣॻ͖ࠐΜͰ ίϐʔΛ3ͭ࡞͓ͬͯ͘ • ͋ͱͰ෮چͨ͠ͱ͖ʹίϐʔ Λฦ͢ OPEF OPEF

    OPEF OPEF hash(“meetups/spamham”) N=3
  19. ωοτϫʔΫނোͰ΋ •ωοτϫʔΫ෼அ͕ى͖͍ͯͯ΋ͱΓ͋͑ͣॻ͖ࠐΈΛڐ͢ Server2 Server1 Server3 PUT V=42 PUT V=0 Server4

    ෮چͨ͠Βॻ͖໭͢ ྆ํ͓࣋ͬͯ͘
  20. Write-write Conflict͕ ى͖ͨΒʁ •҉໧ʹ্ॻ͖ͯ͠͠·Θͳ͍ͨΊͷ࢓૊Έ͕͋Δ •ώϯτ: Siblings & Vector Clocks Server2

    Server1 Server3 PUT V=42 PUT V=0 V=?
  21. ιϑτ΢ΣΞͷ ΞοϓάϨʔυ •ྡಉ࢜ͷόʔδϣϯͰͷແఀࢭɾϩʔ ϦϯάΞοϓάϨʔυͷಈ࡞อূ 1.3.2 1.3.2 1.3.2 1.3.2 1.3.2 1.3.2

    1.3.2 1.4.10 1.4.10 1.4.10 1.4.10 1.4.10 1.4.10 1.4.10
  22. ϋʔυ΢ΣΞͷ ΞοϓάϨʔυ •ͲͪΒ΋ແఀࢭͰͰ͖Δ •௕ظతʹੑೳΛ্͍͛ͨͱ͖ •ϊʔυަ׵ͰεέʔϧΞοϓ •Ϧιʔεͷར༻ޮ཰͕Α͍ •୹ظతʹੑೳΛ্͍͛ͨͱ͖ •ϊʔυ௥ՃͰεέʔϧΞ΢τ •͙͢ʹ௥Ճͯ͠ΦϯϥΠϯʹͳΕΔ աෛՙʹͳΓͦ͏ͳ

    λΠϛϯάͰ…
  23. Ϋϥελؒ ϨϓϦέʔγϣϯ

  24. Ϋϥελؒ ϨϓϦέʔγϣϯ

  25. Ϋϥελؒ ϨϓϦέʔγϣϯ

  26. Ϋϥελؒ ϨϓϦέʔγϣϯ

  27. Why Cloud?

  28. Մ༻ੑɺӡ༻ੑ •σʔλϕʔεͳͲͷϛυ ϧ΢ΣΞ͕͍͘Β༏Εͯ ͍ͯ΋ҙຯ͕ͳ͍ •ϋʔυ΢ΣΞ΍ωοτϫʔ Ϋ͕ਖ਼͘͠ઃܭɾӡ༻͞ Ε͍ͯͳ͚Ε͹αʔϏε Λӡ༻Ͱ͖ͳ͍ ݐ෺ɾిݯɾۭௐ ωοτϫʔΫ

    αʔόʔHW ϛυϧ΢ΣΞ αʔϏε
  29. ͔ͩΒΫϥ΢υ

  30. Why SoftLayer?

  31. ϕΞϝλϧαʔόʔ why?

  32. Ծ૝ԽͷΦʔόʔϔουʁ

  33. one of ෼ࢄγεςϜͰେࣄͳ͜ͱ is ނোͷ୯Ґ

  34. ނোͷ୯Ґ •1ͭͷσΟεΫ •1ͭͷNIC •1ͭͷαʔόʔ •1ͭͷεΠον Ծ૝Խͯ͠ɺͻͱͭͷ Ϛγϯ্ʹෳ਺ͷϊʔ υ͕ೖ͍ͬͯΔͱɺͻ ͱͭͷϚγϯނো͕ଟ ॏނোʹݟ͑ͯ͠·͏

  35. ނোͷ୯Ґ ϕΞϝλϧαʔόʔ Ծ૝Խ͞ΕͨϚγϯ OS Riak OS Riak OS Riak OS

    Riak OS Riak OS Riak OS Riak OS Riak
  36. ଞʹ΋ •1୆ͷϚγϯͷϦιʔεΛ઎༗Ͱ͖Δ •σΟεΫυϥΠϒͷѻ͍͕೉͍͠ •ڞ༗σΟεΫΛ੾Γग़ͯ͠Ϛ΢ϯτͯ͠࢖͏ ελΠϧ •EphemeralσΟεΫ •RawσόΠε΋෼ࢄετϨʔδʹͯ͠͠·͏ •Sheepdogతͳ΋ͷͬͯλΠϔϯ

  37. ࣮ࡍɺੑೳ΋ҧ͏ Bare Metal Virtual “Riak Performance Analysis: Bare Metal vs

    Virtual” July 16, 2013 http://blog.softlayer.com/2013/riak-performance-analysis-bare-metal-v-virtual
  38. ͔͠΋SoftLayerͳΒ… •Webϒϥ΢βͰRiakΛҰൃσϓϩΠͰ ͖ͯ͠·͏ •DCؒϨϓϦέʔγϣϯͷઃఆʢ͜Ε͕ ׂͱ೉͍͠ʣ΋͠ͳ͍͍ͯ͘ •ΤϯλʔϓϥΠζ൛ɺBasho͔ΒϥΠη ϯεΛങ͏ඞཁ͢Βͳ͍

  39. ·ͱΊ •αʔϏεͷՄ༻ੑɺӡ༻ੑ͸ϑϧελοΫͰߟ͑ Δ΂͖ •Riak͸෼ࢄγεςϜͷ೉͍͠໰୊Λղ͍ͯ͘ΕΔ •DC~NW~OSͷ೉͍͠໰୊͸SoftLayerͰ •RiakͷΫϥελؒϨϓϦέʔγϣϯͰσʔληϯ λʔΛލ͝͏

  40. Questions? @BashoJapan riak-users-jp@lists.basho.com http://basho.co.jp/riak http://github.com/basho/riak