Slide 1

Slide 1 text

ChatWork ͷ ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ AWS Dev Day Tokyo 2017 Ճ౻५Ұେଜ৳ޗ

Slide 2

Slide 2 text

ࣗݾ঺հ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork େଜ৳ޗ ๏ ίΞςΫϊϩδʔ։ൃࣨ ๏ 4DBMB෼ࢄγεςϜػցֶश ๏ 'BMDPOͰ͸શମઃܭΠϯϑϥ୲౰ Ճ౻५Ұ ๏ ίΞςΫϊϩδʔ։ൃࣨ ๏ 4DBMBυϝΠϯۦಈઃܭ0"VUI ๏ 'BMDPOͰ͸શମઃܭΞϓϦέʔγϣϯ୲౰

Slide 3

Slide 3 text

ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ύʔτ1 'BMDPOΞʔΩςΫνϟৄղʢՃ౻ʣ ύʔτ2 $IBU8PSLƎŭŴƮ%FW0QTڿ೿ʢେଜʣ

Slide 4

Slide 4 text

ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork 'BMDPOΞʔΩςΫνϟৄղ ύʔτ1

Slide 5

Slide 5 text

ΞʔΩςΫνϟ࡮৽ͷഎܠ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ ։ൃ೥ʙɻ಺੡'8Λ༻͍ͨࣾ಺޲͚ΞϓϦέʔγϣϯɻ
 طଘγεςϜʹ૬৐Γɻ೥ʹެ։αʔϏεԽ ๏ ঎ػΛಀ͞ͳ͍ͨΊʹͻͨ͢Β։ൃͷ೔ʑɻͦͷ୅ঈͱٕͯ͠ज़తෛ࠴͕ੵΈ্͕ͬͨɻ
 ૿͑ଓ͚Δσʔλͱෛՙ͸ࣾ಺γεςϜΛϕʔεʹͨ͠ΞʔΩςΫνϟͰ͸ݶքΛܴ͑ͨ ๏ ૯ίʔυྔສߦҎ্ɻڞ௨ॲཧΛߦ͏த৺తͳΫϥε͸ΫϥεͰສߦ

Slide 6

Slide 6 text

৽ΞʔΩςΫνϟ΁ͷಓͷΓ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ ͦͷޙ41P'ରࡦͳͲͷվળ͸ܧଓతʹߦ͕ͬͨࠜຊରࡦ͸Ͱ͖ͳ͔ͬͨɻ 
 ํ਑Λม͑ͯγεςϜΛ࡮৽͢Δ͜ͱʹͳͬͨ
 ๏ γεςϜ࡮৽ʹ޲͚ͯɺ࠷ॳʹϥΠϒϚΠάϨʔγϣϯϓϥϯ ӈਤ Λબ ୒ͨ͠ɻ ‣ طଘγεςϜ΁ͷӨڹΛ࠷খݶʹ͢ΔͨΊʹ w طଘγεςϜͷίʔυΛۃྗมߋ͠ͳ͍ w ແఀࢭϚΠάϨʔγϣϯ ‣ είʔϓ͸νϟοτϧʔϜʹؔ͢Δ͢΂ͯͷػೳ ϧʔϜ ϝοηʔδ λεΫ ϑΝΠϧ ίϯλΫτ 
 ๏ Ұ೥൒΄Ͳ։ൃΛଓ͚͕ͨɺ༷ʑͳ໰୊ ϓϩδΣΫτϚωδϝϯτɺε ίʔϓɺύϑΥʔϚϯεͳͲ ͕ى͖ɺϓϩδΣΫτΛ࠶ىಈͨ͠ʜ
 ๏ ࠜຊతʹઓུΛม͑ͯ৽͍͠ΞʔΩςΫνϟʹҠߦ͢Δ͜ͱʹͨ͠
 ͦΕ͔Β໿೥ؒͷ։ൃظؒΛܦͯɺେن໛ͳσʔλҠߦΛߦ͍ɺ ೥຤ʹແࣄϦϦʔε

Slide 7

Slide 7 text

