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
Poiboy改善への道
Search
Daichi Toma
January 23, 2019
Programming
1
910
Poiboy改善への道
Daichi Toma
January 23, 2019
Tweet
Share
More Decks by Daichi Toma
See All by Daichi Toma
さよなら、レガシー画像変換システム
amothic
0
1.9k
Other Decks in Programming
See All in Programming
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
700
第5回日本眼科AI学会総会_AIコンテスト_3位解法
neilsaw
0
170
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
450
talk-with-local-llm-with-web-streams-api
kbaba1001
0
170
快速入門可觀測性
blueswen
0
330
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
3
1k
暇に任せてProxmoxコンソール 作ってみました
karugamo
1
720
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
선언형 UI에서의 상태관리
l2hyunwoo
0
140
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
The Language of Interfaces
destraynor
154
24k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Unsuck your backbone
ammeep
669
57k
Statistics for Hackers
jakevdp
796
220k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Agile that works and the tools we love
rasmusluckow
328
21k
Code Review Best Practice
trishagee
65
17k
It's Worth the Effort
3n
183
28k
YesSQL, Process and Tooling at Scale
rocio
169
14k
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/