Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
創業3年のSaaSスタートアップが 規模急拡大に対してアーキテクチャを変革していった話 / S...
Search
showmant
September 28, 2021
Programming
0
900
創業3年のSaaSスタートアップが 規模急拡大に対してアーキテクチャを変革していった話 / Scalebase's architectural transformation
showmant
September 28, 2021
Tweet
Share
More Decks by showmant
See All by showmant
Why Alp Choose Modular monolith Architecture
showmant
2
3.5k
シード期のプロダクト開発について / Product Development in the Seed Phase
showmant
0
1.9k
モジュラモノリスで表現する複雑なドメイン領域と境界 / Expressing complex domain regions and boundaries with 'modular monoliths
showmant
8
12k
SaaS企業をスケールさせるためにScalaを選択した理由と1年間の振り返り / Why Alp Choose Scala To Scale The Application
showmant
2
2k
Other Decks in Programming
See All in Programming
小さく段階的リリースすることで深夜メンテを回避する
mkmk884
2
130
ステートソーシング型イベント駆動の視点で捉えるCQRS+ES
shinnosuke0522
1
320
エンジニア未経験が最短で戦力になるためのTips
gokana
0
210
Coding Experience Cpp vs Csharp - meetup app osaka@9
harukasao
0
110
爆速スッキリ! Rspack 移行の成果と道のり - Muddy Web #11
dora1998
1
150
PHPでお金を扱う時、終わりのない 謎の1円調査の旅にでなくて済む方法
nakka
3
1.2k
JavaOne 2025: Advancing Java Profiling
jbachorik
1
310
フロントエンドテストの育て方
quramy
9
2.5k
Modern Angular:Renovation for Your Applications @angularDays 2025 Munich
manfredsteyer
PRO
0
140
Preact、HooksとSignalsの両立 / Preact: Harmonizing Hooks and Signals
ssssota
1
700
本当だってば!俺もTRICK 2022に入賞してたんだってば!
jinroq
0
250
아직도 SOLID 를 '글'로만 알고 계신가요?
sh1mj1
0
360
Featured
See All Featured
Building an army of robots
kneath
304
45k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.4k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Speed Design
sergeychernyshev
28
860
BBQ
matthewcrist
88
9.5k
Embracing the Ebb and Flow
colly
85
4.6k
Designing Experiences People Love
moore
141
23k
How STYLIGHT went responsive
nonsquared
99
5.4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
31
4.7k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.7k
GitHub's CSS Performance
jonrohan
1030
460k
Transcript
J A P A N | S E P T
E M B E R 2 8 , 2 0 2 1
© 2021, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ۀ3ͷSaaSελʔτΞοϓ͕ نٸ֦େʹରͯ͠ΞʔΩςΫνϟΛมֵ͍ͯͬͨ͠ Speaker Name Shoma Takeo | Alp, Inc. B - 3
Ξϧϓגࣜձࣾ ڞಉۀऀ औక (tw: showmant_ ) 2014ʹגࣜձࣾαΠόʔΤʔδΣϯτʹೖࣾɻಈը ࠂ৴ࣄۀʹ͓͚Δ։ൃऀΛ୲ɻͦͷޙήʔ Ϝࣄۀऀ͚ͷϦλʔήςΟϯάࠂ৴ࣄۀͷถࠃ ࣄۀ্ཱͪ͛ʹ։ൃऀͱͯ͠ैࣄɻ
ΞϧϓͰόοΫΤϯυΤϯδχΞΛओͱͯ͠ɺݱࡏ ։ൃ৫શମͷϚωʔδϝϯτɾ࠾༻Λ୲ɻ झຯϥʔϝϯ(࠷ۙࣽׯ͠ܥɾ୶ྷܥɾೋ)Λ৯ Δ͜ͱɾεϙʔπ؍ઓΛ͢Δ͜ͱ ࣗݾհ - ඌ ਖ਼അ -
© 2021, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ձࣾհ
None
None
© 2021, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ϓϩμΫτհ
SaaS/
© 2021, Amazon Web Services, Inc. or its affiliates. All
rights reserved. SaaS/αϒεΫϦϓγϣϯϏδωεʹ͓͚Δ
None
None
None
None
None
1 30 5 10 1 MRR/ 120
© 2021, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ࠾༻ٕज़
࠾༻ٕज़
© 2021, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ۀॳظͷΞʔΩςΫνϟͷ3ͭͷ
© 2021, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 1. AWS FinTech ϦϑΝϨϯεɾΞʔΩςΫνϟʔΛࢀߟʹͨ͠
• ͳͥϑΟϯςοΫϦϑΝϨϯεΞʔΩςΫνϟʁ • ސ٬ͷࣄۀσʔλٻσʔλΛѻ͏ͨΊηΩϡϦςΟΛҙࣝͨ͠ΞʔΩςΫνϟ͢Δඞཁੑ • BtoBࣄۀͨΊߴ͍ηΩϡϦςΟཁ͕݅ސ٬͔ΒٻΊΒΕΔ߹͕ଟ͍ AWS FinTech ϦϑΝϨϯεɾΞʔΩςΫνϟʔ
• ޙ͔Β࣮ࢪ͢ΔͱɺΞΧϯτΛ͢Δͷେม • ։ൃڥͱຊ൪ڥͰΞΫηεݖݶΛ໌֬ʹ͚ΔϝϦοτ • ۀʹඞཁͳݖݶΛϦεΫ͑ͯͤΔͷͰޮΑ͘ࣄͰ͖Δ • IAMઃఆʹޡΓ͕͋ͬͨͱ͖ʹΞΫηεൣғ֦େͷඃΛ͑ΒΕΔ ಛʹҙͨ͠ϙΠϯτ ຊ
൪ ڥ ͱ ։ ൃ ڥ Ͱ AW S Ξ Χ ϯ τ ͷ
※ݱঢ়ߏͱଟগҟͳΓ·͢
© 2021, Amazon Web Services, Inc. or its affiliates. All
rights reserved. 2. Amazon Elastic Kubernetes Service (Amazon EKS)Λ࠾༻ͨ͠
• k8sͷӡ༻ͷࣝΛ࣋ͬͨϝϯόʔ͕͍͔ͨΒ࠾༻Ͱ͖ͨ • ͯ͢ͷέʔεʹ͓͍ͯAmazon EKS͕༗ޮͰ͋Δͱ͍͏͜ͱͳ͍ • ίϯτʔϥϏϦςΟͷߴ͞ • ࣗࣾͷϢʔεέʔεʹซͤͯࣗ༝ͷߴ͍֦ுՄೳ •
KubernetesͷڊେͳίϛϡχςΟͷࢿݯΛ׆༻Մೳ • ίϛϡχςΟͷੑͷظ • OSSͰߏ͞Ε͍ͯΔτϥϒϧγϡʔςΟϯά͕͍͢͠ • ࠔͬͨͱ͖ʹཔΕΔΦʔϓϯͳใ͕๛ Why Amazon EKS?
• δϣϒΛ୯ൃͰಈ͔͠ɺඪ४ग़ྗͰϩάΛड͚औΓ͍ͨέʔεΛ؆୯ʹ ରԠͰ͖ΔΑ͏ʹͨ͠ • goccy/kubejobΛͬͯɺMain ClassΛࢦఆͯ͠ҙͷScalaόονΛk8sͰىಈͰ͖ΔΑ͏ʹͨ͠ Amazon EKSͷ ख ಈ
࣮ ߦ δ ϣ ϒ
• CronJobͷ੍ • ࣮ߦࢹΛ͢Δඞཁ͕͋Δ • ಉҰεέδϡʔϧͰ2ճ࣮ߦ͞ΕΔ͜ͱ͋ΔͷͰႈʹॲཧΛΉඞཁ͕͋Δ • default namespaceΛ͏ࡍҙ •
applyͷద༻Λޡͬͨ࣌ʹdefault namespaceʹ͋ͨͬͯ͠·͏ ؾΛ͚ͭΔ͜ͱɾΑ͘ͳ͔ͬͨ͜ͱ
© 2021, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ۀ͔Β3ؒͷΞʔΩςΫνϟͷมֵ
• ϞϊϦε => ϞδϡϥϞϊϦεԽ • ϚΠΫϩαʔϏεͷҠߦՄೳ • ϦʔυϞσϧԽରԠ • σʔλϞσϧͷංେԽʹΑΓࢀরύϑΥʔϚϯε͕Լ͕ͬͨͨΊɺࢀর༻ͷϏϡʔϞσϧΛ
όοΫΤϯυΞϓϦέʔγϣϯͰ࡞ • ݁Ռ߹ੑʹଇͬͨඇಉظΞϓϦέʔγϣϯઃܭ • Spark on Kubernetes ͷಋೖ ΞʔΩςΫνϟมֵ֓ཁ
• ϢʔβʔຖͰσʔλྔʹ෯͕͋Δ߹ͷઃܭ • σʔλྔʹىҼͯ͠ॲཧ͕͘ͳΔ՝ʹର͢Δઃܭ ࠓճ͍ͨ͠ςʔϚ
• ސ٬ͷن͕ҧ͏Ϣʔβ ʔ͕ར༻͢ΔͱɺٸܹʹϨ ίʔυͷΦʔμʔ͕มԽ ͢Δ • σʔλنͷେখʹؔΘΒ ͣɺͯ͢ͷϢʔβʔʹૉ Β͍͠ϓϩμΫτମݧΛ ఏڙ͢Δඞཁ͕͋Δ
ςʔϚ1: ϢʔβʔຖͰσʔλྔʹ෯͕͋Δ
• ϓϩμΫτͷੑ্࣭ɺ1ܖͷΦϒδΣΫταΠζ͕େ͖͍ • ॳظͷScalebaseΛར༻͍ͯͨ͠Ϣʔβʔͷσʔλྔ1ΦϒδΣΫτ͋ ͨΓଟͯ͘ ~ 1000Ϩίʔυ • ୯ҰͷॲཧͰѻ͏ΦϒδΣΫτ ~
1000 ఔͩͬͨ ςʔϚ2: σʔλྔʹىҼͯ͠ॲཧ͕͘ͳΔ՝ͷରॲ લ ఏ
• େنσʔλΛҰʹૢ࡞͢Δঢ়گʹͳΔ·ͰɺΦϒδΣΫτΛؾʹ ͤͣɺͯ͢ಉҰτϥϯβΫγϣϯͰॲཧ͍ͯͨ͠ • 10000~ ͷΦϒδΣΫτΛಉ࣌ʹૢ࡞͢Δ߹ʹಉظతॲཧͰϢʔβ ʔମݧ͕ஶ͘͠ଛͳΘΕΔঢ়گʹ • ސ٬ମݧΛٻ͢Δ্Ͱ݁Ռ߹ੑΛՃຯͨ͠ඇಉظΞϓϦέʔγϣϯઃܭʹτϥΠ ςʔϚ2:
σʔλྔʹىҼͯ͠ॲཧ͕͘ͳΔ՝ͷରॲ ՝
© 2021, Amazon Web Services, Inc. or its affiliates. All
rights reserved. CSVϑΝΠϧΛͬͨ༻ྔΠϯϙʔτ ػೳͷઃܭ
• αϒεΫϦϓγϣϯͷதʹAWSͷΑ͏ʹ༻ͨ͠ྔʹԠ͡ٻֹ͕ܾఆ͢ Δϓϥϯମܥ͕͋Δ • ༻ྔΛCSVग़ྗͯ͠ɺμογϡϘʔυ͔ΒΠϯϙʔτ • σʔλྫ) ސ٬AαϒεΫϦϓγϣϯ1ʹରͯ͠ 2021-09-28 ʹ50GBར༻ͨ͠
• ݄ʹ༻ྔΛूܭͯ͠ɺͦͷ߹ܭͰٻֹΛܾఆ ※ API࿈ܞʹΑΔ༻ྔͷΠϯϙʔτػೳૣظఏڙ༧ఆ ༻ྔCSVΠϯϙʔτػೳઆ໌
None
• CSVϑΝΠϧ͕ΞοϓϩʔυͰ͖Δ • μογϡϘʔυܦ༝Ͱͳ͘खಈ (curlίϚϯυ) ͰΞοϓϩʔυͰ͖Δ • 10ߦ ~ 100ສߦͷCSVϑΝΠϧʹ͑ΒΕΔ
Version 1ͷػೳཁ݅
ॳظͷઃܭɾ࣮
• CSVΞοϓϩʔυͷͨͼʹAmazon EMRΫϥελʔͷ Πϯελϯε֬อ ͱ ηοτΞοϓ͢ΔͨΊʹΦʔόʔϔου͕େ͖͍ • େ༰ྔσʔλͰ͋Εڐ༰Ͱ͖Δ • ࣮ࡍʹӡ༻Λ։࢝͢Δͱ100ߦఔͷϑΝΠϧ͕ଟ͘ɺඇػೳཁ݅ͱͯ͠Ξοϓϩʔυྃ·Ͱͷ
͕͔͔࣌ؒΓ͗͢Δ • γεςϜ/Τϥʔϩά͕Amazon EMR্ʹ͔͠ͳ͍ • Πϯϙʔτͷਐḿ͕Amazon EMRͷεςʔλεΛݟΔҎ֎ํ๏͕ͳ͍ ු͔ͼ্͕ͬͨ՝
• CSVϑΝΠϧ͕ΞοϓϩʔυͰ͖Δ͜ͱ • μογϡϘʔυͰϢʔβʔ͕Ξοϓϩʔυ͕Ͱ͖Δ͜ͱ • 10ߦ ~100ສߦΫϥεͷCSVϑΝΠϧʹ͑ΒΕΔ͜ͱ • αΠζͷখ͍͞CSVϑΝΠϧͰΞοϓϩʔυΛ্ͤ͞Δ͜ͱ •
ΠϯϙʔτεςʔλεΛμογϡϘʔυ্͔Β֬ೝͰ͖Δ͜ͱ • Πϯϙʔτ࣌ʹΤϥʔΛμογϡϘʔυͰ֬ೝͰ͖Δ͜ͱ Version 2 Ͱຬ͖ͨ͢ཁ݅
None
• αʔόʔϨεͷϫʔΫϑϩʔΛ؆୯ʹߏஙͰ͖Δ • S3ʹϑΝΠϧ͕ஔ͔Εͨ͜ͱΛىҼʹॲཧΛൃՐͤ͞Δ ▪ S3Πϕϯτͷ্༷ At Least Once Ͱݺͼग़͞ΕΔͨΊɺLambdaͱͷͷ࿈ܞͷ߹ɺॏෳͰॲཧ
͕ͬͯ͠·͏Մೳੑ͕͋Δ – CloudTrailͷར༻ ઃܭͷϙΠϯτ AW S S T E P F U N C T I O N S Λ ར ༻ ͯ͠ ͍ Δ
• CSVϑΝΠϧͷαΠζʹΑͬͯॲཧΛذ • ॲཧ༰ಉ͕ͩ͡ɺํ๏Amazon EMR·ͨSpark on KubernetesΛ͏͔Ͱذ • σʔλ༰ྔ͕খ =>
Spark on Kubernetes • 1ఔͰॲཧ͕ྃ͢Δ • σʔλ༰ྔ͕େ => Amazon EMR Λར༻͢Δ • ࣮ࡍͪ͜ΒΛ͏͜ͱΊͬͨʹͳ͍͕ىಈ·Ͱʹ10Ҏ্͏ • Spot instance ͳͷͰɺΫϥελʔ֬อʹ࣌ؒΛཁ͢Δ͜ͱ͋Δ ઃܭͷϙΠϯτ σ ʔ λ α Π ζ ʹ Α ͬͯ σ ʔ λ ॲ ཧ ํ ๏ Λ ม ߋ Ͱ ͖ Δ Α ͏ ʹ ͠ ͨ
© 2021, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ٻੜػೳʹ͓͚Δ ඇಉظδϣϒཧͷઃܭ
• αϒεΫϦϓγϣϯجຊతʹɺຖ݄ҰఆͷλΠϛϯάͰٻ͕ൃੜ͢Δ • ScalebaseͰͱͱɺαϒεΫϦϓγϣϯ͝ͱʹܾ·ͬͨλΠϛϯάͰٻΛग़͢ػೳΛఏڙͯ͠ ͍Δ • ͔͠͠ɺಛʹBtoBͷαʔϏεͰॴఆͷλΠϛϯάΛͨͣʹٻΛ͢Δ ߹͕ൃੜ͢Δ • ྫ)
ૣΊʹٻΛग़͢͜ͱΛސ٬ʹٻΊΒΕΔ • ྫ) ΞοϓηϧͳͲʹΑΓɺΠϨΪϡϥʔͳλΠϛϯάͰٻ͕ൃੜ͢Δ • ҙͷλΠϛϯάͰͷαϒεΫϦϓγϣϯ͔ΒٻੜΛ࣮ߦͰ͖ΔΈ ͷߏங͕ඞཁ ҙλΠϛϯάͷٻੜػೳ
None
None
None
• ෳͷαϒεΫϦϓγϣϯΛબͯ͠ಉ࣌ʹٻੜ͕Ͱ͖Δ͜ͱ • ඇಉظʹॲཧΛ࣮ߦͰ͖Δ͜ͱ • ٻੜͷਐߦঢ়گ͕μογϡϘʔυͰ֬ೝͰ͖Δ͜ͱ • ࣦഊͨ͠߹ͷΤϥʔΛμογϡϘʔυͰ֬ೝͰ͖Δ͜ͱ • ෳͷδϣϒΛੵΉ͜ͱ͕Ͱ͖Δ͜ͱ
ػೳཁ݅
None
• Why not Amazon SQS? • େྔͷΠϕϯτ͕ྲྀΕͯ͘ΔՄೳੑ͕ߴ͘ɺγϟʔυΛՃ͢Δ͜ͱͰεέʔϧ͕༰қͰ͋Δ • 1ͭͷΠϕϯτͰෳͷॲཧΛΒ͍ͤͨχʔζ͕ࠓޙ͋Γ͏ΔͨΊ •
ྫ) ࠪϩάग़͍ͨ͠ => ࠪϩάΛग़ྗ͢ΔConsumerΛՃ͢Δ͜ͱͰରԠͰ͖Δ ͳͥKinesisΛ࠾༻͔ͨ͠ʁ ઃ ܭ ͷ ϙ Π ϯ τ
• νʔϜͰ͍͘͢͢Δ • ϨίʔυͷॲཧʹίϯγϡʔϚʔͷॲཧ͕ࣦഊͨ͠߹ɺνΣοΫϙΠϯτΛଧͨͳ͍͜ͱͰ ࣦഊ࣌ͷΤϥʔϋϯυϦϯάΛ͍ͯ͘͢͠͠Δ • ϦτϥΠ͠ଓ͚ΔϨίʔυ͕ൃੜͨ͠ࡍɺҎԼͷ3ͭͷ͍ͣΕ͔ͷରԠΛߦ͍ͬͯΔ • ରͷϨίʔυΛਖ਼͘͠ॲཧͰ͖ΔΑ͏ʹίʔυΛमਖ਼ͯ͠ΞϓϦΛσϓϩΠ͢͠ •
ରͷϨίʔυΛਖ਼͘͠ॲཧͰ͖ΔΑ͏DBͷσʔλΛमਖ਼͢Δ • ରͷϨίʔυࣗମʹ͕͋Δ߹ϨίʔυΛεΩοϓ͢Δӡ༻खॱΛ࣮ࢪ͢Δ ॳΊͯͷ Kinesis ࠾༻ ઃ ܭ ͷ ϙ Π ϯ τ
• ಉ͡ϨίʔυΛॏෳͯ͠ίϯγϡʔϚʔ͕ॲཧ͢ΔՄೳੑ͕͋Δ • ຊདྷႈੑΛอͭ͜ͱͰॏෳͷՄೳੑΛߟྀ͖͢ • δϣϒͷঢ়ଶཧͷඞཁੑͱ࣮ͷ߹্ͰɺॏෳΛ͙ख๏ΛऔΓೖΕͨ • Elasticacheʹॲཧͷঢ়گΛӬଓԽ͓ͯ͘͜͠ͱͰॏෳ͍ͯͨ͠Β͘ΈΛऔ͍ͬͯΔ ॏෳνΣοΫʹAmazon ElastiCache
Λ࠾༻ ઃ ܭ ͷ ϙ Π ϯ τ
• KinesisͱElasticacheΛΈ߹ΘͤΔ͜ͱͰɺඇಉظʹδϣϒΛ࣮ߦ͠ͳ ͕ΒɺਐḿΛཧ͢Δ͜ͱ͕Մೳ • Τϥʔ͕ൃੜͨ͠Πϕϯτʹରͯ͠ɺνΣοΫϙΠϯτΛ͚ͭͳ͍͜ͱ ͰΤϥʔରԠ͕༰қʹͳͬͨ • ҰํͰΤϥʔʹͳͬͨϨίʔυ͕ετϦʔϜʹཹͯ͠͠·͏͋Δ • Τϥʔ༻ͷετϦʔϜʹྲྀͯ͠ɺޙଓΛ٧·Βͤͳ͍վળ͕ඞཁ
ྑ͔ͬͨ/վળ ݁ Ռ ߹ ੑ ʹ ଇ ͬ ͨ Ξ ϓ Ϧ έ ʔ γ ϣ ϯ Λ ॳ Ί ͯ ν ʔϜ Ͱ ։ ൃ Ͱ ͖ ͨ
• ΞϓϦέʔγϣϯ͕ྫ֎Λεϩʔͨ͠ͱ͖ʹɺKCLͰϋϯυϦϯά͠ͳ ͍ͱɺνΣοΫϙΠϯτΛ͏ͬͯ͠·͍ɺਖ਼͘͠ॲཧ͞Εͳ͍··ͷΠ ϕϯτ͕ൃੜͯ͠͠·͏ • ॲཧਖ਼ৗॲཧྃޙνΣοΫϙΠϯτ͕ͭ͘Α͏ʹྫ֎࣌νΣοΫϙΠϯτΛଧͨͣʹϦτϥΠ͢Δ ΈΛಋೖͨ͠ • Ϩίʔυͷ͋ͨΓͷαΠζʹ੍ݶ͕͋ΔͷͰαΠζͷେ͖͍ϨίʔυΛ Kinesis
ʹ͛Δ߹ҙ • ੍ݶΛߟྀͯ͠ϦετΛௐ͢Δඞཁ͕͋ͬͨ • ຊདྷ1ཁૉ1Πϕϯτʹ͍͕ͨ͠ɺδϣϒͷதʹෳͷΠϕϯτ͕͋Δ߹ɺ࢝ͱऴΛҙ࣮ࣝͨ͠ ͢Δඞཁ͕͋ΓɺϦετܕʹͨ͠ ͭ·͍ͮͨͱ͜Ζɺۤ࿑ͨ͠ͱ͜Ζ
© 2021, Amazon Web Services, Inc. or its affiliates. All
rights reserved. ͍͞͝ʹ
• Amazon EMR on Amazon Elastic Kubernetes Service (EKS) ͷಋೖ
• EMR Λ༻ͯ͠ɺϑϨʔϜϫʔΫͷΠϯετʔϧͱཧͳͲͷΛݮͰ͖ͦ͏ • Kinesis ͷԠ༻ • Τϥʔ࣌ͷϋϯυϦϯάͱͯ͠ผͷStreamʹΠϕϯτΛૹΔ • ิঈτϥϯβΫγϣϯͷ࣮ ࠓޙɺݕ౼/ઓ͍͖͍ͯͨ͜͠ͱ
© 2021, Amazon Web Services, Inc. or its affiliates. All
rights reserved. WE ARE HIRING.
Thank you! © 2021, Amazon Web Services, Inc. or its
affiliates. All rights reserved.