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

日本最大級のファッションDBを支える裏側/how to manage the complex web service

日本最大級のファッションDBを支える裏側/how to manage the complex web service

dots. CONFERENCE SPRING 2016の「複雑高機能なwebサービスを支える技術」での発表内容です。

5b25474e615258ee6421d5b9ef2d3f8e?s=128

Masayuki Imamura

February 28, 2016
Tweet

Transcript

  1. HOW TO MANAGE THE COMPLEX WEBSERVICE ೔ຊ࠷େڃͷϑΝογϣϯ%#Λࢧ͑Δཪଆ VASILY,Inc. @kyuns dots.

    CONFERENCE SPRING 2016
  2. ࠓଜխ޾ @kyuns / Ωϡϯ VASILY,Inc औక໾CTO / Co-Founder 2006೥Yahoo!JAPANʹೖࣾɺYahoo!FASHION΍ XBRANDͳͲͷαʔϏεͷ্ཱͪ͛ͷ։ൃΛ୲౰ɻ

    ϦίϝϯσʔγϣϯͷಛڐͳͲΛऔಘޙɺ 2009೥ʹಠཱɺVASILYΛ૑ۀɻऔక໾CTOʹब೚
  3. ઃཱ: 2008೥11݄ ॴࡏ஍:౦ژ౎ौ୩۠ܙൺण1-18-14 ܙൺणϑΝʔετεΫΤΞ 9F ैۀһ: 50ਓ (ΤϯδχΞ20໊/ΠϯλʔϯؚΉ) ࢿຊۚ: 1ԯ


    ୅දऔక໾: ۚࢁ ༟थ
 औక໾:ࠓଜ խ޾ / ઍ༿ େี
 גओ: ҏ౻஧ςΫϊϩδʔϕϯνϟʔζ / KDDIגࣜձࣾ άϩʔϏεɾΩϟϐλϧɾύʔτφʔζ / GMOϕϯνϟʔύʔτφʔζ /גࣜձࣾߨஊࣾ
  4. .BU[͞Μ͸ٕज़ސ໰

  5. άϩʔεϋοΫຊͰ·ͨ͠

  6. ೔ຊதͷϑΝογϣϯ ECαΠτͷ঎඼σʔλΛܝࡌ ೔ຊ࠷େڃͷঁͷࢠͷͨΊͷ ϑΝογϣϯΞϓϦʮΞΠίϯʯ ձһ਺ 250ສਓ Google Play ϕετɾΦϒ 2015

  7. ࣄۀΛࢧ͑Δຊப J20/ 1$41J04"OESPJE &$αΠτΫϩʔϥʔ
 ঎඼"1* ޿ࠂ഑৴ࣄۀ

  8. "HFOEB ೔ຊ࠷େڃͷϑΝογϣϯ%#Λࢧ͑Δཪଆ ෳࡶͳ8FCαʔϏεΛ։ൃ͢Δ࣌ʹ
 ໾ཱͭઃܭ΍ख๏Λ஌ͬͯ΋Β͏

  9. w "1*Λࢧ͑Δٕज़ w ΫϩʔϥʔΛࢧ͑Δٕज़ w σʔλ෼ੳΛࢧ͑Δٕज़ ͭͷࣄྫ͔ΒֶͿϙΠϯτ

  10. ͭͷࣄྫ͔ΒֶͿϙΠϯτ w "1*Λࢧ͑Δٕज़ w ΫϩʔϥʔΛࢧ͑Δٕज़ w σʔλ෼ੳΛࢧ͑Δٕज़

  11. "1*Λࢧ͑Δٕज़

  12. J20/ͷ"1* ΞΠςϜ ίʔσΟωʔτ γϣοϓ Ϣʔβʔ ϒϥϯυ ͋ΒΏΔϑΝογϣϯ৘ใΛ֨ೲͨ͠"1* 8FCJ04"OESPJE"1*ఏڙઌ͔Βར༻͞Ε͍ͯΔ શͯͷϩδοΫ͕٧·ͬͨ.POPMJUIJDͳ"1* Ҏ্ͷ"1*ΤϯυϙΠϯτ͕͋ΔͨΊɺ

    ී௨ʹ࡞ΔͱΧΦεʹͳΔ
  13. ڊେ8FCΞϓϦέʔγϣϯΛࢧ͑ΔϙΠϯτ w ΞϓϦέʔγϣϯͷઃܭ w .JDSP4FSWJDFT w %PDLFS

  14. ΞϓϦέʔγϣϯͷઃܭ

  15. 3BJMTΞϓϦέʔγϣϯઃܭͷίπ w 3BJMTΛӡ༻͍ͯ͠Δͱ.PEFM͕ංେԽ͕ͪ͠ʹͳΔ w ղܾࡦͱͯ͠$POUSPMMFSͱ.PEFMͷؒʹ4FSWJDF૚Λಋೖ
 ˠ%PNBJO%SJWFO%FTJHO 3BJMT  w .PEFMͷத͔Βผͷ.PEFMΛݺͼग़͍ͯ͠Δ΋ͷͳͲΛ

    ආ͚Δ IUUQRJJUBDPNKPPPFFJUFNTGEDEEGCGFC
  16. 4FSWJDF૚ͷҐஔ͚ͮ

  17. MicroServices

  18. MicroServices w ڊେͳ"1*͔ΒαʔϏεͱͯ͠੾Γग़ͤΔ෦෼Λ3&45 "1*ͱͯ͠੾Γ཭͢ w ͦΕͧΕͷػೳʹ͋ͬͨ04΍ݴޠΛબͿ͜ͱ͕Ͱ͖Δ w શͯΛ.JDSP4FSWJDFԽ͢Ε͹͍͍ͱ͍͏Θ͚Ͱ͸ͳ͍
 ύϑΥʔϚϯεͱͷτϨʔυΦϑ
 ద੾ͳίϯϙʔωϯτͷΈ੾Γ཭͢΂͖

  19. ྫ: ը૾͔ΒͷΞΠςϜ൑ఆAPI w Ϋϩʔϥʔ͔Βར༻͍ͯ͠Δ(PPHMFͷ$MPVE 7JTJPO"1*ϥΠΫͳࣗ࡞"1* w ϕʔεͱͯ͠1ZUIPOΛ༻͍͍ͯΔͷͰ6CVOUV 1ZUIPO 'MBTLͰ3&45"1*ͱͯ͠ߏங

  20. %PDLFSͷ׆༻

  21. ޿ࠂ഑৴αʔόʔͰͷ%PDLFSࣄྫ EC2 SVCZ OHJOY NBDLFSFM qVFOUE AWS ElasticBeanstalk + Docker

    Auto Scaling ΠϯελϯεͷதͰ֤%PDLFSίϯςφΛMJOL
  22. &MBTUJD#FBOTUBML %PDLFS ϦΫΤετ਺΍࣌ؒଳʹԠͯ͡Πϯελϯε਺Λ૿ݮͰ͖Δ
 Φʔτεέʔϧ 
 ֤ϛυϧ΢ΤΞ͕%PDLFSίϯςφʹͳ͍ͬͯΔͨΊ
 ϛυϧ΢ΣΞͷݸผΞοϓσʔτָ͕ SVCZ OHJOY NBDLFSFM

    qVFOUE SVCZ OHJOY NBDLFSFM qVFOUE SVCZͷίϯςφͷΈߋ৽ %PDLFSͷಛੑΛ׆͔͢
  23. w "1*Λࢧ͑Δٕज़ w ΫϩʔϥʔΛࢧ͑Δٕज़ w σʔλ෼ੳΛࢧ͑Δٕज़ ͭͷࣄྫ͔ΒֶͿϙΠϯτ

  24. ΫϩʔϥʔΛࢧ͑Δٕज़

  25. ঎඼Ϋϩʔϥʔ αΠτҎ্ɺສҎ্ͷΞΠςϜΛ ຖ೔Ϋϩʔϧ Ձ֨ɺࡏݿ৘ใͳͲΛऔಘ

  26. ΫϩʔϥʔΛࢧ͑ΔϙΠϯτ w పఈతͳࣗಈԽ
 ΧςΰϦ൑ఆɺϒϥϯυ൑ఆɺը૾൑ఆɺը૾੾Γൈ͖ɺλ ά෇͚ɺ஋ஈมߋݕ஌ɺ͋ΒΏΔ෦෼Λࣗಈతʹ൑ఆॲཧ͢ Δ࢓૊ΈɺࣗಈԽΛపఈ w పఈతͳޮ཰Խ
 ΤϯδχΞͰͳͯ͘΋ΫϩʔϥʔΛ࡞ΕΔ(6*πʔϧΛ಺੡

  27. ࣗಈԽେྔͷϑΝογϣϯΞΠςϜ෼ྨ w ΧςΰϦͷ൑ఆ΍λά෇͚ΛࣗಈԽ
 ਺ສޠͷϑΝογϣϯࣙॻ ػցֶश w ࠷ۙͰ͸$IBJOFSΛ༻͍ͯਂ૚ֶश ʢσΟʔϓϥʔχϯάʣΛߦ͍ը૾͔ ΒΧςΰϦ൑ఆ΋ߦ͍ͬͯΔ IUUQXXXTMJEFTIBSFOFU5BLFIJSP4IJP[BLJJRPO

    ϫϯϐʔε Ֆฑ τοϓε
  28. σΟʔϓϥʔχϯάͰΧςΰϦ෼ྨ IUUQUFDIWBTJMZKQFOUSZGBTIJPOEFFQMFBSOJOH

  29. Ϋϩʔϥʔ࡞੒πʔϧ w Ϋϩʔϥʔ࡞੒Λޮ཰Խ͢Δࣾ಺πʔϧ w ߲໨நग़ͷͨΊͷ91"5) จࣈྻૢ࡞ ਖ਼نදݱ౳ΛೖྗՄೳ w ೖྗσʔλͷϓϨϏϡʔػೳ΋౥ࡌ w

    ೉͍͠αΠτ͸SVCZͷίʔυ΋ϚʔδՄೳ
  30. w "1*Λࢧ͑Δٕज़ w ΫϩʔϥʔΛࢧ͑Δٕज़ w σʔλ෼ੳΛࢧ͑Δٕज़ ͭͷࣄྫ͔ΒֶͿϙΠϯτ

  31. σʔλ෼ੳΛࢧ͑Δٕज़

  32. ϋΠϒϦουΫϥ΢υ ϝΠϯͷαʔϏεఏڙΠϯϑϥ σʔλ෼ੳج൫ͱͯ͠ͷΠϯϑϥ

  33. BigQuery RDS Log Aggregater GoogleDataProc MongoDB GoogleDrive (SpreadSheet) API Server

    Web Server fluentd fluentd fluentd J20/ͷσʔλղੳج൫ iOS/Android Puree 1VSFF౳Λར༻ͯ͠ड͚औͬͨϩά͸શͯqVFOEܦ༝Ͱ#JH2VFSZ΁ 1VSFFIUUQUFDIMJGFDPPLQBEDPNFOUSZ
  34. ϩάσʔλετϨʔδ w શͯͷσʔλ΍ϩά͸#JH2VFSZʹอଘ IUUQUFDIWBTJMZKQFOUSZCJHRVFSZ@EBUB@QMBUGPSN

  35. BigQuery (PPHMF͕ఏڙ͢ΔϑϧϚωʔδυσʔλ෼ੳαʔϏε
 ѹ౗తʹ؆୯଎͍͍҆ w ΞϓϦ1$εϚϗͷߦಈϩά w Ϛελʔ%#σʔλ GSPN3%4  w

    Ϋϩʔϥʔͷશϩά w ϦίϝϯυΤϯδϯͷܭࢉ݁Ռ ͋ΒΏΔϩάΛͱʹ͔͘อଘ
  36. ؾʹͳΔྉۚ w ετϨʔδ(# w ετϦʔϛϯάΠϯαʔτ. w ΫΤϦྔ5# 
 J20/ͷ݄ؒར༻ঢ়گ w

    ෼ੳΫΤϦྔ5# w ࢖༻ετϨʔδྔ5# ࣌఺
  37. ෳࡶͳσʔλ෼ੳ͸5BCMFBVͰ #JH2VFSZ΍3%4΋ϦΞϧλΠϜʹ௚઀ѻ͑Δ ࡉ͔͍σʔλ෼ੳ͸5BCMFBV%FTLUPQ ࣾ಺Ͱͷσʔλڞ༗ʹ͸5BCMFBV4FSWFS

  38. ෳࡶͳσʔλܭࢉ͸%BUBQSPDͰ (PPHMF͕ఏڙ͢Δ)BEPPQ΍4QBSLͷϚωʔδυαʔϏε J20/Ͱ͸4QBSL :"3/ Λ༻͍ͨϦίϝϯσʔγϣϯͷ ܭࢉʹར༻ ࣗલͰ)BEPPQΫϥελΛ૊·ͳ͍͍ͯ͘ͷͰศར σʔλιʔεͱͯ͠#JH2VFSZΛར༻Մೳ

  39. ࣗಈԽෳࡶͳόονॲཧ͸"JS'MPXͰ "JSCOC͕ࣾ։ൃͨ͠όονॲཧ࣮ߦϑϨʔϜϫʔΫ ෳ਺ͷδϣϒͷґଘؔ܎ͷղܾ΍ ϦτϥΠॲཧͳͲΛ͏·͘΍ͬͯ͘ΕΔ IUUQTHJUIVCDPNBJSCOCBJSqPX

  40. ·ͱΊ w "1*Λࢧ͑Δٕज़
 %%%.JDSP4FSWJDFT%PDLFS w ΫϩʔϥʔΛࢧ͑Δٕज़
 ࣗಈԽޮ཰Խ w σʔλ෼ੳΛࢧ͑Δٕज़
 ($1#JH2VFSZ5BCMFBV%BUBQSPD

  41. 8F`SF)JSJOH 7"4*-:͸ςΫϊϩδʔͰ ϑΝογϣϯͷੈքΛม͑Α͏ͱ͍ͯ͠ΔձࣾͰ͢ νϟϨϯδͯ͠Έ͍ͨਓΛ ͓଴͓ͪͯ͠Γ·͢ IUUQWBTJMZKQ ઈࢍ৽نࣄۀ։ൃதʂ