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
クラウドとオンプレ / on the Cloud or Premises
Search
Harukasan
PRO
March 12, 2015
Technology
5
8.9k
クラウドとオンプレ / on the Cloud or Premises
pixiv SPRING BOOTCAMP 2015 講義資料
Harukasan
PRO
March 12, 2015
Tweet
Share
More Decks by Harukasan
See All by Harukasan
pixivを支える技術 / 技育CAMPアカデミア
harukasan
PRO
3
380
20240401 新卒研修 - ピクシブにおける技術領域
harukasan
PRO
1
690
ピクシブのコンテンツ配信基盤技術 / pixiv TECH SALON
harukasan
PRO
5
5.4k
Goにおける画像ファイル処理 / golang.tokyo #19
harukasan
PRO
7
6.5k
WebRTC動画をトランスコードする / Transcoding video streams from WebRTC
harukasan
PRO
5
1.5k
ImageFluxを支えるリモート開発 / 20171202
harukasan
PRO
2
1.8k
YAPC::Fukuoka 前夜祭LT / Yet Another Pawoo Commit logs
harukasan
PRO
0
2.9k
YAPC::Fukuoka lunch session
harukasan
PRO
1
3k
マストドン会議: Pawoo / Mastodon Kaigi2
harukasan
PRO
2
430
Other Decks in Technology
See All in Technology
『Firebase Dynamic Links終了に備える』 FlutterアプリでのAdjust導入とDeeplink最適化
techiro
0
120
Application Development WG Intro at AppDeveloperCon
salaboy
0
190
AGIについてChatGPTに聞いてみた
blueb
0
130
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.7k
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.2k
Evangelismo técnico: ¿qué, cómo y por qué?
trishagee
0
360
Platform Engineering for Software Developers and Architects
syntasso
1
520
強いチームと開発生産性
onk
PRO
35
11k
TanStack Routerに移行するのかい しないのかい、どっちなんだい! / Are you going to migrate to TanStack Router or not? Which one is it?
kaminashi
0
600
オープンソースAIとは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
9
1.1k
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
4
230
Python(PYNQ)がテーマのAMD主催のFPGAコンテストに参加してきた
iotengineer22
0
500
Featured
See All Featured
Statistics for Hackers
jakevdp
796
220k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Site-Speed That Sticks
csswizardry
0
28
Scaling GitHub
holman
458
140k
Docker and Python
trallard
40
3.1k
KATA
mclloyd
29
14k
Speed Design
sergeychernyshev
25
620
Become a Pro
speakerdeck
PRO
25
5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Being A Developer After 40
akosma
87
590k
Writing Fast Ruby
sferik
627
61k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Transcript
ΫϥυͱΦϯϓϨ Shunsuke Michii / Harukasan 2015-03-11
Harukasan / Shunsuke Michii • 2012ʹ৽ଔͱͯ͠ΠϯϑϥνʔϜʹଐ • ίϯςϯπ৴Λ͡Ίͱͯ͠αʔϏεશମͷج൫Λ୲ • αʔϏεج൫͚ͩͰͳ͘σʔλղੳج൫ͷߏஙͳͲ
• ٕज़ܥࡶࢽͷࣥචͳͲ ϐΫγϒגࣜձࣾɹΠϯϑϥνʔϜ
Agenda • WebαʔϏεʹ͓͚ΔΠϯϑϥετϥΫνϟ • ΫϥυͱΦϯϓϨϛεͷҧ͍ • ΫϥελϦϯάͱΦʔέετϨʔγϣϯ
WebαʔϏεʹ͓͚Δ ΠϯϑϥετϥΫνϟ • ͦͦΠϯϑϥετϥΫνϟͱ • ΤϯδχΞϦϯάεέʔϧ͠ͳ͍ • ΠϯϑϥνʔϜͱ • ΠϯϑϥετϥΫνϟεέʔϧ͢Δ
Q1 ͋ͳ͕ͨWebαʔϏεΛઃܭ͢ΔͳΒ ͲͷΑ͏ͳߏΛߟ͑Δ͔ʁ
Application Application Database Cache Storage Application Application Load Balancer DNS
? ? ? ? ? ? ? ? Application Application
Database Cache Storage Application Application Load Balancer DNS
Server Server Server Server Server Local Network Internet Server Server
/ Appliance Server Server Application Application Database Cache Storage Application Application Load Balancer DNS
Heroku Add-on Add-on Add-on Application Add-on DNS Database Cache Storage
EC2 EC2 RDS ElastiCache S3 EC2 EC2 ELB Route53 Database
Cache Storage Application Application Application Application DNS Load Balancer
DNS
ͦͦ ΠϯϑϥετϥΫνϟͱ • αʔϏεΛӡ༻͢Δ্Ͱɺ߃ৗతʹඞཁͱͳΔج൫ • αʔϏεΛߏங͢Δ্ͰͱͳΔͷ • ࣗͰΒͳ͍ͱ͜Ζ
ΠϯϑϥετϥΫνϟ ͦΕࣗՁΛੜ·ͳ͍ • ຊʹՁ͕͋Δͷӡ༻͍ͯ͠ΔαʔϏεɺ͍҃ αʔϏε͕ఏڙ͍ͯ͠ΔͷͰ͋Δ • Πϯϑϥͱͯ͠ԿΛબ͢Δ͔ɺͲ͏͍͏ߏʹ͢ Δ͔ͱ͍ͬͨߏஙϊϋ͕ՁʹͳΔ͜ͱ͋Δ ͕ɺΠϯϑϥࣗମՁʹͳΒͳ͍
Ͳ͜ͰՁΛੜΉ͔ • ΠϯϑϥΑΓ্ͷϨΠϠʔͰՁΛੜΈग़͢ • ʢΤϯδχΞͱͯ͠ʣͲ͜ͰՁΛग़͔͕͢ॏཁ
Contents σβΠϯɾίʔσΟϯά ίϯςϯπࣥච DNS value value
DNS Contents Heroku Add-on Database Add-on Cache Add-on Storage Application
σβΠϯɾίʔσΟϯά ઃܭɾ։ൃ γεςϜઃܭ ίϯςϯπࣥච value value value value
ΤϯδχΞϦϯά εέʔϧ͠ͳ͍ • ࣗͷೳྗ͕ٸʹ100ഒʹͳΔ͜ͱͳ͍ • ʢΤϯδχΞͱͯ͠ʣͲ͜ͰՁΛग़͔͕͢ॏཁ
εέʔϧ͠ͳ͍ͷΛ࡞Βͳ͍ • 1ਓ͔͠ఏڙ͠ͳ͍αʔϏεͦΕҎ্ͷՁΛੜΊ ͳ͍ • ਓεέʔϧ͠ͳ͍͕ʢ͠ͳ͍ͷͰʣɺ༻͢Δਓ ͕ଟ͍΄Ͳ1ਓʹఏڙ͢ΔαʔϏεͷίετԼ͕Δ • εέʔϧ͢ΔϚʔέοτ͕͋Δ͔
ΠϯϑϥνʔϜͱ • αʔϏεΠϯϑϥΛ։ൃऀʹఏڙ͢Δ • ͬͯΔ͜ͱ֤ࣾΒΒ • ΠϯϑϥνʔϜࣗମ͕Πϯϑϥ
ΠϯϑϥνʔϜ Application
ʢۃΛݴ͏ͱʣࣗͷཱͪҐஔΑΓ ԼͷϨΠϠʔͯ͢Πϯϑϥ • ΠϯϑϥΤϯδχΞ͔ΒݟͨΒDCۀऀΠϯϑϥ • DCۀऀ͔ΒΈͯిؾࣄۀऀΠϯϑϥ • ։ൃऀ͔ΒΈͯΠϯϑϥΤϯδχΞΠϯϑϥ • ܦӦऀ͔ΒΈͯܧଓత։ൃΠϯϑϥʢʹࣄۀج൫ʣ
ΠϯϑϥετϥΫνϟ εέʔϧ͢Δ • ΠϯϑϥετϥΫνϟαʔϏεͱͯ͠εέʔϧ͢Δ • ύλʔϯԽͰ͖Δʹεέʔϧ͢Δ • εέʔϧ͢Ε͢Δ΄ͲίετϝϦοτ͕ग़Δ • ڊਓͷݞʹΔ
IaaS (Infrastructure as a Service) • WebαʔϏεͷΠϯϑϥετϥΫνϟΛαʔϏεͱ ͯ͠ఏڙ͢Δ • දతͳαʔϏεʹAWSɺGCPɺSoftLayerͳͲ
• ࣗࣾͷΠϯϑϥετϥΫνϟج൫ΛαʔϏεͱͯ͠ ఏڙ͍ͯ͠Δ
XaaS (X as a Service) • ͳΜͱ͔as a ServiceͱݺΕΔͷશ෦Πϯϑϥ ͳͷͰ·ͱΊͯIaaSͰΑ͍
• ͲͷϨΠϠʔ·Ͱఏڙ͍ͯ͠Δ͔Θ͔Βͳ͘ͳΔʢൺ ֱͰ͖ͳ͘ͳΔʣͷͰPaaSΈ͍ͨͳݴ༿͕ΘΕΔ
WebαʔϏεʹ͓͚Δ ΠϯϑϥετϥΫνϟ • ࣗͰΒͳ͍ͱ͜Ζ • ʢΤϯδχΞͱͯ͠ʣͲ͜ͰՁΛग़͔͕͢ॏཁ • ΠϯϑϥΛαʔϏεʹ͢Δͱεέʔϧ͢Δ ·ͱΊ:
break
IaaSͱΦϯϓϨ • ΦϯϓϨͱʁ • IaaSͱΦϯϓϨͷҧ͍
ΦϯϓϨϛε: On-Premises • ༁͢Δͱ"ߏʹ"ͱͳΔ • ͱͱࣾʹΠϯϑϥετϥΫνϟΛઃஔ͢Δ͜ ͱΛ͍ࣔͯͨ͠
ͳͥΦϯϓϨͱݴ͏ͷ͔ • Ϋϥυͷରٛޠ͕ͳ͔ͬͨ • Macͷରٛޠͱͯ͠ͷPC
ݱͷΦϯϓϨϛεڥ Ϋϥυʹ͍ۙ • ࣗࣾߏʹαʔό͓͍ͯΔͱ͜ΖͳΜͯ·Ε • ଏʹ”ΦϯϓϨ”ͱݺΕΔͱ͖αʔόIDCʹઃஔ ͯ͋͠Δ • ੈͷதͷ΄ͱΜͲͷΦϯϓϨ”ͳΜͪΌͬͯΦϯϓ Ϩϛε”ʹͳͬͯΔ
ຊͷΦϯϓϨϛε ͳΜͪΌͬͯΦϯϓϨϛε ઃஔॴ ࣗࣾDC ϗεςΟϯά αʔόઃஔɾཧ ࣗࣾ IDCɾϕϯμʔ ௐୡ ࣗࣾ
ࣗࣾɾϕϯμʔ ిݯ ࣗࣾܖ IDC ରࡦ ࣗࣾͰઃܭ IDC ճઢ ઐ༻ճઢ IDC ճઢࢹ ࣗࣾ IDC
Q2 IaaSͱΦϯϓϨϛεͷେ͖ͳҧ͍ͱʁ
IaaSͱΦϯϓϨͷҧ͍ • ͚ࣗͩͰ͏͔ɺΈΜͳͰ͏͔ • ͍ํ͕ҧ͏ͷͰ՝ۚମܥ͕େ͖͘ҟͳΔ
ΦϯϓϨͷௐୡ Load Infrastructure • ෛՙʹ߹ΘͤͯௐୡܭըΛཱͯΔ ௐୡλΠϛϯά ↓ ௐୡλΠϛϯά ↓ ௐୡλΠϛϯά
↓
Waste ΦϯϓϨͷௐୡ Load • ෛՙʹ߹ΘͤͯௐୡܭըΛཱͯΔ ௐୡλΠϛϯά ↓ ௐୡλΠϛϯά ↓ ௐୡλΠϛϯά
↓
ΦϯϓϨେม • ͏ͷશͯࣗͰ༻ҙࣗ͠Ͱӡ༻͢Δ • εέʔϧ͠ͳ͍ • ઌΛಡ·ͳ͍ͱ͍͚ͳ͍
IaaSͷௐୡ Load • ෛՙʹ߹Θͤͯ૿ݮͰ͖Δʢཧʣ
IaaSͷௐୡ Load • ෛՙʹ߹Θͤͯ૿ݮͰ͖Δʢݱ࣮ʣ
IaaS͚ͬ͜͏େม • ݁ہࣗͰεέʔϦϯά͢ΔΑ͏ʹ͠ͳ͚Εࣗಈ Ͱεέʔϧ͠ͳ͍ʢͪΐͬͱੲͷʣ • ୯Ձ͚ͩͰݟΕߴ͍
CPU୯Ձͷൺֱ • ʢඇެ։ʣ
ωοτϫʔΫ୯Ձͷൺֱ • ʢඇެ։ʣ
ίετͷҧ͍ • ୯Ձ͚ͩͰݟΕIaaSͷํ͕ߴͦ͏ʹݟ͑Δ • ࣮ࡍʹӡ༻ʹ͔͔Δਓ݅අɺDCΠϯϑϥʹ͔͔Δ ྉۚͳͲ͍ΖΜͳݻఆඅ͕͔͔Δ • େͷ߹IaaSͷํ͕εέʔϧϝϦοτͰ҆͘ͳΔ • ݻఆඅ͕খ͘͞ݟ͑Δ΄Ͳεέʔϧ͢ΕΦϯϓϨ
Ͱͬͨํ͕͍҆
IaaSͱΦϯϓϨ • ΦϯϓϨશ͕ͯࣗલͰͳ͍ʢͨΓલʣ • IaaSεέʔϧ͢Δ͜ͱͰϝϦοτΛग़͍ͯ͠Δ • CPU࣌ؒͰΈΔͱ͔ͳΓΑ͘ͳ͖ͬͯͨ • ωοτϫʔΫ͚ͬ͜͏ߴ͍ ·ͱΊ:
break
ΫϥελϦϯάͱ ΦʔέετϨʔγϣϯ • ΫϥελϦϯάͱΦʔέετϨʔγϣϯ • ͳͥΫϥελϦϯά͍ͨ͠ͷ͔ • ίϯςφΫϥελϦϯά
ΫϥελϦϯάͱ • ଟͷϦιʔεΛ1ͭͷϦιʔεͱͯ͠͏ • Ͱ͔͍Πϯελϯεߴ͍͠ɺSPOFʢ୯Ұোʣ ʹͳΔ • εέʔϦϯά͢Δʹ͍҆ϦιʔεΛͨ͘͞Μฒͯ 1ͭͷϦιʔεʹͯ͠Θͳ͍ͱ͍͚ͳ͍
ΦʔέετϨʔγϣϯͱ • Φʔέετϥͷԋํ๏ɺసͯ͡ฤɺ৫ԽΛ ࢦ͢୯ޠʹͳͬͨ • γεςϜ/ϛυϧΣΞͷࣗಈతͳߏཧɺσϓϩ Πϝϯτͷ͜ͱΛࢦ͢
ΫϥελϦϯά͍ͨ͠ • αʔϏεͷنΛ༧ଌ͢Δͷ͍͠ • ༻ҙ͍ͯ͠ΔΠϯϑϥΛ͙͢ʹೖ͍ͨ͠ • Ϋϥελશମͷ͏ܾͪ·ׂͬͨ߹ͷϦιʔεΛׂΓ ͍ͯͨ
ΦϯϓϨͷௐୡ Load • ෛՙʹ߹ΘͤͯௐୡܭըΛཱͯΔ ௐୡλΠϛϯά ↓ ௐୡλΠϛϯά ↓ ௐୡλΠϛϯά ↓
ʢ෮शʣ
Server Server Server Server Application Application Application Load balancer Application
Application
ΫϥελϦϯά͢ΔͨΊʹ ίϯςφΛ͏ • εέʔϧ͢ΔͨΊʹɺΞϓϦέʔγϣϯɺϛυϧΣ ΞɺઃఆͳͲ༷ʑͳͷΛσϓϩΠͯ͠ಈ࡞͢ΔΑ͏ ʹ͠ͳ͚ΕͳΒͳ͍ • ίϯςφ͝ͱσϓϩΠ͢Εྑ͍ =ΦʔέετϨʔγϣϯ͕؆୯
Docker • ίϯςφཧπʔϧ • DockerfileΛॻ͚ͩ͘ͰίϯςφΛϏϧυͰ͖Δ • ͍·ͷͱ͜ΖσϑΝΫτελϯμʔυ
dockerhub build push pull Dockerfile deployment Image
ͳͥίϯςφʹ͍ͨ͠ͷ͔ • ґଘؔΛύοέʔδϯά͍ͨ͠ • ։ൃऀ͕ϛυϧΣΞͷґଘؔΛཧ͢Δ͜ͱ͕ Ͱ͖ΔΑ͏ʹͳΔ • ίϯςφΛ͏ͱ͜Ε·ͰΠϯϑϥͩͬͨͷ͕ ΠϯϑϥͰͳ͘ͳΔ
Infrastructure Application
Infrastructure Application Container
ίϯςφԽ͞ΕΔͱԿ͕ى͜Δ͔ • ΠϯϑϥͷϨΠϠʔ͕1ͭԼ͕Δ • OSͷύοέʔδཧෆཁʹͳΔ • ίϯςφ͝ͱʹࢹ͕ඞཁʹͳΔ
CoreOS • ίϯςφϗετʹ࠷దԽ͞ΕͨLinuxσΟετϦ Ϗϡʔγϣϯ • systemdʹΑΔίϯςφͷཧͱEtcdɺFleetdͱ͍ͬ ͨΫϥελϦϯάɺΦʔέετϨʔγϣϯπʔϧ͔Β ߏ͞ΕΔ • ࣗಈతͳηΩϡϦςΟΞοϓσʔτ
ΦʔέετϨʔγϣϯ͕Γͳ͍ • ͍ͭ͘ίϯςφΛσϓϩΠ͢Δ͔ • ίϯςφؒͷ૬ޓଓͲ͏͢Δ͔ • ͲͷλΠϛϯάͰεέʔϧ͢Ε͍͍͔
Kubernates • Google͕ͭͬͨ͘ίϯςφΫϥελཧπʔϧ • αʔϏε୯ҐͰͷσϓϩΠ͕Ͱ͖Δ • ͍͍ͩͨશ෦ͷػೳ͕͋Δ͚ͲɺͰ͔͗͢Δ
ͦͦࣗͰΔҙຯ • ίϯςφΛσϓϩΠ͢ΔઌΛࣗલͰΒͳͯ͘ྑ ͍ͷͰ • ͋ΔఔͷεέʔϧʹͳΔͱࣗͰΔ͜ͱΛߟ͑Δ
ΫϥελϦϯάͱ ΦʔέετϨʔγϣϯ • Ͳ͜·Ͱ͕Πϯϑϥ͔࣌ʹΑͬͯมԽ͢Δ • ίϯςφΛ͏ͱ͍Ζ͍ΖͱมΘΓͦ͏ • ͍Ζ͍Ζͱߟ͑ͳ͍ͱ͍͚ͳ͍͜ͱ͕ଟ͍ ·ͱΊ:
·ͱΊ
ΫϥυͱΦϯϓϨ • ΫϥυͰ͋Δ͔Βͱ͔ɺΦϯϓϨͰ͋Δ͔Βɺ ͱ͍͏ͷ͋·Γେ͖ͳͰͳ͍ • ࠷࠷దͳج൫Λબ͢Δͷ͕Α͍ • ͩΊʹͳͬͨΒΓ͑Εྑ͍ • ʢΤϯδχΞͱͯ͠ʣͲ͜ͰՁΛग़͔͕͢ॏཁ