$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Poiboy改善への道
Search
Daichi Toma
January 23, 2019
Programming
1
940
Poiboy改善への道
Daichi Toma
January 23, 2019
Tweet
Share
More Decks by Daichi Toma
See All by Daichi Toma
さよなら、レガシー画像変換システム
amothic
0
2k
Other Decks in Programming
See All in Programming
レイトレZ世代に捧ぐ、今からレイトレを始めるための小径
ichi_raven
0
480
分散DBって何者なんだ... Spannerから学ぶRDBとの違い
iwashi623
0
140
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
170
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
10
8.9k
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
150
AI駆動開発ライフサイクル(AI-DLC)のホワイトペーパーを解説
swxhariu5
0
1.6k
『実践MLOps』から学ぶ DevOps for ML
nsakki55
2
490
Querying Design System デザインシステムの意思決定を支える構造検索
ikumatadokoro
1
1.2k
How Software Deployment tools have changed in the past 20 years
geshan
0
20k
手軽に積ん読を増やすには?/読みたい本と付き合うには?
o0h
PRO
1
120
しっかり学ぶ java.lang.*
nagise
1
460
TypeScriptで設計する 堅牢さとUXを両立した非同期ワークフローの実現
moeka__c
5
2.6k
Featured
See All Featured
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
Music & Morning Musume
bryan
46
7k
YesSQL, Process and Tooling at Scale
rocio
174
15k
What's in a price? How to price your products and services
michaelherold
246
12k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Docker and Python
trallard
46
3.7k
How to train your dragon (web standard)
notwaldorf
97
6.4k
Into the Great Unknown - MozCon
thekraken
40
2.2k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
Transcript
Poiboyվળͷಓ Matching Dev Meetup#2 - ServerSide January 23, 2019 Daichi
TOMA
About Me ᙛᚸ େઍ @Amothic גࣜձࣾ Diverse ϛΫγΟʹ৽ଔೖࣾ͠ɺmixi ϞϯελʔετϥΠ ΫͷαʔόαΠυ։ൃʹैࣄ
ձࣾͷมߋʹ͍ɺגࣜձࣾDiverseʹస੶ ݱࡏPoiboyͷαʔόαΠυΠϯϑϥͷվળΛ ߦͬͯ·͢
Poiboy • Πέϝϯָ͕͘͠ݟ͔ͭΔϚονϯάΞϓϦ • 2016ϦϦʔε • ձһ100ສਓಥഁ
None
20174݄ Poiboyͷ։ൃʹδϣΠϯɾɹɹ
৽͍͠ΞϓϦͳͷʹ ົʹݹΊ͔͍͠ॴ͕ଟ͍
ؤு͔ͬͯ͢͠ͳ͍
՝ࢁੵΈ
Ͳͷॱ൪Ͱ͍͔ͯ͘͠
վળͷಓ
վળͷಓ 1. (ࢲͷ) ։ൃͷΔؾ͕ͳ͘ͳΔݪҼΛվળ 2. ์ஔ͍ͯ͠ΔͱΠϯγσϯτ͕ى͖ΔՕॴͷ վળ 3. ਝʹ։ൃͰ͖ͳ͍ཧ༝Λվળ
վળͷಓ 1. ։ൃڥΛDockerԽ 2. GitHubҠߦ 3. DBϚΠάϨʔγϣϯπʔϧͷಋೖ 4. ߏཧΛAnsible 5.
ΦϯϓϨϛε͔Βͷ٫ 6. ৫ͷϧʔϧΛม͑Δ (൪֎ฤ)
վળͷಓ 1. ։ൃڥΛDockerԽ 2. GitHubҠߦ 3. DBϚΠάϨʔγϣϯπʔϧͷಋೖ 4. ߏཧΛAnsible 5.
ΦϯϓϨϛε͔Βͷ٫ 6. ৫ͷϧʔϧΛม͑Δ (൪֎ฤ)
։ൃڥͷDockerԽ • ࣮ݩ͔ΒDocker͕ͩͬͨɺ ͳ͔ͥ։ൃڥͷηοτΞοϓʹ1͔͔Δ • DockerΛVMͷΑ͏ʹ͍ͬͯͨͷ͕ݪҼ • DockerVMͰͳ͍ • Ұ൪࠷ॳʹਏ͍ؾ࣋ͪʹͳͬͨͷͰɺ
Ұ൪࠷ॳʹΔ͜ͱʹͨ͠
։ൃڥͷDockerԽ • DockerfileΛ࡞Γ͠ɺDocker Hub ͰࣗಈϏϧυ͢ΔΑ͏ʹ • docker-composeΛ׆༻ɺ1ίϯςφ1αʔϏεʹͳΔΑ͏ʹ ཧ • ϕʔεΠϝʔδʹalpineΛ࠾༻ɺΠϝʔδͷαΠζΛ
3GB → 200MBҎԼʹ (ѹॖαΠζ70MBҎԼ) • ηοτΞοϓʹ1͔͔͍ͬͯͨͷ͕ɺ 15ҎͰऴΘΔΑ͏ʹͳͬͨ
վળͷಓ 1. ։ൃڥΛDockerԽ 2. GitHubҠߦ 3. DBϚΠάϨʔγϣϯπʔϧͷಋೖ 4. ߏཧΛAnsible 5.
ΦϯϓϨϛε͔Βͷ٫ 6. ৫ͷϧʔϧΛม͑Δ (൪֎ฤ)
GitHubͷҠߦ • ݩʑϩʔΧϧڥͷGitLabΛར༻͍ͯͨ͠ • ͋Μ·ΓΠέͯΔUXͰͳ͍ (ݸਓͷΈͰ͢) • GitLabΛࣗલͰϝϯς͢Δίετ͕ߴ͍ • OSSͷίʔυେମGitHubʹ͋Δ
GitHubʹ׳Ε͓ͯ͘ϝϦοτΘΓͱ͋Δ
GitHubͷҠߦ • ઌʹGitLab CI͔ΒCircleCIςετΛҠߦ (దͳDockerԽ͞Ε͍ͯΕ؆୯) • CIΛҠͨ͠λΠϛϯάͰશҠߦ • શࣾͰ։ൃʹར༻ͨ͠ίʔυ͕ࣾ֎ʹެ։͞ΕΔ Α͏ʹͳͬͨ
(ݱࡏɺDiverse ͷ Public Repositoryͷ 23ݸ)
վળͷಓ 1. ։ൃڥΛDockerԽ 2. GitHubҠߦ 3. DBϚΠάϨʔγϣϯπʔϧͷಋೖ 4. ߏཧΛAnsible 5.
ΦϯϓϨϛε͔Βͷ٫ 6. ৫ͷϧʔϧΛม͑Δ (൪֎ฤ)
DBϚΠάϨʔγϣϯπʔϧͷಋೖ • େྔͷsqlϑΝΠϧ͕ϦϙδτϦʹ ஔ͔Ε͍ͯΔ͚ͩͷঢ়ଶͩͬͨ • Ͳ͜·Ͱద༻͔ͨ͠ద༻͍ͯ͠ͳ͍͔ ͔Βͳ͍ • ઈରͦͷ͏ͪࣄނΔ
DBϚΠάϨʔγϣϯπʔϧͷಋೖ • RidgepoleΛಋೖ • SchemafileʹςʔϒϧఆٛΛॻ͍͓ͯ͘ͱ applyίϚϯυͰөͰ͖Δਆπʔϧ • ႈੑ͕͋Γɺ͍͍͢
վળͷಓ 1. ։ൃڥΛDockerԽ 2. GitHubҠߦ 3. DBϚΠάϨʔγϣϯπʔϧͷಋೖ 4. ߏཧΛAnsible 5.
ΦϯϓϨϛε͔Βͷ٫ 6. ৫ͷϧʔϧΛม͑Δ (൪֎ฤ)
ߏཧΛAnsible • ߏཧ͕υΩϡϝϯτʹΑΔਓྗ • Α͋͘Δ͜ͱͳͷͰɺͬ͘͞ͱAnsibleʹ͢Δ • RolesΛ্ख͍͘ɺ࠶ར༻ੑΛߴΊ͓ͯ͘ • ॻ͖ํgeerlingguy͞ΜͷϦϙδτϦΛ ࢀߟʹ͢Δͷ͕ϕετϓϥΫςΟε
(ͩͱࢥ͍ͬͯΔ)
վળͷಓ 1. ։ൃڥΛDockerԽ 2. GitHubҠߦ 3. DBϚΠάϨʔγϣϯπʔϧͷಋೖ 4. ߏཧΛAnsible 5.
ΦϯϓϨϛε͔Βͷ٫ 6. ৫ͷϧʔϧΛม͑Δ (൪֎ฤ)
ΦϯϓϨϛε͔Βͷ٫ • ΦϯϓϨϛεͰಈ͍͍ͯͨ (ਖ਼֬ʹϗεςΟϯάαʔϏε) • ґཔ͢ΔͷʹϝʔϧΛ͛ͯɺ2~3ͭ ඞཁ͕͋Δ • Γ͍ͨ͜ͱΛ͑Δͷ͕େม
ΦϯϓϨϛε͔Βͷ٫ • ਝʹɺ࣮ͦͯ֬͠ʹ։ൃ͢ΔͨΊ AWSҠߦΛܾҙ • ͳΔ͘ϑϧϚωʔδυαʔϏεΛ׆༻͠ ҠߦίετԼ͛Δ
ΦϯϓϨϛε͔Βͷ٫ • Ҡߦ͢Δ͖ͷҰཡ • DNS • Image Server • DB
• memcached • App
ΦϯϓϨϛε͔Βͷ٫ DNS • Route 53Λར༻ • ଞ͔Βͷґଘ͕গͳ͍ͷͰҰ൪༰қ • ͔͠͠ࣄނΔͱ࣮֬ʹࢮ͵ͷͰɺ ςετ͔ͬ͠ΓΔ
ΦϯϓϨϛε͔Βͷ٫ Image Server • ը૾ͷΩϟογϡͱมΛߦ͏ઐ༻ͷαʔό ͕ෳ͋ͬͨ • ΩϟογϡͱมΛ͚ͯߟ͑Δ • Ωϟογϡ
→ CloudFront • ม → DockerԽ͠ɺECSͰӡ༻
ΦϯϓϨϛε͔Βͷ٫ DB • ࣗલӡ༻ͷMySQL͔ΒAuroraҠߦ • AWSͰAuroraΛΘͳ͍ཧ༝͕͋·Γͳ͍
ΦϯϓϨϛε͔Βͷ٫ memcached • ී௨ʹElastiCacheΛ͏
ΦϯϓϨϛε͔Βͷ٫ App • ansibleΛͦͷ··͍͔ͨͬͨͷͰEC2 • ࠓͩͬͨΒFargateʹ͍ͯͨ͠ͱࢥ͍·͢ • ਝͳεέʔϧ͕Մೳʹͳͬͨ (ࠓ·Ͱ ͔͔ͬͨ)
ΦϯϓϨϛε͔Βͷ٫ ͦͷଞ • AWSҠߦͯ͠োରԠ͕ѹతʹݮͬͨ • ίετظ͕ؒඇৗʹ͔͔ΔݟࠐΈͩͬͨͷ ͰɺDirectConnectΘͣਂʹ4࣌ؒ΄Ͳ ఀࢭͯ͠શҠߦͨ͠
վળͷಓ 1. ։ൃڥΛDockerԽ 2. GitHubҠߦ 3. DBϚΠάϨʔγϣϯπʔϧͷಋೖ 4. ߏཧΛAnsible 5.
ΦϯϓϨϛε͔Βͷ٫ 6. ৫ͷϧʔϧΛม͑Δ (൪֎ฤ)
৫ͷϧʔϧΛม͑Δ (൪֎ฤ) • ίϯΣΠͷ๏ଇ γεςϜΛઃܭ͢Δ৫ɺͦͷߏΛͦͬ ͘Γ·ͶͨߏͷઃܭΛੜΈग़ͯ͠͠·͏ • ৫վળ͢Δ͜ͱͰɺγεςϜΛվળͰ͖Δ ˠ ٯίϯΣΠઓུ
৫ͷϧʔϧΛม͑Δ (൪֎ฤ) • ΞδϟΠϧͳ։ൃ͕͚ͨ͠Ε ΞδϟΠϧͳνʔϜʹ͢Δ • ։ൃ͕৫ʹҾͬுΒΕΔ͜ͱଟ͍ • ٕͦͦज़తෛ࠴͕ཷ·ΔݪҼ ৫ͷ͕େ͖͍
վળͷಓ 1. ։ൃڥΛDockerԽ 2. GitHubҠߦ 3. DBϚΠάϨʔγϣϯπʔϧͷಋೖ 4. ߏཧΛAnsible 5.
ΦϯϓϨϛε͔Βͷ٫ 6. ৫ͷϧʔϧΛม͑Δ (൪֎ฤ)
վળͷಓ 1. (ࢲͷ) ։ൃͷΔؾ͕ͳ͘ͳΔݪҼΛվળ 2. ์ஔ͍ͯ͠ΔͱΠϯγσϯτ͕ى͖ΔՕॴͷ վળ 3. ਝʹ։ൃͰ͖ͳ͍ཧ༝Λվળ
վળͷಓ • ্͔ΒཁٻϕʔεͰվળ͕߱Γͯ͘Δ͜ͱ ͋·Γͳ͍ • ࣗࣗͰΛݟ͚ͭɺೳಈతʹղܾͯ͠ ͍͘ඞཁ͕͋Δ • ࠷ۙվળσʔΛઃ͚ͯɺνʔϜΈΜͳͰ ΔΑ͏ʹ͍ͯ͠·͢
Join our team! https://diverse-inc.co.jp/recruit/