৽ΞʔΩςΫνϟͷํ਑ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ Ϗδωεʹ࠷΋Өڹͷେ͖͍ϝοηʔδͷΈͷείʔϓʹߜΔ ‣ ϝοηʔδ਺ͷਪҠ͸ɺ೥ԯ݅‎೥ԯ݅‎೥ԯ݅ ‣ ϝοηʔδ਺͸ɺࢦ਺ؔ਺తʹٸ૿͍ͯ͠Δ ๏ อकੑΛҡ࣋͢ΔͨΊʹɺυϝΠϯۦಈઃܭ͸ܧଓ
 ๏ ϦΞΫςΟϒγεςϜ "LLB Λϕʔεʹͨ͠$234&4Λ࠾༻ ‣ ߴεϧʔϓοτɾ௿ϨΠςϯγΛ࣮ݱɻ
 ݱߦγεςϜͷഒఔ౓ͷಉ࣌઀ଓ਺ͱεϧʔϓοτΛ࣮ݱ͢Δ͜ͱ ‣ ՄೳͳݶΓো֐ʹରͯࣗ͠ݾճ෮ྗΛ࣋ͭ ๏ ௿ίετͰ͋Δ͜ͱ γεςϜن໛ͱίετͷ૬͕ؔઢܗະຬ 
 ๏ ίϯηϓτݕূ 10$ Λඞਢͱ͢Δ
 ΫωϏϯϑϨʔϜϫʔΫͷෳࡶͳ՝୊΁ͷରԠ ୳ࠪ‎஌֮‎ରԠͷΞδϟΠϧϓϩηε

Slide 8

Slide 8 text

