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

創業3年のSaaSスタートアップが 規模急拡大に対してアーキテクチャを変革していった話 / S...

showmant
September 28, 2021

創業3年のSaaSスタートアップが 規模急拡大に対してアーキテクチャを変革していった話 / Scalebase's architectural transformation

showmant

September 28, 2021
Tweet

More Decks by showmant

Other Decks in Programming

Transcript

  1. J A P A N | S E P T

    E M B E R 2 8 , 2 0 2 1
  2. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ૑ۀ3೥ͷSaaSελʔτΞοϓ͕ ن໛ٸ֦େʹରͯ͠ΞʔΩςΫνϟΛมֵ͍ͯͬͨ͠࿩ Speaker Name Shoma Takeo | Alp, Inc. B - 3
  3. Ξϧϓגࣜձࣾ ڞಉ૑ۀऀ औక໾ (tw: showmant_ ) 2014೥ʹגࣜձࣾαΠόʔΤʔδΣϯτʹೖࣾɻಈը ޿ࠂ഑৴ࣄۀʹ͓͚Δ։ൃ੹೚ऀΛ୲౰ɻͦͷޙήʔ Ϝࣄۀऀ޲͚ͷϦλʔήςΟϯά޿ࠂ഑৴ࣄۀͷถࠃ ࣄۀ্ཱͪ͛ʹ։ൃऀͱͯ͠ैࣄɻ

    ΞϧϓͰ͸όοΫΤϯυΤϯδχΞΛओͱͯ͠ɺݱࡏ͸ ։ൃ૊৫શମͷϚωʔδϝϯτɾ࠾༻Λ୲౰ɻ झຯ͸ϥʔϝϯ(࠷ۙ͸ࣽׯ͠ܥɾ୶ྷܥɾೋ࿠)Λ৯΂ Δ͜ͱɾεϙʔπ؍ઓΛ͢Δ͜ͱ ࣗݾ঺հ - ஛ඌ ਖ਼അ -
  4. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. SaaS/αϒεΫϦϓγϣϯϏδωεʹ͓͚Δ
  5. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ૑ۀॳظͷΞʔΩςΫνϟͷ3ͭͷ޻෉
  6. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 1. AWS FinTech ϦϑΝϨϯεɾΞʔΩςΫνϟʔΛࢀߟʹͨ͠
  7. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 2. Amazon Elastic Kubernetes Service (Amazon EKS)Λ࠾༻ͨ͠
  8. • k8sͷӡ༻ͷ஌ࣝΛ࣋ͬͨϝϯόʔ͕͍͔ͨΒ࠾༻Ͱ͖ͨ • ͢΂ͯͷέʔεʹ͓͍ͯAmazon EKS͕༗ޮͰ͋Δͱ͍͏͜ͱ͸ͳ͍ • ίϯτʔϥϏϦςΟͷߴ͞ • ࣗࣾͷϢʔεέʔεʹซͤͯࣗ༝౓ͷߴ͍֦ுՄೳ •

    KubernetesͷڊେͳίϛϡχςΟͷࢿݯΛ׆༻Մೳ • ίϛϡχςΟͷ੒௕ੑ΁ͷظ଴ • OSSͰߏ੒͞Ε͍ͯΔ෼τϥϒϧγϡʔςΟϯά͕͠΍͍͢ • ࠔͬͨͱ͖ʹཔΕΔΦʔϓϯͳ৘ใ͕๛෋ Why Amazon EKS?
  9. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ૑ۀ͔Β3೥ؒͷΞʔΩςΫνϟͷมֵ
  10. • ϞϊϦε => ϞδϡϥϞϊϦεԽ • ϚΠΫϩαʔϏε΁ͷҠߦ΋Մೳ • ϦʔυϞσϧԽରԠ • σʔλϞσϧͷංେԽʹΑΓࢀরύϑΥʔϚϯε͕Լ͕ͬͨͨΊɺࢀর༻ͷϏϡʔϞσϧΛ

    όοΫΤϯυΞϓϦέʔγϣϯ಺Ͱ࡞੒ • ݁Ռ੔߹ੑʹଇͬͨඇಉظΞϓϦέʔγϣϯઃܭ • Spark on Kubernetes ͷಋೖ ΞʔΩςΫνϟมֵ֓ཁ
  11. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. CSVϑΝΠϧΛ࢖ͬͨ࢖༻ྔΠϯϙʔτ ػೳͷઃܭ
  12. • αϒεΫϦϓγϣϯͷதʹ͸AWSͷΑ͏ʹ࢖༻ͨ͠ྔʹԠ͡੥ٻֹ͕ܾఆ͢ Δϓϥϯମܥ͕͋Δ • ࢖༻ྔΛCSVग़ྗͯ͠ɺμογϡϘʔυ͔ΒΠϯϙʔτ • σʔλྫ) ސ٬A͸αϒεΫϦϓγϣϯ1ʹରͯ͠ 2021-09-28 ʹ50GBར༻ͨ͠

    • ݄຤ʹ࢖༻ྔΛूܭͯ͠ɺͦͷ߹ܭͰ੥ٻֹΛܾఆ ※ API࿈ܞʹΑΔ࢖༻ྔͷΠϯϙʔτػೳ͸ૣظఏڙ༧ఆ ࢖༻ྔCSVΠϯϙʔτػೳઆ໌
  13. • CSVϑΝΠϧ͕ΞοϓϩʔυͰ͖Δ͜ͱ • μογϡϘʔυͰϢʔβʔ͕Ξοϓϩʔυ͕Ͱ͖Δ͜ͱ • 10ߦ ~100ສߦΫϥεͷCSVϑΝΠϧʹ଱͑ΒΕΔ͜ͱ • αΠζͷখ͍͞CSVϑΝΠϧͰ͸Ξοϓϩʔυ଎౓Λ޲্ͤ͞Δ͜ͱ •

    ΠϯϙʔτεςʔλεΛμογϡϘʔυ্͔Β֬ೝͰ͖Δ͜ͱ • Πϯϙʔτ࣌ʹΤϥʔΛμογϡϘʔυͰ֬ೝͰ͖Δ͜ͱ Version 2 Ͱຬͨ͢΂͖ཁ݅
  14. • CSVϑΝΠϧͷαΠζʹΑͬͯॲཧΛ෼ذ • ॲཧ಺༰͸ಉ͕ͩ͡ɺํ๏͸Amazon EMR·ͨ͸Spark on KubernetesΛ࢖͏͔Ͱ෼ذ • σʔλ༰ྔ͕খ =>

    Spark on Kubernetes • 1෼ఔ౓Ͱॲཧ͕׬ྃ͢Δ • σʔλ༰ྔ͕େ => Amazon EMR Λར༻͢Δ • ࣮ࡍͪ͜ΒΛ࢖͏͜ͱ͸Ίͬͨʹͳ͍͕ىಈ·Ͱʹ10෼Ҏ্࢖͏ • Spot instance ͳͷͰɺΫϥελʔ֬อʹ࣌ؒΛཁ͢Δ͜ͱ΋͋Δ ઃܭͷϙΠϯτ σ ʔ λ α Π ζ ʹ Α ͬͯ σ ʔ λ ॲ ཧ ํ ๏ Λ ม ߋ Ͱ ͖ Δ Α ͏ ʹ ͠ ͨ
  15. © 2021, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ੥ٻੜ੒ػೳʹ͓͚Δ ඇಉظδϣϒ؅ཧͷઃܭ
  16. • αϒεΫϦϓγϣϯ͸جຊతʹ͸ɺຖ݄ҰఆͷλΠϛϯάͰ੥ٻ͕ൃੜ͢Δ • ScalebaseͰ͸΋ͱ΋ͱɺαϒεΫϦϓγϣϯ͝ͱʹܾ·ͬͨλΠϛϯάͰ੥ٻΛग़͢ػೳΛఏڙͯ͠ ͍Δ • ͔͠͠ɺಛʹBtoBͷαʔϏεͰ͸ॴఆͷλΠϛϯάΛ଴ͨͣʹ੥ٻΛ͢Δ৔ ߹͕ൃੜ͢Δ • ྫ)

    ૣΊʹ੥ٻΛग़͢͜ͱΛސ٬ʹٻΊΒΕΔ • ྫ) ΞοϓηϧͳͲʹΑΓɺΠϨΪϡϥʔͳλΠϛϯάͰ੥ٻ͕ൃੜ͢Δ • ೚ҙͷλΠϛϯάͰͷαϒεΫϦϓγϣϯ͔Β੥ٻੜ੒Λ࣮ߦͰ͖Δ࢓૊Έ ͷߏங͕ඞཁ ೚ҙλΠϛϯάͷ੥ٻੜ੒ػೳ
  17. • Why not Amazon SQS? • େྔͷΠϕϯτ͕ྲྀΕͯ͘ΔՄೳੑ͕ߴ͘ɺγϟʔυΛ௥Ճ͢Δ͜ͱͰεέʔϧ͕༰қͰ͋Δ఺ • 1ͭͷΠϕϯτͰෳ਺ͷॲཧΛ૸Β͍ͤͨχʔζ͕ࠓޙ͋Γ͏ΔͨΊ •

    ྫ) ؂ࠪϩά΋ग़͍ͨ͠ => ؂ࠪϩάΛग़ྗ͢ΔConsumerΛ௥Ճ͢Δ͜ͱͰରԠͰ͖Δ ͳͥKinesisΛ࠾༻͔ͨ͠ʁ ઃ ܭ ͷ ϙ Π ϯ τ
  18. • ΞϓϦέʔγϣϯ͕ྫ֎Λεϩʔͨ͠ͱ͖ʹɺKCLͰϋϯυϦϯά͠ͳ ͍ͱɺνΣοΫϙΠϯτΛ͏ͬͯ͠·͍ɺਖ਼͘͠ॲཧ͞Εͳ͍··ͷΠ ϕϯτ͕ൃੜͯ͠͠·͏ • ॲཧਖ਼ৗॲཧ׬ྃޙνΣοΫϙΠϯτ͕ͭ͘Α͏ʹྫ֎࣌͸νΣοΫϙΠϯτΛଧͨͣʹϦτϥΠ͢Δ ࢓૊ΈΛಋೖͨ͠ • Ϩίʔυͷ͋ͨΓͷαΠζʹ੍ݶ͕͋ΔͷͰαΠζͷେ͖͍ϨίʔυΛ Kinesis

    ʹ౤͛Δ৔߹͸஫ҙ • ੍ݶΛߟྀͯ͠ϦετΛௐ੔͢Δඞཁ͕͋ͬͨ • ຊདྷ͸1ཁૉ1Πϕϯτʹ͍͕ͨ͠ɺδϣϒͷதʹෳ਺ͷΠϕϯτ͕͋Δ৔߹ɺ࢝఺ͱऴ఺Λҙ࣮ࣝͨ͠ ૷͢Δඞཁ͕͋ΓɺϦετܕʹͨ͠ ͭ·͍ͮͨͱ͜Ζɺۤ࿑ͨ͠ͱ͜Ζ
  19. • Amazon EMR on Amazon Elastic Kubernetes Service (EKS) ͷಋೖ

    • EMR Λ࢖༻ͯ͠ɺϑϨʔϜϫʔΫͷΠϯετʔϧͱ؅ཧͳͲͷ޻਺Λ࡟ݮͰ͖ͦ͏ • Kinesis ͷԠ༻ • Τϥʔ࣌ͷϋϯυϦϯάͱͯ͠ผͷStreamʹΠϕϯτΛૹΔ • ิঈτϥϯβΫγϣϯͷ࣮૷ ࠓޙɺݕ౼/௅ઓ͍͖͍ͯͨ͜͠ͱ
  20. Thank you! © 2021, Amazon Web Services, Inc. or its

    affiliates. All rights reserved.