$30 off During Our Annual Pro Sale. View Details »

ChatWorkの新メッセージングシステムを支える技術

 ChatWorkの新メッセージングシステムを支える技術

AWS Summit 2017 Tokyo, Dev Dayで登壇した際の資料です。

かとじゅん
PRO

June 09, 2017
Tweet

More Decks by かとじゅん

Other Decks in Programming

Transcript

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  5. ΞʔΩςΫνϟ࡮৽ͷഎܠ
    ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़
    © ChatWork
    ๏ ։ൃ೥ʙɻ಺੡'8Λ༻͍ͨࣾ಺޲͚ΞϓϦέʔγϣϯɻ

    طଘγεςϜʹ૬৐Γɻ೥ʹެ։αʔϏεԽ
    ๏ ঎ػΛಀ͞ͳ͍ͨΊʹͻͨ͢Β։ൃͷ೔ʑɻͦͷ୅ঈͱٕͯ͠ज़తෛ࠴͕ੵΈ্͕ͬͨɻ

    ૿͑ଓ͚Δσʔλͱෛՙ͸ࣾ಺γεςϜΛϕʔεʹͨ͠ΞʔΩςΫνϟͰ͸ݶքΛܴ͑ͨ
    ๏ ૯ίʔυྔສߦҎ্ɻڞ௨ॲཧΛߦ͏த৺తͳΫϥε͸ΫϥεͰສߦ

    View Slide

  6. ৽ΞʔΩςΫνϟ΁ͷಓͷΓ
    ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़
    © ChatWork
    ๏ ͦͷޙ41P'ରࡦͳͲͷվળ͸ܧଓతʹߦ͕ͬͨࠜຊରࡦ͸Ͱ͖ͳ͔ͬͨɻ

    ํ਑Λม͑ͯγεςϜΛ࡮৽͢Δ͜ͱʹͳͬͨ

    ๏ γεςϜ࡮৽ʹ޲͚ͯɺ࠷ॳʹϥΠϒϚΠάϨʔγϣϯϓϥϯ ӈਤ
    Λબ
    ୒ͨ͠ɻ
    ‣ طଘγεςϜ΁ͷӨڹΛ࠷খݶʹ͢ΔͨΊʹ
    w طଘγεςϜͷίʔυΛۃྗมߋ͠ͳ͍
    w ແఀࢭϚΠάϨʔγϣϯ
    ‣ είʔϓ͸νϟοτϧʔϜʹؔ͢Δ͢΂ͯͷػೳ ϧʔϜ ϝοηʔδ
    λεΫ ϑΝΠϧ ίϯλΫτ

    ๏ Ұ೥൒΄Ͳ։ൃΛଓ͚͕ͨɺ༷ʑͳ໰୊ ϓϩδΣΫτϚωδϝϯτɺε
    ίʔϓɺύϑΥʔϚϯεͳͲ
    ͕ى͖ɺϓϩδΣΫτΛ࠶ىಈͨ͠ʜ

    ๏ ࠜຊతʹઓུΛม͑ͯ৽͍͠ΞʔΩςΫνϟʹҠߦ͢Δ͜ͱʹͨ͠

    ͦΕ͔Β໿೥ؒͷ։ൃظؒΛܦͯɺେن໛ͳσʔλҠߦΛߦ͍ɺ
    ೥຤ʹແࣄϦϦʔε

    View Slide

  7. ৽ΞʔΩςΫνϟͷํ਑
    ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़
    © ChatWork
    ๏ Ϗδωεʹ࠷΋Өڹͷେ͖͍ϝοηʔδͷΈͷείʔϓʹߜΔ
    ‣ ϝοηʔδ਺ͷਪҠ͸ɺ೥ԯ݅‎೥ԯ݅‎೥ԯ݅
    ‣ ϝοηʔδ਺͸ɺࢦ਺ؔ਺తʹٸ૿͍ͯ͠Δ
    ๏ อकੑΛҡ࣋͢ΔͨΊʹɺυϝΠϯۦಈઃܭ͸ܧଓ

    ๏ ϦΞΫςΟϒγεςϜ "LLB
    Λϕʔεʹͨ͠$234&4Λ࠾༻
    ‣ ߴεϧʔϓοτɾ௿ϨΠςϯγΛ࣮ݱɻ

    ݱߦγεςϜͷഒఔ౓ͷಉ࣌઀ଓ਺ͱεϧʔϓοτΛ࣮ݱ͢Δ͜ͱ
    ‣ ՄೳͳݶΓো֐ʹରͯࣗ͠ݾճ෮ྗΛ࣋ͭ
    ๏ ௿ίετͰ͋Δ͜ͱ γεςϜن໛ͱίετͷ૬͕ؔઢܗະຬ

    ๏ ίϯηϓτݕূ 10$
    Λඞਢͱ͢Δ

    ΫωϏϯϑϨʔϜϫʔΫͷෳࡶͳ՝୊΁ͷରԠ ୳ࠪ‎஌֮‎ରԠͷΞδϟΠϧϓϩηε

    View Slide

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

    ๏ $24ΛΞʔΩςΫνϟʹద༻ͨ͠ͷ͕$234

    View Slide

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

    View Slide

  10. ॳظͷ$234&4Ϟσϧ 10$࣌

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

    View Slide

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

    View Slide

  12. ίϯϙʔωϯτߏ੒
    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Λίʔϧ͢Δɻ

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  17. &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

    View Slide

  18. -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

    View Slide

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

    View Slide

  20. "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

    View Slide

  21. εʔύʔϏδϣϯώΤϥϧΩʔͷ࣮૷ύλʔϯ
    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

    View Slide

  22. εʔύʔϏδϣϯώΤϥϧΩʔͷ࣮૷ύλʔϯ
    ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़
    © ChatWork
    ๏ ઌ΄Ͳͱಉ͡ॲཧϑϩʔ͕ͩɺதؒʹεʔύʔόΠβΛڬΈࢠ
    ΞΫλʔΛӅṭ͢Δ࣮૷ύλʔϯ
    ๏ εʔύʔόΠβ͸୯ͳΔੜ੒΍؂ಜͰ͸ͳ͘ɺؒ઀ࢀরͱ͠
    ͯɺ͢΂ͯͷϝοηʔδΛ୯ʹಁաతʹϑΥϫʔυ͢Δɻ

    εʔύʔόΠβ͸ࢠΞΫλʔΛऴྃͨ͠Γɺ֎෦ͷΞΫλʔͱ
    ͸ແؔ܎ʹ৽͍͠΋ͷΛੜΈग़ͨ͠ΓͰ͖Δ

    ๏ ઌͷྫͱൺ΂ͯϝοηʔδϑϩʔͱώΤϥϧΩʔͷΪϟοϓ͕
    ͳ͍
    Database
    DbWriter
    DbWriterSupervisor
    LogFileWatcher
    Supervisor
    Row
    LogProccessor
    LogProccessorSupervisor
    LogFile
    LogFileWatcher
    NewFile
    ग़య: Akka in ActionΑΓฤू, Raymond Roestenburg, Rob Bakker, Rob Williams

    View Slide

  23. 4QBSSPX'PSXBSEFSͷεʔύʔϏδϣϯώΤϥϧΩʔ
    ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़
    © ChatWork
    ๏ 3֊૚ͷώΤϥϧΩʔɻதؒͷεʔύʔόΠβ͸
    Exponential BackOffΛαϙʔτ͢Δ

    ๏ ԼҐ૚ͷΞΫλʔ͸͍ͭͰ΋Ϋϥογϡͯ͠΋Α͍ɻ
    ࢠΞΫλʔͰྫ֎͕ൃੜ͢Δͱ࠶ىಈΛ໋͡Δɻ
    #BDL0⒎ޙʹϓϩηεΛ࠷ॳ͔Β΍Γ௚͢

    ๏ "1*ίʔϧ΋ಉ༷ʹ#BDL0⒎͍͕ͯͨ͠,BGLBͷηο
    γϣϯλΠϜλΠϜΞ΢τ͕ൃੜ͢ΔͨΊɺ#BDL0⒎
    ͠ͳ͍Α͏ʹͨ͠ɻશମͷॲཧϑϩʔʹӨڹΛ༩͑ͳ
    ͍Α͏ʹ#BDL0⒎͢Δ͜ͱ͕ٻΊΒΕΔ
    ໰୊͕ى͖
    ͨͷͰɺ
    BackOffΛ
    ഇࢭͨ͠

    View Slide

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

    View Slide

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

    View Slide

  26. Ϟνϕʔγϣϯ
    ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़
    © ChatWork
    ๏ ChatWork಺ʹେ͖ͳϝοηʔδϯά༻ͷαϒγεςϜΛ

    ߏங͢Δ(miroserviceతʹ੾Γग़͢)ͳΒ

    ๏ ͜Ε·ͰͷΠϯϑϥӡ༻՝୊΋ղܾ͍ͨ͠
    ‣ ओͳର৅ɿςετɾϦϦʔεύΠϓϥΠϯɺ࣮ߦΠϯϑϥ
    ๏ ։ൃνʔϜ͕ࣗ਎ͰϦϦʔεαΠΫϧΛप͠ɺ

    ӡ༻·ͰͰ͖ΔΑ͏ͳঢ়گΛ࡞ͬͯ%FW0QTΛՃ଎͍ͤͨ͞

    View Slide

  27. ࠔ͍ͬͯͨ͜ͱ
    ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़
    © ChatWork
    ๏ ݱߦγεςϜͷΠϯϑϥߏ੒௒֓ཁ
    ‣ EC2ϕʔε(php)ͷαʔό܈
    ‣ JenkinsʹΑΔσϓϩΠδϣϒ܈
    ‣ CapistranoΛ࢖ͬͨσϓϩΠ
    ‣ FabricʹΑΔઃఆ؅ཧ

    ๏ ࠔ͍ͬͯͨ͜ͱ
    ‣ ϦϦʔε࡞ۀ͕׬શʹࣗಈԽ͞Ε͓ͯΒͣϦϦʔε͕େม
    ‣ σϓϩΠϑϩʔͷվम͕େม$*αʔόͷӡ༻ෛՙߴ͍
    ‣ ෛՙࢼݧͷख͕ؒ੯͍͠ ΋ͬͱΧδϡΞϧʹ΍Γ͍ͨ

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  32. Kubernetes͕΋ͨΒͨ͠੹຿ͷ෼཭
    ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़
    © ChatWork
    ΞϓϦ + Πϯϑϥ
    ๏ ඞཁͳAWSϦιʔε͸terraform؅ཧ
    ‣ ΞϓϦ: PR ࡞੒
    ‣ Πϯϑϥ: ϨϏϡʔ & ద༻
    security
    group
    etc.
    ΞϓϦ
    ๏ Kubernetes/Helm APIΛͰ͍ͭͰ΋

    σϓϩΠ(։ൃऀ ≒ ӡ༻ऀ)
    ๏ ΞϥʔτରԠ΋νʔϜࣗ਎ͰॲཧՄೳ
    Πϯϑϥ
    ๏ ҆ఆͨ͠ΠϯϑϥఏڙʹϑΥʔΧε
    ‣ kubernetes API, Helm API (Tiller)
    ‣ ϩάऩूج൫, ϝτϦΫεऩूج൫
    ๏ kube-aws Λ࢖ͬͯkubernetesΛσϓϩΠ

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    ϦΞϧλΠϜͰ؂ࢹՄೳͳUI

    ๏ ೖྗςΩετϘοΫεͷແ͍UI

    View Slide

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

    View Slide

  40. ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़
    © ChatWork
    ✓ ϩʔΧϧ։ൃͨ͠ύΠϓϥΠϯ͕ͦͷ··ຊ൪ʹσϓϩΠͰ͖Δ
    ๏ ύΠϓϥΠϯ͸ReproducibleͳͷͰɺ֎෦(git, docker registry, kubernetes౳)ʹঢ়ଶΛ
    ४උ͢Ε͹Ͳ͜Ͱ΋࠶ݱ͕Մೳ

    ๏ ϩʔΧϧ։ൃ؀ڥ΋ॆ࣮
    ‣ concourse ͸ ‘vagrant up’ͰΧϯλϯʹϩʔΧϧ؀ڥΛىಈՄೳ
    ‣ kubernetes ΋ minikube ͱ͍͏ϩʔΧϧ։ൃ؀ڥ͕͋Δ
    Concourse CIʹͯ͠ಛʹΑ͔ͬͨ͜ͱ(2/2)

    View Slide

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

    View Slide

  42. ෛՙςετπʔϧͷࣗಈԽ
    ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़
    © ChatWork
    ๏ Ϟνϕʔγϣϯ ආ͚͍ͨ

    ‣ ։ൃେ٧ΊͰෛՙςετͰύϑΥʔϚϯε͕ग़ͳ͍

    ๏ ͡Ό͊Ͳ͏͢Δʁ
    ‣ ͜Ε·ͰҎ্ʹΧδϡΞϧʹෛՙςετΛ͔͚ΒΕΔ؀ڥΛ࡞Γ͍ͨ
    • FullBokར༻͢Δ͜ͱͰߏங͸ࣗಈԽग़དྷ͍͕࣮ͯͨߦࣗಈԽ͕Ϛμͩͬͨ
    • ݺͼग़͠ʹґଘؔ܎͕͋ΔΑ͏ͳγφϦΦΛGUIͰ࡞੒͢Δͷ͕खؒͩͬͨ

    View Slide

  43. ๏ Ͳ͏΍ΔʁʢͲ͏΍ͬͨ

    ‣ Amazon ECS + GatlingΛ࢖ͬͨෛՙςετࣗಈԽπʔϧͷಋೖ

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

    View Slide

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

    View Slide

  45. (BUMJOHͱ͸
    ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़
    © ChatWork
    ๏ Ϟνϕʔγϣϯ ‏͜ͷ෦෼ͷαϙʔτπʔϧΛ࣮૷

    ‣ Ϋϥελ࣮ߦ
    • ෳ਺ΠϯελϯεͰ࣮ߦ͢Ε͹ͳΜͱ͔Ͱ͖Δ
    ‣ ෳ਺Ϩϙʔτͷaggregation
    ‣ ͨͩ͠
    • Gatling Frontline ͱ͍͏঎༻൛͋Γ
    • scale-out cookbook ΋ࢀߟʹͳΔ

    View Slide

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

    View Slide

  47. &$4(BUMJOHΛ͔ͭͬͨෛՙςετπʔϧ
    ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़
    © ChatWork
    ๏ ෛՙγφϦΦΛίϯςφΠϝʔδԽ͓͚ͯ͠͹ز͔ͭίϚϯυΛ

    ୟ͚ͩ͘Ͱෛՙ࣮ߦ͔ΒϨϙʔτ࡞੒·ͰࣗಈԽ

    ๏ ݱஈ֊Ͱ͸಺෦޲͚πʔϧͳͷͰɺকདྷతʹOSSͱͯ͠ެ։༧ఆ
    1.ߏங
    2.ෛՙ࣮ߦ
    3.Ϩϙʔτੜ੒ɾӾཡ
    ϩάอଘ pull

    View Slide

  48. DevOpsվળαϚϦ
    ChatWork ͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़
    © ChatWork
    'BMDPO։ൃνʔϜ͕
    ࣮ߦ؀ڥKubernetes&HelmԽɺCIαʔόConcourse CIԽɺ

    ෛՙࢼݧࣗಈԽπʔϧಋೖʹΑͬͯ
    ෛՙࢼݧΛ௨ͬͨΞϓϦίʔυΛ
    ։ൃνʔϜ͚ͩͰɺࣗ਎ͷ޷͖ͳλΠϛϯάͰϦϦʔε
    Α͏ʹͳͬͨ
    'BMDPOγεςϜͷΞϥʔτରԠ·ͰνʔϜͰରԠͰ͖Δ
    ๏ ͜ͷϓϥΫςΟεΛطଘChatWorkνʔϜʹ֦ॆ
    ๏ ΠϯϑϥνʔϜΛͰ͖Δ͚ͩখ͘͞อͪଓ͚͍ͨ

    ޙ

    View Slide

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

    View Slide

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

    View Slide