$234ͱ͸ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ $PNNBOEBOE2VFSZ3FTQPOTJCJMJUZ4FHSFHBUJPO ‣ ίϚϯυɾΫΤϦ੹຿෼཭ ‣ ೥(SFH:PVOHࢯʹΑͬͯߟҊ͞ΕͨΞʔΩς Ϋνϟύλʔϯ ๏ $PNNBOE2VFSZ4FQBSBUJPO$24 ‣ ίϚϯυΫΤϦ෼཭ݪଇ ‣ ʮ͋ΒΏΔϝιου͸ɺΞΫγϣϯΛ࣮ߦ͢ΔίϚϯ υ͔ɺݺͼग़͠ݩʹσʔλΛฦ͢ΫΤϦ͔ͷ͍ͣΕ͔ Ͱ͋ͬͯɺ྆ํΛߦͬͯ͸ͳΒͳ͍ɻ͜Ε͸ɺ࣭໰͢ Δ͜ͱͰճ౴ΛมԽͤͯ͞͸ͳΒͳ͍ͱ͍͏͜ͱͩʯ ‣ ೥#FSUSBOE.FZFSࢯʹΑͬͯߟҊ͞Εͨઃܭ ݪଇ
 ๏ $24ΛΞʔΩςΫνϟʹద༻ͨ͠ͷ͕$234

Slide 9

Slide 9 text

&WFOU4PVSDJOHͱ͸ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ (SFH:PVOHࢯͷߟҊ ๏ &WFOU4PVSDJOH ҎԼ&4 ͱ͸ɺσʔλͰ͸ͳ͘Կ͔͠Βͷग़དྷࣄʹυϝΠϯΠϕϯτΛϞσ Ϧϯάͷओ໾ʹ͢Δ͜ͱ ๏ υϝΠϯϞσϧΛσʔλͱͯ֨͠ೲ͢ΔͷͰ͸ͳ͘ɺൃੜ͢ΔυϝΠϯΠϕϯτͷ͢΂ͯΛӬ ଓԽ͢Δ ݪଇతʹ௥Ճॻ͖ࠐΈ ɻϞσϧͷঢ়ଶ͸ɺΠϕϯτͷྻΛ࠶ੜ͢Δ͜ͱͰಘΒΕΔ ๏ &4͸ɺ$234Λܶతʹվྑ͢Δ

Slide 10

Slide 10 text

ॳظͷ$234&4Ϟσϧ 10$࣌ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork w υϝΠϯۦಈઃܭ w υϝΠϯΠϕϯτΛετϨʔδʹॻ͖ࠐΉ Write API Read Model Updater w υϝΠϯΠϕϯτΛϦʔυϞσϧʹม׵ Read API w ΫΤϦۦಈઃܭ w Πϯελϯε਺ͱεϧʔϓοτͷؔ܎͸ɺ ΄ͱΜͲઢܗͰεέʔϧΞ΢τ͢Δ͜ͱ͕ Θ͔ͬͨ ݕূ݁Ռ

Slide 11

Slide 11 text

࠷ऴతͳΞʔΩςΫνϟ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ 10$ͷ݁ՌΛ౿·͑ͯɺ$234&4ͱϦΞΫςΟϒγεςϜΛϕʔεʹͨ͠ຊ൪૝ఆͷΞʔΩςΫνϟΛߏஙͨ͠ ๏ 'BMDPO͸ɺطଘγεςϜͷͨΊͷϝοηʔδϯάόοΫΤϯυαʔϏε ๏ ૝ఆͲ͓ΓɺϩʔίετͰϋΠύϑΥʔϚϯεͳΞʔΩςΫνϟΛ࣮ݱ

Slide 12

Slide 12 text

ίϯϙʔωϯτߏ੒ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ෼ྨ ίϯϙʔωϯτ ϛυϧ΢ΣΞελοΫ ֓ཁ ετϨʔδ Write DB Kafka ύʔςΟγϣϯ͕1Room಺ͷΠϕϯτͷ࿈ଓੑΛอূ͢Δɻ Read DB HBase ReadModelΛӬଓԽɻRowΩʔ͸ɺ”RoomId + MessageId” ΞϓϦέʔγϣϯ Write API akka-http, circe, akka- stream, kafka ΫϥΠΞϯτ͔Βϝοηʔδͷ౤ߘɾߋ৽Λड͚෇͚ɺ KafkaʹυϝΠϯΠϕϯτΛΤϯΩϡʔ͢Δ Read API akka-http, circe, hbase ϝοηʔδͷऔಘɾݕࡧΛड͚෇͚ɺ HBase͔ΒRead ModelΛΫϥΠΞϯτΛฦ͢ɻ Read Model Updater akka-actor, akka-stream, kafka-stream Kafka͔ΒυϝΠϯΠϕϯτΛσΩϡʔ͠ɺHBaseʹRead ModelΛߏங͢Δɻ ͦͷޙɺSparrow ForwarderͷͨΊʹ࠶ͼKafkaʹΤϯΩϡʔ͢Δɻ Sparrow Forwarder akka-actor, kafka Kafka͔ΒυϝΠϯΠϕϯτΛσΩϡʔ͠ɺSparrow APIΛίʔϧ͢Δɻ

Slide 13

Slide 13 text

ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ΞϓϦέʔγϣϯΞʔΩςΫνϟ

Slide 14

Slide 14 text

"1*4FSWFSͷϨΠϠʔߏ଄ͱओཁͳΦϒδΣΫτ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ϔΩαΰφϧΞʔΩςΫνϟ %*1Λద༻ͨ͠ϨΠϠԽΞʔΩςΫνϟ Λ࠾༻ɻ

Slide 15

Slide 15 text

4QBSSPX'PSXBSEFSͷϨΠϠʔߏ଄ͱओཁͳΦϒδΣΫτ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ ಉҰτϥϯβΫγϣϯͷޙଓॲཧΛ1)1ଆͰߦ͏ͨΊʹɺඞཁͳίϯϙʔωϯτ ๏ 3FBE.PEFMͷߏங͕׬ྃͨ͠ޙʹɺͦͷΠϕϯτΛ4QBSSPXʹ఻͑Δ ๏ ώΤϥϧΩʔԽ͞ΕͨΞΫλʔ͕૬ޓʹ࿈ܞ͢Δ

Slide 16

Slide 16 text

ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork 'BMDPOͷ࣮੷͔ΒֶͿ zো֐ʹڧ͍ΞΫλʔzΛઃܭ͢Δํ๏

Slide 17

Slide 17 text

&SSPS,FSOFMQBUUFSO ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ In a supervision hierarchy, keep important application state or functionality near the root while delegating risky operations towards the leaves. - Reactive Design Patterns
 ๏ εʔύʔϏδϣϯώΤϥϧΩʔͰ͸ɺةݥͳ࡞ۀΛώΤϥϧΩʔͷ຤୺ʹҕৡ͢Δͱಉ࣌ʹɺ ϧʔτۙ͘ʹॏཁͳΞϓϦέʔγϣϯঢ়ଶ΍ػೳΛҡ࣋͢Δ ๏ ͜ͷύλʔϯ͸ɺ&SMBOHͰ਺े೥ʹΘཱͨͬͯ֬͞Ε͍ͯΔɻ
 Jonas Bonerࢯ LightBendࣾCTO ͕AkkaΛ࣮૷͢ΔͨΊͷओͳΠϯεϐϨʔγϣϯͷͭ ग़య: Reactive Design Patterns, Jonas Boner, Dr. Roland Kuhn, Brian Hanafee, Jamie Allen

Slide 18

Slide 18 text

-FUJUDSBTIQBUUFSO ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ Prefer a full component restart to internal failure handling. - Reactive Design Patterns
 ๏ ಺෦ΤϥʔϋϯυϦϯάΑΓ΋ɺ׬શͳίϯϙʔωϯτ࠶ىಈΛਪ঑͢Δɻ ‣ ಺෦Τϥʔ͔Βͷճ෮͢Δػߏ͸ɺނোͨ͠෦෼Λे෼ʹ෼཭Ͱ͖ͳ͍ɻ
 ίϯϙʔωϯτ಺෦ͷ͢΂͕ͯো֐ʹΑͬͯӨڹΛड͚ΔՄೳੑ͕͋Δ ‣ εʔύʔόΠβʹো֐΁ͷରԠ͸ҕ೚͠ɺγεςϜͷҰ෦Λ࠶ىಈͯ͠෮چ͢Δ ‣ ֊૚తͳ࠶ىಈϕʔεͷো֐ॲཧʹΑΓɺো֐ϞσϧΛେ෯ʹ؆ૉԽͰ͖Δɻ
 ·ͨɺ༧ظ͠ͳ͍ো֐ʹૺ۰ͯ͠΋ੜ͖࢒ΔՄೳੑ͕૿͢ ग़య: Reactive Design Patterns, Jonas Boner, Dr. Roland Kuhn, Brian Hanafee, Jamie Allen

Slide 19

Slide 19 text

Supervisor ΞΫλʔͷεʔύʔϏδϣϯώΤϥϧΩʔ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ ਌ͱࢠͷΞΫλʔͷߏ଄ ໦ߏ଄ ͕͋Δɻ਌͸ࢠͷੜ੒΍؂ಜ Λߦ͏ ๏ ਌ʹΑͬͯ࡞ΒΕͨࢠΞΫλʔ͸ɺεʔύʔόΠβͷ؂ಜԼʹ ஔ͔ΕΔɻࢠΞΫλʔ͕ഁغ͞ΕΔͱɺͦͷࢠΞΫλʔʹର͢ Δ਌ͷ؂ಜ੹೚΋ऴྃ͢Δ ๏ Ϋϥογϡ͢ΔՄೳੑ͕ߴ͍ΞΫλʔ͸ɺՄೳͳݶΓώΤϥϧ ΩʔͷԼ૚ʹ഑ஔ͢ΔɻԼ૚Ͱى͖ͨো֐͸ɺ্Ґ·ͰͷώΤ ϥϧΩʔ͕؅ཧɾΤεΧϨʔγϣϯ͕Մೳɻো֐Λىͨ͜͠ࢠ ΞΫλʔ͸਌ͷࢦࣔʹΑͬͯ࠶ىಈɾఀࢭͳͲߦ͏ Supervisor Child Child Child Supervisor Child Child Supervisor Child Child ग़య: Akka in Action, Raymond Roestenburg, Rob Bakker, Rob Williams

Slide 20

Slide 20 text

"LLBͰͷεʔύʔϏδϣϯώΤϥϧΩʔ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ ࠷ॳʹActorSystem͕࡞ΒΕΔɻActorSystemΛ࢖ͬͯ࠷ॳͷεʔύʔόΠβΛ ࡞ΔɻεʔύʔόΠβ͕ ࢠΞΫλʔΛ࡞Δ͜ͱͰώΤϥϧΩʔΛߏங͢Δ
 ๏ ࣮ࡍʹ͸ɺΞϓϦέʔγϣϯ༻ͷΞΫλʔ͸VTFSHVBSEJBO഑Լʹॴଐ͢Δ Application Orders Products Users Order Product User Supervisor ActorSystem("OderSystem") / system user “root guardian” “user guardian” “the one who works the bubbles of space-time” “system guardian” your actor hierarchy sys support hierarchy shutdown order ग़య: akka.io - Supervision and Monitoring

Slide 21

Slide 21 text

εʔύʔϏδϣϯώΤϥϧΩʔͷ࣮૷ύλʔϯ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ ϩάϑΝΠϧΛ؂ࢹ‎ϝϞϦ্ʹϩʔυ‎ߦʹ෼ղ‎%#ʹॻ͖ ࠐΉྫɻࢠΞΫλʔ͕Ӆṭ͞Ε͍ͯͳ͍࣮૷ύλʔϯ ๏ ར఺͸ɺ֤ΞΫλʔ͕૬ޓʹ௚઀௨৴͢Δ͜ͱɻεʔύʔόΠ β͸؂ಜۀ຿ͱΠϯελϯε࡞੒ͷΈ
 ๏ ܽ఺͸ɺ࠶ىಈ͔͠࢖͑ͳ͍͜ͱͱɺϝοηʔδ͕σουϨ λʔʹૹΒΕࣦͯΘΕͯ͠·͏Մೳੑ͕͋Δ͜ͱɻ਌ͷεʔ ύʔόΠβ͸ϝοηʔδϑϩʔ͔Β෼཭͞Εͯ͠·͏ Database DbWriter Row LogProccessor LogFile LogFileWatcher NewFile DbWriter Supervisor LogProccessor Supervisor LogFileWatcher Supervisor ώΤϥϧΩʔͷҧ͏ࢠΞΫλʔ΁ͷ ActorRefΛಘΔͷ͸೉͍͠ ग़య: Akka in ActionΑΓฤू, Raymond Roestenburg, Rob Bakker, Rob Williams

Slide 22

Slide 22 text

εʔύʔϏδϣϯώΤϥϧΩʔͷ࣮૷ύλʔϯ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ ઌ΄Ͳͱಉ͡ॲཧϑϩʔ͕ͩɺதؒʹεʔύʔόΠβΛڬΈࢠ ΞΫλʔΛӅṭ͢Δ࣮૷ύλʔϯ ๏ εʔύʔόΠβ͸୯ͳΔੜ੒΍؂ಜͰ͸ͳ͘ɺؒ઀ࢀরͱ͠ ͯɺ͢΂ͯͷϝοηʔδΛ୯ʹಁաతʹϑΥϫʔυ͢Δɻ
 εʔύʔόΠβ͸ࢠΞΫλʔΛऴྃͨ͠Γɺ֎෦ͷΞΫλʔͱ ͸ແؔ܎ʹ৽͍͠΋ͷΛੜΈग़ͨ͠ΓͰ͖Δ
 ๏ ઌͷྫͱൺ΂ͯϝοηʔδϑϩʔͱώΤϥϧΩʔͷΪϟοϓ͕ ͳ͍ Database DbWriter DbWriterSupervisor LogFileWatcher Supervisor Row LogProccessor LogProccessorSupervisor LogFile LogFileWatcher NewFile ग़య: Akka in ActionΑΓฤू, Raymond Roestenburg, Rob Bakker, Rob Williams

Slide 23

Slide 23 text

4QBSSPX'PSXBSEFSͷεʔύʔϏδϣϯώΤϥϧΩʔ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ 3֊૚ͷώΤϥϧΩʔɻதؒͷεʔύʔόΠβ͸ Exponential BackOffΛαϙʔτ͢Δ
 ๏ ԼҐ૚ͷΞΫλʔ͸͍ͭͰ΋Ϋϥογϡͯ͠΋Α͍ɻ ࢠΞΫλʔͰྫ֎͕ൃੜ͢Δͱ࠶ىಈΛ໋͡Δɻ #BDL0⒎ޙʹϓϩηεΛ࠷ॳ͔Β΍Γ௚͢
 ๏ "1*ίʔϧ΋ಉ༷ʹ#BDL0⒎͍͕ͯͨ͠,BGLBͷηο γϣϯλΠϜλΠϜΞ΢τ͕ൃੜ͢ΔͨΊɺ#BDL0⒎ ͠ͳ͍Α͏ʹͨ͠ɻશମͷॲཧϑϩʔʹӨڹΛ༩͑ͳ ͍Α͏ʹ#BDL0⒎͢Δ͜ͱ͕ٻΊΒΕΔ ໰୊͕ى͖ ͨͷͰɺ BackOffΛ ഇࢭͨ͠

Slide 24

Slide 24 text

'BMDPOΞʔΩςΫνϟৄղͷαϚϦ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ ΞϓϦέʔγϣϯ։ൃͰͷ੒ޭཁҼ ‣ ,1*ߩݙ౓͕ߴ͍είʔϓͷબ୒ͱ10$ͷಋೖ ‣ ϦΞΫςΟϒγεςϜͱCQRS + ESͷ࠾༻ ๏ ࠓճͷϓϩδΣΫτͷޮՌ ‣ ະ஌ͷٕज़Λ࠾༻͠ͳ͕Β΋ݫબͨ͠ݕূΛ౿·͑ɺϦΞΫςΟϒγεςϜͱ $234&4ͷಛ௃Λ͋Θͤ࣋ͭɺϋΠύϑΥʔϚϯεͰো֐ʹڧ͍γεςϜΛ ߏங͢Δ͜ͱ͕Ͱ͖ͨ

Slide 25

Slide 25 text

ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork $IBU8PSLʹ͓͚Δ%FW0QTվળ ύʔτ2

Slide 26

Slide 26 text

Ϟνϕʔγϣϯ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ ChatWork಺ʹେ͖ͳϝοηʔδϯά༻ͷαϒγεςϜΛ
 ߏங͢Δ(miroserviceతʹ੾Γग़͢)ͳΒ
 ๏ ͜Ε·ͰͷΠϯϑϥӡ༻՝୊΋ղܾ͍ͨ͠ ‣ ओͳର৅ɿςετɾϦϦʔεύΠϓϥΠϯɺ࣮ߦΠϯϑϥ ๏ ։ൃνʔϜ͕ࣗ਎ͰϦϦʔεαΠΫϧΛप͠ɺ
 ӡ༻·ͰͰ͖ΔΑ͏ͳঢ়گΛ࡞ͬͯ%FW0QTΛՃ଎͍ͤͨ͞

Slide 27

Slide 27 text

ࠔ͍ͬͯͨ͜ͱ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ ݱߦγεςϜͷΠϯϑϥߏ੒௒֓ཁ ‣ EC2ϕʔε(php)ͷαʔό܈ ‣ JenkinsʹΑΔσϓϩΠδϣϒ܈ ‣ CapistranoΛ࢖ͬͨσϓϩΠ ‣ FabricʹΑΔઃఆ؅ཧ
 ๏ ࠔ͍ͬͯͨ͜ͱ ‣ ϦϦʔε࡞ۀ͕׬શʹࣗಈԽ͞Ε͓ͯΒͣϦϦʔε͕େม ‣ σϓϩΠϑϩʔͷվम͕େม$*αʔόͷӡ༻ෛՙߴ͍ ‣ ෛՙࢼݧͷख͕ؒ੯͍͠ ΋ͬͱΧδϡΞϧʹ΍Γ͍ͨ

Slide 28

Slide 28 text

ୡ੒Ͱ͖ͨ͜ͱ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ෛՙࢼݧΛ௨ͬͨΞϓϦίʔυΛҡ࣋Ͱ͖ Falcon։ൃνʔϜ͕ νʔϜ͚ͩͰ޷͖ͳλΠϛϯάͰϦϦʔε͠ ΞϥʔτରԠ·ͰνʔϜͰରԠͰ͖Δ Α͏ʹͳͬͨ

Slide 29

Slide 29 text

ߦͬͨ3ͭͷେ͖ͳࢪࡦ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ࣮ߦ؀ڥΛKubernetesʹ CIαʔόΛConcourse CIʹ ෛՙςετπʔϧͷࣗಈԽ

Slide 30

Slide 30 text

࣮ߦ؀ڥΛ,VCFSOFUFTʹ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ ࠾༻ͨ͠ओͳཧ༝(ٕज़໘) ‣ ίϯςφΦʔέετϨʔγϣϯͱͯ͠͸σϑΝΫτ & Production Ready ͳػೳ͕๛෋ ‣ )FMNͱ͍͏KubernetesͷύοέʔδϯάγεςϜ͕͋Δ ‣ αʔόίετ࡟ݮݟࠐΊΔ ‣ ։ൃ͕΋ͷ͘͢͝׆ൃ ‣ LVCFBXT ͷϓϥΠϚϦϝϯςφ !NVNPTIV ͞Μ͕ࣾ಺ʹ͍Δ ‣ ϩʔΧϧ։ൃ؀ڥNJOJLVCF͕͋ͬͯΧϯλϯʹϩʔΧϧͰىಈͰ͖Δ

Slide 31

Slide 31 text

࣮ߦ؀ڥΛ,VCFSOFUFTʹ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ ࠾༻ͨ͠ओͳཧ༝(ӡ༻໘) ‣ ΠϯϑϥνʔϜͱ։ൃνʔϜͷ੹຿͕෼཭Ͱ͖Δ ‣ ΠϯϑϥνʔϜ͸Kubenetesӡ༻ʹઐ೦ • খ͘͞อͯΔ ‣ ։ൃνʔϜ͸ࣗ෼ୡͰϦϦʔεΛঠѲͰ͖Δ

Slide 32

Slide 32 text

Kubernetes͕΋ͨΒͨ͠੹຿ͷ෼཭ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ΞϓϦ + Πϯϑϥ ๏ ඞཁͳAWSϦιʔε͸terraform؅ཧ ‣ ΞϓϦ: PR ࡞੒ ‣ Πϯϑϥ: ϨϏϡʔ & ద༻ security group etc. ΞϓϦ ๏ Kubernetes/Helm APIΛͰ͍ͭͰ΋
 σϓϩΠ(։ൃऀ ≒ ӡ༻ऀ) ๏ ΞϥʔτରԠ΋νʔϜࣗ਎ͰॲཧՄೳ Πϯϑϥ ๏ ҆ఆͨ͠ΠϯϑϥఏڙʹϑΥʔΧε ‣ kubernetes API, Helm API (Tiller) ‣ ϩάऩूج൫, ϝτϦΫεऩूج൫ ๏ kube-aws Λ࢖ͬͯkubernetesΛσϓϩΠ

Slide 33

Slide 33 text

$*αʔόʹ$PODPVSTF$*Λ࠾༻ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ Concourse CIͷಛ௃ ๏ Consourse CIΛಋೖͯ͠Α͔ͬͨ͜ͱ ๏ FalconͷCI/CDύΠϓϥΠϯ

Slide 34

Slide 34 text

$PODPVSTF$*ͱ͸ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork https://concourse.ci

Slide 35

Slide 35 text

$PODPVSTF$*ͷಛ௃ͱϝϦοτ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork Simple and Scalable Dependable Results Integration Streamlined-UI

Slide 36

Slide 36 text

Simple & Scalable (1/4) ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ✓ ύΠϓϥΠϯ͕Ұڃࢢຽ ؂ࢹ औಘ Resource ঢ়ଶͱͯ͠ೖྗ Jobs Tasks ঢ়ଶΛग़ྗ Resource ঢ়ଶΛ֎෦΁อଘ ✓ ఆٛ͸શͯYAML ➡ Pipeline as CodesՄೳ Worker͸Πϯελϯε௥Ճ͢Δ͚ͩ reference: https://concourse.ci

Slide 37

Slide 37 text

Dependable Results (Reproducible Pipeline) (2/4) ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ✓ ύΠϓϥΠϯ͸εςʔτϨε ؂ࢹ औಘ Resource ঢ়ଶͱͯ͠ೖྗ Jobs Tasks ঢ়ଶΛग़ྗ Resource ঢ়ଶΛ֎෦΁อଘ ➡ ࣮ߦʹ࠶ݱੑ͕͋Δ ➡ ϩʔΧϧ։ൃͨ͠ύΠϓϥΠϯΛຊ൪CIαʔόʹͦͷ··σϓϩΠ ✓ Taskͷ࣮ߦ؀ڥ͕ίϯςφͰ෼཭͞Ε͍ͯΔ ➡ Concourseαʔόʹpluginඞཁͳ͍ͷͰ؅ཧָ͕ ➡ ಠࣗimageͰ࣮ߦ؀ڥࣗ༝ࣗࡏ reference: https://concourse.ci

Slide 38

Slide 38 text

Integration, Streamlined-UI (3,4/4) ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ✓ ֦ுՄೳͳResource ➡ ChatWork௨஌΋༰қʹಠ֦ࣗு reference: https://concourse.ci ๏ ϚϧνςφϯτରԠ ๏ ॊೈͳೝূํ๏ ‣ Basicೝূ, OAuth(Github etc.) Integration Streamlined-UI ๏ ϏϧυύΠϓϥΠϯͷঢ়ଶΛ
 ϦΞϧλΠϜͰ؂ࢹՄೳͳUI
 ๏ ೖྗςΩετϘοΫεͷແ͍UI

Slide 39

Slide 39 text

Concourse CIʹͯ͠ಛʹΑ͔ͬͨ͜ͱ(1/2) ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ✓ CIαʔόͷӡ༻͕ඇৗʹָʹͳͬͨ ๏ جຊతʹύΠϓϥΠϯͷఆٛʹશ͕ͯهड़͞ΕΔ ‣ task΍resourceͷఆٛ΋container image ๏ αʔό͸pipelineۦಈ͢Δ͚ͩͰΑ͍ͷͰpluginͷߏ੒؅ཧ͕ඞཁͳ͍ ๏ Databaseͷӡ༻͸ඞཁ͕ͩɺอଘσʔλ͸ओʹύΠϓϥΠϯఆٛ΍ϏϧυཤྺͷΈ ‣ RDSΛ࢖͑͹ओͳӡ༻λεΫ͸Χόʔͯ͠΋Β͑ΔͷͰෛ୲͕গͳ͍ ๏ Production ReadyͳσϓϩΠ͸গ͠஫ҙ͕ඞཁ ‣ ެࣜͰ͸#04)͕ਪ঑ ‣ !NVNPTIV͞ΜͱҰॹʹDPODPVSTFBXTͱ͍͏terraformͷthin wrapperΛ։ൃ&ެ։த

Slide 40

Slide 40 text

ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ✓ ϩʔΧϧ։ൃͨ͠ύΠϓϥΠϯ͕ͦͷ··ຊ൪ʹσϓϩΠͰ͖Δ ๏ ύΠϓϥΠϯ͸ReproducibleͳͷͰɺ֎෦(git, docker registry, kubernetes౳)ʹঢ়ଶΛ ४උ͢Ε͹Ͳ͜Ͱ΋࠶ݱ͕Մೳ
 ๏ ϩʔΧϧ։ൃ؀ڥ΋ॆ࣮ ‣ concourse ͸ ‘vagrant up’ͰΧϯλϯʹϩʔΧϧ؀ڥΛىಈՄೳ ‣ kubernetes ΋ minikube ͱ͍͏ϩʔΧϧ։ൃ؀ڥ͕͋Δ Concourse CIʹͯ͠ಛʹΑ͔ͬͨ͜ͱ(2/2)

Slide 41

Slide 41 text

FalconͷCI/CDύΠϓϥΠϯ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ (JUMBCqPXXJUI&OWJSPONFOU#SBODIFTΛ࠾༻ ‣ ؀ڥຖͷϒϥϯνΛ࡞ͬͯঢ֨ͤ͞ΔϞσϧ ๏ ௨஌͸DIBUXPSLOPUJpDBUJPOSFTPVSDFΛ࣮૷ staging؀ڥ༻branch ຊ൪؀ڥ༻branch ಈ࡞֬ೝޙঢ֨(खಈ) staging؀ڥ ຊ൪؀ڥ push σϓϩΠ σϓϩΠ pull pull ௨஌

Slide 42

Slide 42 text

ෛՙςετπʔϧͷࣗಈԽ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ Ϟνϕʔγϣϯ ආ͚͍ͨ ‣ ։ൃେ٧ΊͰෛՙςετͰύϑΥʔϚϯε͕ग़ͳ͍
 ๏ ͡Ό͊Ͳ͏͢Δʁ ‣ ͜Ε·ͰҎ্ʹΧδϡΞϧʹෛՙςετΛ͔͚ΒΕΔ؀ڥΛ࡞Γ͍ͨ • FullBokར༻͢Δ͜ͱͰߏங͸ࣗಈԽग़དྷ͍͕࣮ͯͨߦࣗಈԽ͕Ϛμͩͬͨ • ݺͼग़͠ʹґଘؔ܎͕͋ΔΑ͏ͳγφϦΦΛGUIͰ࡞੒͢Δͷ͕खؒͩͬͨ

Slide 43

Slide 43 text

๏ Ͳ͏΍ΔʁʢͲ͏΍ͬͨ ‣ Amazon ECS + GatlingΛ࢖ͬͨෛՙςετࣗಈԽπʔϧͷಋೖ
 ๏ Ͳ͏ͳͬͨʁ ‣ ෛՙγφϦΦ͕ίϯςφԽ͞Εͯෛՙ࣮ߦ·ͰࣗಈԽ ‣ ෛՙςετΛ௨ͬͨίʔυͷҡָ͕࣋ʹͳͬͨ ෛՙςετπʔϧͷࣗಈԽ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork

Slide 44

Slide 44 text

๏ 4DBMB"LLBͰ࣮૷͞Εͨෛՙςετπʔϧ ๏ γφϦΦϕʔε ๏ ෳ਺ΤϯυϙΠϯτରԠ ๏ %4-ͰγφϦΦ͕ίʔυͰॻ͚Δ ๏ (6*͔Β΋γφϦΦͭ͘ΕΔ ๏ *OUFSBDUJWFͳ)5.-Ϩϙʔτ (BUMJOHͱ͸ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork

Slide 45

Slide 45 text

(BUMJOHͱ͸ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ Ϟνϕʔγϣϯ ‏͜ͷ෦෼ͷαϙʔτπʔϧΛ࣮૷ ‣ Ϋϥελ࣮ߦ • ෳ਺ΠϯελϯεͰ࣮ߦ͢Ε͹ͳΜͱ͔Ͱ͖Δ ‣ ෳ਺Ϩϙʔτͷaggregation ‣ ͨͩ͠ • Gatling Frontline ͱ͍͏঎༻൛͋Γ • scale-out cookbook ΋ࢀߟʹͳΔ

Slide 46

Slide 46 text

&$4(BUMJOHΛ͔ͭͬͨෛՙςετπʔϧ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ $MPVE'PSNBUJPOςϯϓϨʔτ ‣ ECSΫϥελ+S3όέοτ, ECSλεΫ ๏ Gatling LogΛS3΁ॻ͖ग़ͨ͢ΊͷϕʔείϯςφΠϝʔδ ๏ S3ͷϩά͔Βू໿ϨϙʔτΛੜ੒͢Δπʔϧ 1.ߏங 2.ෛՙ࣮ߦ 3.Ϩϙʔτੜ੒ɾӾཡ ϩάอଘ pull

Slide 47

Slide 47 text

&$4(BUMJOHΛ͔ͭͬͨෛՙςετπʔϧ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ๏ ෛՙγφϦΦΛίϯςφΠϝʔδԽ͓͚ͯ͠͹ز͔ͭίϚϯυΛ
 ୟ͚ͩ͘Ͱෛՙ࣮ߦ͔ΒϨϙʔτ࡞੒·ͰࣗಈԽ
 ๏ ݱஈ֊Ͱ͸಺෦޲͚πʔϧͳͷͰɺকདྷతʹOSSͱͯ͠ެ։༧ఆ 1.ߏங 2.ෛՙ࣮ߦ 3.Ϩϙʔτੜ੒ɾӾཡ ϩάอଘ pull

Slide 48

Slide 48 text

DevOpsվળαϚϦ ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork 'BMDPO։ൃνʔϜ͕ ࣮ߦ؀ڥKubernetes&HelmԽɺCIαʔόConcourse CIԽɺ
 ෛՙࢼݧࣗಈԽπʔϧಋೖʹΑͬͯ ෛՙࢼݧΛ௨ͬͨΞϓϦίʔυΛ ։ൃνʔϜ͚ͩͰɺࣗ਎ͷ޷͖ͳλΠϛϯάͰϦϦʔε Α͏ʹͳͬͨ 'BMDPOγεςϜͷΞϥʔτରԠ·ͰνʔϜͰରԠͰ͖Δ ๏ ͜ͷϓϥΫςΟεΛطଘChatWorkνʔϜʹ֦ॆ ๏ ΠϯϑϥνʔϜΛͰ͖Δ͚ͩখ͘͞อͪଓ͚͍ͨ ࠓ ޙ

Slide 49

Slide 49 text

ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ

Slide 50

Slide 50 text

ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ © ChatWork http://corp.chatwork.com/ja/recruit/ We’re Hiring!!