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

スマートフォンゲームでのコンテナ活用 - Container Night 関西コンテナ事例登壇-

スマートフォンゲームでのコンテナ活用 - Container Night 関西コンテナ事例登壇-

2019/10/28 AWS Pop-Up Loft Osakaにて開催されたContainer Nightでの事例登壇の資料です。
https://containernightosaka.splashthat.com/

Hiroshi SUMI

October 28, 2019
Tweet

More Decks by Hiroshi SUMI

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ • ࿯ݟܒࢤʢ͢ΈͻΖ͠ʣ • !ISTN 5XJUUFS'BDFCPPL • ೥݄ΑΓ)BQQZ&MFNFOUTגࣜձࣾ ʹۈ຿ •

    ژ౎ͷΧΧϦΞελδΦॴଐ • ΠϯϑϥάϧʔϓͷϦʔμʔɾΠϯϑϥΤϯδχΞ • લ৬Ͱ͸ήʔϜσΟϨΫλʔɾήʔϜϓϩσϡʔαʔ • झຯ͸ࣗసं • ٳ೔͸๺ઁͷࢁͷதͰ΋͕͍͍ͯ·͢ • "84ར༻ྺ͸೥ • ޷͖ͳ"84αʔϏεɿ"VSPSB ©Happy Elements K.K 2
  2. ࣄۀ಺༰ ϞόΠϧ޲͚ήʔϜΞϓϦͷ։ൃɾӡӦ ձࣾ৘ใ ઃཱ ɿ೥ ݄ ୅දऔక໾ɿ৽Ҫݩج ॴࡏ஍ ɿژ౎෎ژ౎ࢢԼژཱ۠ച੢ொژ౎߃࿨Ϗϧ' ैۀһ

    ɿࣾһ໊ɺֶੜΞϧόΠτ ໊ ೥݄ݱࡏ ฏۉ೥ྸ ɿࡀ ೥݄ݱࡏ ࢿຊۚ ɿ ສԁ ձࣾ֓ཁ 5 ©Happy Elements K.K
  3. ͓࿩͢Δ͜ͱˍ͓࿩͠ͳ͍͜ͱ ຊ೔͓࿩͢Δ͜ͱ • )BQQZ&MFNFOUTͷίϯςφҠߦͷܦҢ • ίϯςφٕज़͓ΑͼαʔϏεͷબ୒ཧ༝ɾൺֱݕূʹ͍ͭͯ • ίϯςφԽͯ͠ྑ͔ͬͨ఺ɾࠔ͍ͬͯΔ͜ͱɺࠓޙͷ՝୊ ຊ೔͓࿩͠ͳ͍͜ͱ •

    ίϯςφٕज़ͷৄࡉɾٕज़৘ใ • "84αʔϏε &$4ͳͲ ͷৄࡉɾٕज़৘ใ ⇛ᖛ͞Μͷ"NB[PO&$4%FFQ%JWFࢿྉ͕͓͢͢ΊͰ͢ʂ ©Happy Elements K.K 8
  4. ݱࡏͷαʔόʔαΠυΞʔΩςΫνϟ ©Happy Elements K.K 12 ©Happy Elements K.K 12 Mobile

    Client LoadBalancer LVS Amazon S3 Web/API UserDB MasterDB Cache1 Cache2 LogAggregate On-premises data center
  5. ৽ΞʔΩςΫνϟʢ༧ఆʣ ©Happy Elements K.K 16 ΫϥΠΞϯτ αʔόʔαΠυ "1* ͦͷଞπʔϧ Amazon

    CloudFront Amazon S3 Ξηοτ഑৴8FC Amazon ECS Amazon EC2 Amazon Aurora Amazon ElastiCache Application Load Balancer AWS CodeBuild AWS CodeDeploy Amazon Linux 2 (ECS Optimized) Amazon ECR Amazon CloudWatch Logs Amazon CloudFront
  6. ৽αʔόʔαΠυΞʔΩςΫνϟʢ༧ఆʣ ©Happy Elements K.K 17 ©Happy Elements K.K 17 CloudFront

    ECS(EC2 Launch type) UserDB (Aurora+Sharding) ALB CloudWatch Logs ElastiCache (Redis) ElastiCache (Memcached) Mobile Client Containers … EC2 Cluster MasterDB (Aurora) Logs AWS Cloud
  7. &$4ͱ&,4 &$4 "NB[PO&MBTUJD$POUBJOFS4FSWJDF • ΫϥελʔͰ %PDLFS ίϯςφΛ؆୯ʹ࣮ߦɺఀࢭɺ؅ཧͰ͖Δඇ ৗʹεέʔϥϒϧͰߴ଎ͳίϯςφ؅ཧαʔϏε &,4 "NB[PO&MBTUJD,VCFSOFUFT4FSWJDF

    • ಠࣗͷ ,VCFSOFUFTίϯτϩʔϧϓϨʔϯΛ্ཱͪ͛ͨΓҡ࣋ͨ͠ Γ͢Δ͜ͱͳ͘ɺ"84Ͱ ,VCFSOFUFT Λ؆୯ʹ࣮ߦͰ͖ΔΑ͏ʹ ͢ΔϚωʔδυܕαʔϏε ©Happy Elements K.K 21
  8. &$4ͱ&,4ͷಛ௃ &$4 • "84ಠࣗͷίϯςφΦʔέετϨʔγϣϯ • "84ωΠςΟϒͳίϯτϩʔϧϓϨʔϯ • γϯϓϧͳઃఆ &,4 •

    ,VCFSOFUFTϕʔεͷίϯςφΦʔέετϨʔγϣϯ • ,VCFSOFUFTͱ͍͏044ͷίϯτϩʔϧϓϨʔϯ • ,VCFSOFUFTΛͦͷ··ར༻ ίϯτϩʔϧϓϨʔϯ͸ͲͪΒ΋"84͕؅ཧ ©Happy Elements K.K 22
  9. ৽αʔόʔαΠυΞʔΩςΫνϟʢ༧ఆʣ ©Happy Elements K.K 23 ©Happy Elements K.K 23 CloudFront

    ECS(EC2 Launch type) UserDB (Aurora+Shardin g) ALB CloudWatch Logs ElastiCac he (Redis) ElastiCache (Memcached ) Mobile Client Containers … EC2 Cluster Master DB (Aurora) Logs AWS Cloud )BQQZ&MFNFOUTͰ͸&$4Λ࠾༻
  10. ىಈλΠϓผͷϝϦοτɾσϝϦοτ ىಈλΠϓ ϝϦοτ σϝϦοτ &$ ىಈλΠϓ εϖοΫͷબ୒ࢶͷ޿͞ ʢΠϯελϯελΠϓʣ (16Λར༻Մೳ ӬଓετϨʔδར༻Մ

    &#4 &$Πϯελϯεͷ؅ཧ͕ඞཁ 'BSHBUF ىಈλΠϓ αʔόʔϨε &$Πϯελϯεͷ؅ཧ͕ෆཁ εϖοΫͷબ୒ࢶ͕&$ΑΓڱ͍ (16͸ར༻ෆՄ ӬଓετϨʔδར༻ෆՄ ©Happy Elements K.K 30
  11. εϚʔτϑΥϯήʔϜͷಛੑͷྫ ©Happy Elements K.K 38 ΠϕϯτʹΑΔτϥϑΟοΫͷ૿Ճ • Πϕϯτͷ։࢝௚ޙɾऴྃલʹ͸ීஈͱൺ΂େ෯ʹΞΫηε૿ • ଞͷ೔ͷಉ࣌ؒͱൺ΂ɺʙഒͷτϥϑΟοΫ

    • Πϕϯτͷ಺༰ʹΑͬͯ΋૿Ճ܏޲͕มΘΔ • Πϕϯτͷछྨ • ొ৔͢ΔΩϟϥΫλʔ • τϥϑΟοΫͷ૿Ճ෯ɾϐʔΫ࣌ͷτϥϑΟοΫ͕ಡΈͮΒ͍ ૉૣ͘εέʔϧͰ͖Δ͜ͱ͕ڧ͘ٻΊΒΕΔ
  12. ݕূ݁Ռͷߟ࡯ • %PDLFSͷΠϝʔδΩϟογϡ • &$͸ΠϯελϯεʹΩϟογϡ͞ΕͨΠϝʔδΛར༻ • 'BSHBUF͸ಛੑ্ΠϝʔδΩϟογϡΛར༻Ͱ͖ͳ͍ • ຖճ&$3͔ΒΠϝʔδΛ16--͢Δ •

    ܰྔͳίϯςφͰ͋Ε͹େ͖ͳࠩ͸ͳ͍͕ɺࠓճͷγεςϜͰ 3VCZPO3BJMTΛར༻͓ͯ͠ΓɺΠϝʔδαΠζ͕ଞͷݴޠͱ ൺֱ͢Δͱେ͖͘ͳΔͨΊɺେ͖͘Өڹͨ͠ ©Happy Elements K.K 43
  13. ৽αʔόʔαΠυΞʔΩςΫνϟʢ༧ఆʣ ©Happy Elements K.K 46 ©Happy Elements K.K 46 CloudFront

    ECS(EC2 Launch type) UserDB (Aurora+Shardin g) ALB CloudWatch Logs ElastiCac he (Redis) ElastiCache (Memcached ) Mobile Client Containers … EC2 Cluster Master DB (Aurora) Logs AWS Cloud )BQQZ&MFNFOUTͰ͸&$ىಈλΠϓΛ࠾༻
  14. ࠓޙͷ՝୊  %PDLFSΠϝʔδͷμΠΤοτ • 3VCZ PO3BJMTͷΠϝʔδ͸େ͖͘ͳΓ͕ͪ  4QPUɺ3FTFSWFEΠϯελϯεͷ׆༻ • ӡ༻͕҆ఆͨ͠Βίετ࡟ݮʹணख

     'BSHBUFͷ׆༻ • ίϯςφىಈ͕࣌ؒվળͯ͘͠ΕΕ͹ɺͥͻ࠶ݕ౼͍ͨ͠ • ࠓޙͷΞοϓσʔτʹظ଴ʂ • ఆظతͳΞοϓσʔτͷݕূΛߦ͍͖͍ͬͯͨ ©Happy Elements K.K 52
  15. ·ͱΊ )BQQZ&MFNFOUTͰͷίϯςφར༻ • αʔϏε͸&$4Λར༻ • γϯϓϧ͞ʹΑΔӡ༻؅ཧɾֶशڭҭίετ࡟ݮ • 'BSHBUFͷར༻͸࢒೦ͳ͕ΒݟૹΓ • αʔόʔϨεʹΑΔ/P0QT͸ͱͯ΋ັྗతʂ

    • ͨͩ͠ɺίϯςφىಈ͕࣌ؒωοΫͱͳΓ&$ىಈλΠϓΛબ୒ • ӡ༻։࢝͸͜Ε͔Βʂ·ͨ஌ݟΛͨΊͯڞ༗͍͖͍ͯͨ͠ʂ ©Happy Elements K.K 54
  16. 56 )BQQZ&MFNFOUTגࣜձࣾͰ͸ɺ Ұॹʹಇ͍ͯ͘ΕΔϝϯόʔΛืूதͰ͢ʂ ˔ ΠϯϑϥΤϯδχΞ ˔ σʔλΤϯδχΞ ˔ ϓϩάϥϚʔʢΞϓϦʣ ˔

    ϓϩάϥϚʔʢαʔόʔαΠυʣ ˔ FUD ೤ڰతʹѪ͞ΕΔίϯςϯπΛɺ ࢲୡͱҰॹʹͭ͘Γ͍ͨ೤ҙͷ͋Δํɺ ͥͻ͝Ԡื͓଴͓ͪͯ͠Γ·͢ʂ ʢৄ͍͠಺༰ʹ͍ͭͯ͸ɺ࠾༻αΠτΛ֬͝ೝ͍ͩ͘͞ʣ ੵۃ࠾༻தͷ৬छ ©Happy Elements K.K