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

OSC 大阪 2013.cloud

OSC 大阪 2013.cloud

UENISHI Kota

May 25, 2013
Tweet

More Decks by UENISHI Kota

Other Decks in Technology

Transcript

  1. ෼ࢄKVSͱ Ϋϥ΢υετϨʔδ Riak & Riak CS Bashoδϟύϯגࣜձࣾ Senior Software Engineer

    ্੢߁ଠ 2013/5/25 ΦʔϓϯιʔεΧϯϑΝϨϯε 2013.Cloud @େࡕ
  2. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. Φʔϓϯιʔε൛ ঎༻൛ Ϛϧνσʔληϯλʔؒ

    ϨϓϦέʔγϣϯͳͲ   Riakͱ͍͏໊લ͕͍͍ͭͯΔ΋ͷ Enterprise ෼ࢄܕΫϥ΢υετϨʔδ ෼ࢄσʔλϕʔε
  3. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. •  ߴՄ༻ੑ  

    •  ௿ϨΠςϯγʔ   •  ਫฏ֦ுੑ   •  ଱ো֐ੑ   •  ӡ༻ͷ༰қ͞   •  ༧ଌՄೳੑ   Riakͷ໨ࢦ͢ͱ͜Ζ •  Մ༻ੑΛ࠷༏ઌ •  σʔλҰ؏ੑͷ Ϩϕϧ͸νϡʔ χϯάՄೳ CAPఆཧ  
  4. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. Ωʔίϯηϓτ ϚελʔϨε • 

    ϚϧνϊʔυͷϚελʔϨεΫϥελ   KEY VALUE KEY VALUE KEY VALUE bucket   •  Key/valueͷϖΞΛbucketsʹอଘ   •  ͲͷΑ͏ͳσʔλλΠϓɺΦϒδΣΫτ ΋όΠφϦͱͯ͠อଘ   Object/keyΦϖϨʔγϣϯ   node   node   node   node   node  
  5. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. ίϯγεςϯτϋογϡ  • 

    160-­‐bit੔਺ΩʔྖҬ   •  RingΛ౳ִؒͰύʔςγϣϯʹ෼ׂ   •  ύʔςγϣϯΛΫϥελͷ֤ϊʔυ ʹׂΓ౰ͯΔ   •  σʔλͷbucket/Keyͷhash஋ʹΑΓ อଘ͢ΔύʔςγϣϯͷҐஔΛܾఆ ͠ɺ࿈ଓ͢ΔύʔςγϣϯʹϨϓϦ έʔγϣϯσʔλΛอଘ   node  0   node  1   node  2   node  3   hash(“bucket/key”)  
  6. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. Ұ࣌ো֐ൃੜ࣌  • 

    Ұ࣌తͳϊʔυো֐ʢnode  2ʣ͕ൃੜ   •  PUT,  GET,  DELETEͷϦΫΤετ͸ɺϑΥʔ ϧόοΫϊʔυʢnode  0ʣ΁   node  0   node  1   node  2   node  3   hash(“bucket/key”)  
  7. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. Ұ࣌ো֐͔Βͷ෮چ࣌  • 

    Ұ࣌తͳϊʔυো֐ʢnode  2ʣ͕ൃੜ   •  PUT,  GET,  DELETEϦΫΤετ͸ɺϑΥʔϧ όοΫϊʔυʢnode  0ʣ΁   •  ো֐ϊʔυͷ෮چʢnode  2ʣ   •  “Handoff”ʹΑΓɺσʔλΛϑΥʔϧόο Ϋϊʔυʢnode  0ʣ͔Β෮چϊʔυ ʢnode  2ʣ΁Ҡߦ   •  ௨ৗӡ༻Λ࠶։   node  0   node  1   node  2   node  3   hash(“bucket/key”)  
  8. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. •  ಛఆͷbucket  /

     keyΛࢦఆ͠ɺඥ͍ͮͨΦϒδΣΫτΛऔಘ   •  ಛఆͷbucketsʹඥ͍͍ͮͯΔશͯͷkeyΛऔಘ   Object/KeyΛࢦఆͯ͠   ɹɹΦϒδΣΫτΛऔಘ   •  ؆୯ͳΫΤϦݴޠʢHTTPʣΛαϙʔτͨ͠શจݕࡧ   •  JSON,  plain  text,  XML  and  ErlangͳͲͷmime-­‐typeΛαϙʔτ •  ·ͩβ   yokozuna •  ΫΤϦʔʹ࢖༻Ͱ͖ΔλάɺΛΦϒδΣΫτอଘ࣌ʹઃఆ   •  ΦϒδΣΫτͷλά໊͓Αͼ஋Λࢦఆͯ͠ΦϒδΣΫτΛ औಘ   Secondary Index (2i) •  σʔλͷ໰͍߹ΘͤɺϑΟϧλϦϯάͷ෼ࢄɺղੳͱूܭ   •  Javascript  ͱErlang   MapReduce Riak಺ͷσʔλ΁ͷΞΫηε  
  9. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. ϚϧνσʔληϯλʔϨϓϦέʔγϣϯ ʢMDCϨϓϦέʔγϣϯʣ 

     •  ෳ਺αΠτؒͷσʔλϨϓϦέʔγϣϯ   •  σʔλϩʔΧϦςΟ     •  ॏେࡂ֐ԼͰ΋αʔϏεΛܧଓ   •  ΞΫςΟϒόοΫΞοϓ   •  ยํ޲·ͨ͸྆ํ޲ͷಉظ   •  ProducUonΫϥελʔͱStage༻Ϋϥελʔ ʹΑΓݕূ؀ڥΛߏங   Primary   Cluster  (DC#1)   Secondary   Cluster  (DC#2)   Secondary   Cluster  (DC#3)   Client   Update  
  10. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. ϨϓϦέʔγϣϯϞʔυ  

    #3   #4,6   Secondary   Cluster   #3   Primary   Cluster   #5   #1   TCP  connecUon   #1)  Client͕persistent  TCP  connecUonΛ։ઃ   #2)  Client͕Full-­‐syncͷىಈΛཁٻ   #3)  ServerͱClientͷ྆ํͰࣗ਎ͷ࣋ͭobjectͷHashΛܭࢉ   #4)  Client͕ܭࢉ݁ՌΛServerʹ౉͢   #5)  Server͸Client͔Βͷ݁ՌΛൺֱࠩ͠෼Λૹ৴   #6)  Client͸ड৴ͨ͠ObjectΛΞοϓσʔτ   #6 #3   #4   #1)  Primary  Cluster͕UpdateϦΫΤετΛड৴   #2)  ϨϓϦέʔγϣϯΛ࡞੒   #3)  ACKड৴ʹΑΓॻࠐΈ੒ޭͱ൑அ   #4)  ॻࠐΈ੒ޭޙɺMDC  server΁ϦΫΤετૹ৴   #5)  Server͸Client΁ObjectΛૹ৴   #6)  Secondary  ClusterͰϨϓϦέʔγϣϯΛ։࢝   #1   #2   Primary   Cluster   Secondary   Cluster   #5 TCP Connection Real-­‐Ume  sync   Full-­‐sync   Client   update  
  11. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. ͦͷଞͷػೳ~1.3    

      •  ΞΫςΟϒɾΞϯνΤϯτϩϐʔʢAAEʣͷ௥Ճ   •  ো֐࣌ɺಉ࣌Ξοϓσʔτͦͯ͠෺ཧతͳσʔλܽམ΍ഁյͳͲʹΑΓൃੜͨ͠σʔλͷඇ Ұ؏ੑͷܧଓతͳम෮Λࣗಈతʹ࣮ߦɻ   •  ϚϧνσʔληϯλʔϨϓϦέʔγϣϯ΁ͷAdvanced  modeͷ௥Ճ   •  ৽͘͠Advanced  modeʢύΦʔϚϯε޲্ɺෳ਺TCPίωΫγϣϯͱ؆୯ͳઃఆʣΛ௥Ճɻ   •  IPv6αϙʔτͷ֦ு  
  12. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. Riak1.4ͷ৽نػೳ(2013.June?)  

    •  ϦϯάαΠζͷมߋ   •  ༰ྔޮ཰ͷ޲্   •  2i  Ͱͷ໰͍߹Θͤޮ཰Խ   •  MDCϨϓϦέʔγϣϯAdvanced  mode ʹSSLɼNAT,  ϓϩΩγ௥Ճ   •  Riak  ControlͷGUIվળ   What’s new on Riak1.4
  13. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. Πϯετʔϧ 1.  yum

    / apt ͳͲʹbasho ͷϨϙδτϦΛ௥Ճ 2. $ sudo apt-get install riak! 3. $ sudo riak start! 4. $ curl http://localhost:8098/ !
  14. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. ϊʔυ௥Ճ 1.  ௥Ճ͢ΔϚγϯΛىಈ

    2. $ riak-admin cluster \! join [email protected]! 1. $ riak-admin cluster plan! 2. $ riak-admin cluster commit! ͢Ͱʹىಈͯ͠ ͍ΔΫϥελͷ ͏ͪ୭͔
  15. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. ϊʔυ཭୤ 1. $ riak-admin

    cluster leave! 2. $ riak-admin cluster plan! 3. $ riak-admin cluster commit!
  16. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. ঢ়ଶ֬ೝίϚϯυ 1. $ riak-admin

    member-status! 2. $ riak-admin ring-status! 3. $ riak-admin transfers!
  17. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. •  Riak෼ࢄܕσʔλϕʔεͷ্ʹ࣮૷  

    •  γϯϓϧʹར༻ՄೳͳΫϥ΢υετϨʔδ   •  S3ޓ׵API     •  Ϛϧνςφϯτ   •  ϚϧναΠτϨϓϦέʔγϣϯ   •  ςφϯτຖͷωοτϫʔΫͱετϨʔδ࢖ ༻ྔͷใࠂػೳ   •  24h  x  7  daysαϙʔτ  
  18. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. ΫϥΠΞϯτ͔ΒRiak  CS  API

    Λར༻͠ϑΝΠϧΛΞοϓϩ ʔυ   Riak  CS͸ϑΝΠϧΛ1MBͷν ϟϯΫʹ෼ׂ   Riak  CS͸νϟϯΫΛRiakϊʔ υʹྲྀ͢   Riakϊʔυ͸νϟϯΫΛϦϓ Ϧέʔγϣϯ͠อଘ  
  19. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. Riak CS  ͷϢʔεέʔε

    ύϒϦοΫ Ϋϥ΢υεετϨʔδ AWSҎ֎ͷS3४ڌͷ ετϨʔδ   Ϋϥ΢υυϥΠϒ   (ҰൠతͳίϯςϯπετϨʔδ)   Backup-­‐as-­‐a-­‐Service   ΞʔΧΠϒετϨʔ δ ࣾһͱࣾ಺෦໳ͷͨ ΊͷετϨʔδ
  20. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. APIͱΠϯλϑΣʔε    

    •  Amazon  S3  REST  API४ڌ   •  ҰൠతͳS3  libraries  /  toolsΛར༻Մೳ   •  REST  GET,  PUTͱDELETEΦϖϨʔγϣϯ   •  S3-­‐style  ACLs     Storage  API  
  21. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. APIͱΠϯλϑΣʔε    

    •  ϢʔβΞΧ΢ϯτ࡞੒ɺΞΧ΢ϯτແ ޮԽͱ؅ཧ༻ͷΠϯλϑΣʔε   •  ඪ४ͷS3ೝূεΩʔϚʢϔομͱΫΤ ϦʔύϥϝʔλೝূΛαϙʔτʣ   •  ؅ཧऀͷΈ͕ϢʔβΞΧ΢ϯτͷ࡞੒ ΛͰ͖ΔΑ͏ʹઃఆՄೳ   AdministraUon,  Users   and  AuthenUcaUon  
  22. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. ϚϧνσʔληϯλʔϨϓϦέʔγϣϯ  • 

    ϢʔβؒͰάϩʔόϧͳ৘ใʢόέοτͱ ϚχϑΣετʣ͸ɺϦΞϧλΠϜʹϨϓϦ έʔγϣϯ   •  ΦϒδΣΫτ৘ใͷϨϓϦέʔγϣϯ͸ɺ ϑϧಉظ(Full-­‐sync)·ͨ͸ϦΞϧλΠϜಉظ (Real  Ume)Λબ୒   •  Ϣʔβ͕ΦϒδΣΫτͷGETΛཁٻͨ͠ࡍ ʹɺΞΫηεͨ͠αΠτʹ͸ΦϒδΣΫτ Λߏ੒͢ΔϒϩοΫͷҰ෦͕ϨϓϦέʔγ ϣϯ͞Ε͍ͯͳ͔ͬͨ৔߹ɺ଍Γͳ͍ϒϩ οΫΛ”ΦϦδϯ”ͷΫϥελʔଆ͔Βऔಘɺ ࠶ߏ੒   How  It  Works  
  23. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. Riak CS 1.4

     ͷ৽ػೳ(2013.  June)       •  OpenStack  API  ௥Ճ   •  ରԠ  S3  API  ͷ௥Ճ   •  Ϣʔβʔ؅ཧͷ֦ॆ   What’s  new!  
  24. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. Riak ͷద༻γφϦΦ 

    •  Ad  Networks   •  Digital  Media   •  On-­‐Line  Games   •  Social  Networks   •  Social  Analysis   •  Cloud  Operators   •  Messaging  Services   •  Product  Catalogs   •  Document  Management   •  Health  Care  InformaUon  Management  
  25. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. ੡඼৘ใͷอ؅  • 

    ֦ுੑͱϢʔβΤΫεϖϦΤϯεͷύϑΥ ʔϚϯεվળ   •  bestbuy.comͱখചΓళฯͰ࢖༻͢ΔΦϯ ϥΠϯ੡඼ΧλϩάɺϨʔςΟϯάʹRiak Λબ୒ɻ   •  Holiday  ShoppingʢΫϦεϚεηʔϧͳ Ͳʣ࣌ʹ߹Θͤͯϊʔυ௥Ճɻ   •  Bestbuy.comͷϗʔϜϖʔδϨϯμϦϯά ͷSLA͸̍ඵҎ಺ɻ   •  2013೥ͷHoliday  seasonʹ͸ɺSKU਺Ͱ26ඦ ສ͔Β500ඦສ΁֦ுΛ૝ఆɻ   •  Amazon  AWSͷෳ਺Availability  Zone্ʹRiak ΫϥελʔΛߏங  
  26. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. ϝχϡʔγεςϜ •  ౰ॳAmazon

     S3Λ࢖༻;  On  demandϝχϡʔͷϥ΢ϯ υτϦοϓϨΠςϯγʔͷ௿ݮΛୡ੒   •  ߴ଎ͳಡΈग़͠/ॻࠐΈͷͨΊRiakΛબ୒   •  Video  On  demandϝχϡʔͷΞάϦήʔτʹඞཁͳ σʔλΛอଘ   •  ϚʔέςΟϯάΩϟϯϖʔϯʹকདྷ࢖༻͢ΔͰ͋Ζ ͏Ϣʔβؔ࿈ͷ৘ใΛอଘ   •  ຖ೔ɺϦϞʔτίϯτϩʔϥ͔Βͷ25MΫϦοΫ਺ Λॲཧ   •  On  demandϝχϡʔͷͨΊʹ̏ΧॴͷDCʹRiakΫϥ ελʔΛߏஙɻ   •  ϚʔέςΟϯά༻ʹ̐ͭͷΫϥελʔΛߏங  
  27. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. ϔϧεέΞ৘ใ؅ཧ •  HealthσʔλΛγΣΞɺΞΫηε͢ΔͨΊͷHIPAA४

    ڌͷWebͱܞଳి࿩ͷϓϥοτϑΥʔϜΛߏங   •  ίετ௿ݮͱߴՄ༻ੑɾ֦ுੑͷཱ྆   •  ߴ଎ͳಡΈग़͠/ॻࠐΈͷͨΊRiakΛબ୒   •  mHealth͸ɺܞଳి࿩ɺαʔϏε͓Αͼҩྍػث͔ ΒͷσʔλΛऩूʢױऀ͕औಘσʔλΛঝೝʣ   •  2015೥ʹ500M  appsΛ૝ఆɻ   •  ̏ΧॴͷDCʹRiakΫϥελʔΛߏஙɻ  
  28. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. Πϕϯτ؅ཧ •  ϥΠηϯείετͷ௿ݮ͓Αͼӡ༻ͷ༰қ͞

      •  Ϣʔβొ࿥৘ใ͓ΑͼϢʔβΠϕϯτϩάͷอଘɻ ʢϢʔβ͕Webར༻ঢ়گϞχλʔΛޙ͔ΒνΣο Ϋʣ   •  Πϕϯτ௨஌αʔϏεʹͯ৽ن৘ใΞοϓσʔτ௨ ஌Λ഑৴͢ΔͨΊͷΫΤϦ༻DBʹ࢖༻   •  14,000  read  request/sec   •  2013೥தʹ3ՕॴͷDCϔ֦ு༧ఆ   •  Πϕϯτ௨஌αʔϏε͸ɺ50ඦສίωΫγϣϯ/೔ Λ૝ఆɻ  
  29. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. ΦϯϥΠϯ޿ࠂ •  DCϨϓϦέʔγϣϯͱ֦ுੑͷඞཁ͔Β

      MySQL  →  Cassandra  →  Riak  ͱϦϓϨʔε   •  ϢʔβΞΫςΟϏςΟσʔλ͓ΑͼτϥϑΟο ΫσʔλΛอଘ   •  τϥϑΟοΫσʔλ͸MySQL͔ΒҠߦʢෳ਺DC ؒͷσʔλϨϓϦέʔγϣϯ͕ඞཁʣ   •  Ϣʔβσʔλ͸Cassandra͔ΒҠߦʢbackward   compaUbility͕֬อͰ͖͍ͯͳ͍͜ͱ͕աڈͷ ϦϦʔεʹ͋Γɺ৴༻Ͱ͖ͳ͍ͨΊܾஅʣ   •  5ΧॴͷDCؒͰσʔλϨϓϦέʔγϣϯ   •  2011೥ʹ4  trillionͷadσʔλΛѻ͏ɻ   advertising conomic potential of uding OpenX mpTime) provide a bining ad serving, an ad exchange, a Supply Side Platform, and ach year. OpenX uses Riak for user and trafficking data behind its data services API. They selected Riak due to its highly available, low-latency, redundant architecture. OpenX also uses Riak’s  multi- datacenter replication across several data centers, providing up-to-date data throughout its global infrastructure. For more details about how OpenX uses Riak, check out the video of Anthony Molinaro, OpenX engineer, speaking at RICON2012,  Basho’s  2012   developer conference. ng technology provider. gencies, mobile operators, active and measurable obile devices. In 2009, rly all of the broadcasters le operators. With the dly, they needed to move to an architecture that could gracefully new platform because it is distributed, scalable, and highly mes of traffic. they opted to build two geographically separated, mirrored sites ation feature. As Marcus Kern, VP of Technology at Velti, ver  140  customers.  We  cannot  afford  a  single  minute  of   d exceed our requirements for scale, data durability, and 2009೥࣌఺  
  30. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. υΩϡϝϯτετϨʔδ •  ΦϒδΣΫτετΞΛMySQL͔ΒRiak΁Ϧϓ

    Ϩʔε   •  ΞϓϦέʔγϣϯ͕ѻ͑ΔΦϒδΣΫτϑΝ ΠϧͷαΠζ֦େԽΛ࣮ࢪ   •  HRΞϓϦέʔγϣϯ͕ऩू͢ΔΦϒδΣΫτ ϑΝΠϧΛอଘ   •  ΦϒδΣΫτϑΝΠϧΛෳ਺ͷDCͷΫϥελ ʹϨϓϦέʔγϣϯɻ   •  ·ͨQA΍࣍ظϦϦʔεͷͨΊͷStage༻Ϋϥε λ΁΋ϨϓϦέʔγϣϯɻ   •  ̕ΧॴͷΫϥελʢStage༻ΫϥελΛؚΉʣ   Workday DRIVERS 1.  Replace MySQL object store. 2.  Implement ability to dramatically increase the size of attachments accepted by the Workday application. STATS 1.  Nine 5 node clusters spread across 3 data centers and 3 application zones. FACTOIDS 1.  At Workday IPO in October 2012, Workday shares opened at $48.05 USE CASE 1.  Host and store attachments collected by the Workday HR application. 2.  Replicate attachments across several clusters including initial customer setup, ongoing production, and QA for upcoming releases. Workday Application! Riak! Workday Blobitory! Real  Ume   replicaUon   Prod#1   (Dublin)   Prod#2   (Ams)   Stage   (Dublin)   BidirecUonal   replicaUon   Real  Ume   DirecUonal   ReplicaUon  
  31. ©2013 BASHO TECHNOLOGIES INC. ALL RIGHTS RESERVED. :BIPP+"1"/ •  ΠϯλʔωοτγϣοϐϯάαΠτͷϓ

    ϥοτϑΥʔϜΛYahoo!δϟύϯ͕ఏڙ   •  γϣοϐϯάαΠτͷը૾σʔλΛRiak   CSʹετΞ   •  ొ࿥ΦϒδΣΫτ਺ɿ20ສ݅ʢ2012೥຤ ࣌఺ʣ   •  ϦΫΤετ਺ɿ450  req/sec   •  Ϩεϙϯεɿ10ms  –  80ms   •  ߏஙɿ1೔ɻ   •  S3ޓ׵Ϋϥ΢υετϨʔδαʔϏεΛఏڙ   •  2ΧॴͷDCؒͰσʔλϨϓϦέʔγϣϯ