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
広告配信サーバーの設計について / Speee Engineer Meeting 2016-...
Search
yuma iwasaki
July 04, 2016
Programming
4
2.5k
広告配信サーバーの設計について / Speee Engineer Meeting 2016-06-22
yuma iwasaki
July 04, 2016
Tweet
Share
More Decks by yuma iwasaki
See All by yuma iwasaki
僕のキャリアとワインと鍋 / daikichijojipm
suthio
7
4.5k
「Laravel Novaの適切な使い方を考えてみる」 / laravel meetup tokyo vol 11
suthio
0
1.6k
バッチをGoにリプレイスして高速化した話 / GoGoGolangEdition!
suthio
2
28k
本当は怖くない AWS Lambda / speee_cafe_meetup06
suthio
2
750
広告配信サーバーにおけるBlue Green Deploymentの導入事例について \ SpeeeCafeMeetup05
suthio
3
1.6k
初めての本当の意味でのチーム開発 / pmjp 2016-12-03
suthio
4
1.6k
AWSインフラ構築ツールとしてのTerraform / SpeeeKaigi
suthio
1
2.1k
しくじり先生 アドネットワーク開発でしくじった話 / yapc8oji
suthio
2
1.9k
Other Decks in Programming
See All in Programming
オートマトン学習しろ / Do automata learning
makenowjust
3
130
Developer Joy == Developer Productivity (really!)
hollycummins
1
180
開発を加速する共有Swift Package実践
elmetal
PRO
0
410
Amazon BedrockでサーバレスなAIお料理ボットを作成する!!
tosuri13
0
220
A New Era of Testing
mannodermaus
2
490
エラーレスポンス設計から考える、0→1開発におけるGraphQLへの向き合い方
bicstone
5
1.5k
watsonx.ai Dojo #2 生成AIを使ったアプリ開発入門編
oniak3ibm
PRO
0
110
Swiftコードバトル必勝法
toshi0383
0
150
rbs-inlineを導入してYARDからRBSに移行する
euglena1215
1
270
マルチモジュールにおけるテスト最適化
fxwx23
0
210
令和トラベルにおけるLLM活用事例:社内ツール開発から得た学びと実践
ippo012
0
140
LangChainの現在とv0.3にむけて
os1ma
4
910
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
322
23k
10 Git Anti Patterns You Should be Aware of
lemiorhan
653
58k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
RailsConf 2023
tenderlove
28
810
Web Components: a chance to create the future
zenorocha
308
42k
Principles of Awesome APIs and How to Build Them.
keavy
125
16k
Code Review Best Practice
trishagee
62
16k
How to train your dragon (web standard)
notwaldorf
85
5.6k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
26
1.9k
A Philosophy of Restraint
colly
202
16k
The Invisible Customer
myddelton
119
13k
Bash Introduction
62gerente
608
210k
Transcript
৴αʔόʔઃܭ ʹ͍ͭͯ 2016-07-04 Speee Engineer Meeting @suthio
ΞδΣϯμ • Πϯλʔωοτࠂʹ͍ͭͯ • ৴αʔόʔઃܭ • ·ͱΊ
Έͳ͞Μʂ Πϯλʔωοτࠂ ͖Ͱ͔͢ʁ
Έͳ͞Μʂ Πϯλʔωοτࠂʹ ׳Εͯ·ͤΜ͔ʁ
None
None
None
ੈքͰҰ൪ࠂ͕ଟ͍αΠτͬ ͯݟͨ͜ͱ͋Γ·͔͢ʁ
None
None
ు͖ͦ͏ɻ
ࠂͷΠϝʔδ • ᓔಃ͍͠ɺअຐ • ΫϦοΫͨ͘͠ͳ͍
Γ߹͍ʹฉ͍ͨ • Youtubeૣ͘ݟ͍ͨ • ؒҧ͑ͯԡ͢ͱΠϥοͱ͢Δ • ͳΜ͔͍ͭͯ͘Δͷා͍ʢϦλʔήςΟϯάʣ
ੲ͔Β͜͏Ͱ͚ͨͬ͠ʁ
None
2010͔Βͷ 4ϲ݄ຖͷΫϦοΫͷਪҠ
ΫϦοΫ ࣮֬ʹԼ͕͍ͬͯΔ
None
None
Ϣʔβʔແҙࣝʹ ࠂΛແࢹ͍ͯ͠Δ
Ϣʔβʔ͕ݡ͘ͳͬͨ
ΫϦοΫ͞Εͳ͘ͳΔͱ Ͳ͏ͳΔͷ͔ʁ
ΫϦοΫ͞Εͳ͘ͳΔͱʁ • ϝσΟΞɿऩӹੑͷԼ • ࠂओɿϢʔβʔʹಧ͚͍ͨϝοηʔδ͕ ಧ͚ΒΕͳ͍
݁ՌతʹϢʔβʔʹ ྑ࣭ͳهࣄΛ ఏڙͰ͖ͳ͘ͳͬͯ͠·͏
Ϣʔβʔ͔ΒݏΘΕͳ͍ܗͰ ࠂΛग़͢ඞཁ͕ग़͖ͯͨ
ͦ͜ͰωΠςΟϒΞυ
ωΠςΟϒΞυʁ • ϢʔβʔʹετϨεΛ༩͑Δ͜ͱͳ͘ɺ ࠂΛग़ߘͰ͖Δ • σΟεϓϨΠࠂͷ3ഒۙ͘ͷΫϦοΫ • ʹରͯ͠ೃછΜͩࠂΛ ఏڙ͢Δ͜ͱ͕Մೳ
CONFIDENTIAL CONFIDENTIAL CONFIDENTIAL ネイティブアドの種類 ᶃΠϯϑΟʔυܕ ᶄϖΠυαʔνܕ ᶇωΠςΟϒΞυཁૉΛ࣋ͭ ΠϯΞυܕ ᶅϨίϝϯυΟδΣοτܕ ᶆϓϩϞʔτϦεςΟϯάܕ
ᶈΧελϜܕ ৯ϩά LINEελϯϓ Above the Law ※IABʢInteractive Advertising Bureauʣج४ʹΑΔ ωΠςΟϒΞυ
http://markezine.jp/article/detail/21916
http://markezine.jp/article/detail/21916
ϨίϝϯυΟδΣοτͱʁ • ϢʔβʔʹαΠτͷϨίϝϯυهࣄͱ ࠂΛಉ࣌ʹ৴ɺදࣔ • ͷܝࡌഔମදࣔϑΥʔϚοτ͔Βɺ ϢʔβʔભҠઌ͕ίϯςϯπͰ͋Δ͜ͱΛ ࣗવͱظ͍ͯ͠Δঢ়ଶͱͳ͍ͬͯΔ
ϨίϝϯυΟδΣοτͱʁ • ͱ͍͏͜ͱ༷ʑͳύλʔϯͷϨίϝϯυ͕ ඞཁɻ • ࠓهࣄ͝ͱʹϨίϝϯυΛߦ͍ͬͯΔ
None
ϨίϝϯυΟδΣοτͱʁ • ͱ͍͏͜ͱ༷ʑͳύλʔϯͷϨίϝϯυ͕ ඞཁɻ • ݱࡏهࣄ͝ͱʹϨίϝϯυΛߦ͍ͬͯΔ
৴αʔόʔඞཁཁ݅ • ResponseΛ100msҎʹฦ͢ඞཁ͕͋Δ • هࣄຖʹग़͢ϨίϝϯυσʔλΛม͑Δ • ߴτϥϑΟοΫʹ͑͏Δ
৴αʔόʔ࡞Δ࣌ʹ ߟ͑ͨ͜ͱ • 1͙Β͍ࠓͷઃܭͷ··͑ΒΕΔΑ͏ʹ ͓͖͍ͯͨ͠ • ։ൃظ͕͍ؒʢ1ϲ݄ʣͷͰෳࡶͳ࣮ ͨ͘͠ͳ͍
࠷ॳͷઃܭ
None
Redisͱʁ • ϝϞϦ্ʹKey-ValueετΞ(KVS)Λߏங͢Δ͜ͱ ͕Ͱ͖ΔιϑτΣΞ • ϝϞϦ্ʹσʔλΛ֨ೲ͢ΔͷͰɼඇৗʹߴʹ σʔλͷॻ͖ࠐΈɾಡΈࠐΈΛߦ͏͜ͱ͕Ͱ͖Δ • σʔλͷӬଓԽ͕Մೳ •
ಋೖ࣌σʔλྔͷ2ഒͷϝϞϦ͕ඞཁ
࠷ॳͷઃܭ • masterRedisΛ༻ҙͯ͠ϨϓϦέʔγϣϯ • slaveRedisϩʔΧϧʹ࣋ͭ
None
͕ൃੜ
σʔλྔΛܭࢉͨ͠Βɺ ϝϞϦʹΓΒͳ͍͜ͱ͕ ໌
RedisͰ࣮͢Δ߹ɺ 1ޙʹ120GBͷϝϞϦ͕ ඞཁͳఆͩͬͨ
ผͷ࣮Λߟ͑ͨ
None
DynamoDBͱʁ • શϚωʔδυܕͷ NoSQLͷσʔλϕʔεαʔϏε • UZOUͷ৴ͰKVSͱͯ͠༻͍ͯ͠Δ
DynamoDBͷಛ • ཧָ͕ʂ • ༰ྔͷ૿ՃΛؾʹ͠ͳͯ͘ྑ͍ • ݕࡧɺूܭऑ͍ • ͍ϨΠςϯγ
DynamoDBͷϢʔεέʔε • KVSͱͯ͠ • ࠂήʔϜͳͲͷߦಈཤྺDBͱͯ͠ • ϞόΠϧΞϓϦͷόοΫΤϯυͱͯ͠ - ϞόΠϧΞϓϦ͔ΒࢀরͰ͖ΔDBͱͯ͠
http://www.slideshare.net/AmazonWebServicesJapan/ 20150805-aws-blackbeltdynamodb
UZOUͰͷ৴αʔόʔઃܭ ֆΛೖΕΔɻ
UZOUͰͷ৴αʔόʔઃܭ
Ͳ͏ͬͯɺDynamoDBʹ ৴σʔλΛೖΕ͍ͯΔ͔
ݩʑͷఆ
DynamoDB ॻ͖ࠐΈΩϟύγςΟෆ
SleepೖΕͳ͕ΒϦτϥΠ
ͱ͔ͬͯͨΒऑ
None
Write࣌ͷӡ༻ํ๏ • 1ʹҰLambda͕ىಈ͢ΔΑ͏ʹεέ δϡʔϦϯάͯ͠SQS͕ಈ͘Α͏ʹ͢Δ • ୠ͠ɺLambda5ʹҰͷ εέδϡʔϦϯά͔͠࡞Εͳ͍
ΠϕϯτιʔεΛ 5ͭ࡞ͬͯղܾ
cron(*/5 * * * ? *) cron(1,6,11,16,21,26,31,36,41,46,51,56 * * *
? *) cron(2,7,12,17,22,27,32,37,42,47,52,57 * * * ? *) cron(3,8,13,18,23,28,33,38,43,48,53,58 * * * ? *) cron(4,9,14,19,24,29,34,39,44,49,54,59 * * * ? *)
None
ҋͬΆ͍
ঘɺࠓղܾࡁ
rate(1 minutes)
ݱࡏͷ৴αʔόʔ • 1ͨΓɺඵؒ500ΞΫηεࡹ͚Δ • DynamoDBʹ1ΞΫηεͨΓɺ10ms
DynamoDBΛӡ༻͢Δ্Ͱ ؾΛ͚ͭΔ͜ͱ
ΩϟύγςΟϢχοτ
ΩϟύγςΟϢχοτͱʁ • ͬ͘͟Γݴ͏ͱͲΕ͚ͩॻ͖ࠐΊΔ͔ɺ ͲΕ͚ͩಡΈࠐΊΔ͔ΛܾΊΔͭ
ΩϟύγςΟϢχοτͱʁ • ߴΊʹઃఆ͢Δͱ͓͕͔͔ۚΔɻ • Ίʹઃఆͯ͠ΩϟύγςΟϢχοτҎ্ ༻͢Δͱॲཧʹࣦഊ͢Δ • ಡΈࠐΈɺॻ͖ࠐΈݸผʹઃఆ͢Δ
None
͋Εɺ͑ͯΔͷʹ͑ͯΔʁ
ͳͥ͜Μͳ͜ͱ͕ى͜Δͷ͔ʁ
όʔετΩϟύγςΟ • ར༻͞Εͳ͔ͬͨύʔςΟʔγϣϯͷΩϟύ γςΟΛաڈ300ඵ·ͰϦβʔϒ͞ΕΔ͘͠ Έɻ • όʔεττϥϑΟοΫʹ͑ΒΕΔɻ
None
DynamoDBͷಡΈࠐΈྔ͕ ಡΊͳ͍
ࠓճͷ৴αʔόʔͷઃܭͩ ͱɺϦΫΤετ͕૿͑Ε૿ ͑Δ΄ͲɺDynamoDBͷෛՙ ૿͍͑ͯ͘༧ఆ
ReadରࡦҊ • ༧ΊଟΊʹΩϟύγςΟϢχοτΛઃఆͯ͠ ͓͘ • DynamoDBͷReadʹࣦഊͨ͠Β༧Ί༻ҙͯ͠ ͓͍ͨɺσϑΥϧτࠂΛग़͢ • DynamoDBͷΩϟύγςΟϢχοτΛಈతʹ มߋ
DynamoDBͷ AutoScalaΛ͠Α͏
None
None
LambdaͰղܾ
http://dev.classmethod.jp/etc/auto- scaling-dynamodb-by-lambda/
Ծઆɺݕূ
Ծઆ1
ݟͯΔهࣄʹΑΓྨࣅͨ͠ ࠂɺهࣄͩͬͨΒΫϦοΫ ͞Ε͘͢ͳΔΜ͡Όͳ͍͔ʁ
Ͳ͏Β߹͍ͬͯΔΑ͏ͩ
ࡉ͔͘ݕূɺݕূ