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
Cookpad の広告配信を支えるアーキテクチャ
Search
Ken Wagatsuma
October 03, 2018
Programming
1
610
Cookpad の広告配信を支えるアーキテクチャ
presented at
https://lob.connpass.com/event/100491/
Ken Wagatsuma
October 03, 2018
Tweet
Share
More Decks by Ken Wagatsuma
See All by Ken Wagatsuma
Pregel Graph Compute Engines - Supersteps Exampls
kenju
1
200
Kafka on Kubernetes with Strimzi
kenju
1
140
AWS DynamoDB Accelerator (DAX) 101
kenju
3
6.9k
Moden browser introduction
kenju
1
360
Cookpad summer internship 2019 - API
kenju
0
10k
Introduction to Design Patterns
kenju
0
68
GraphQL Asia 2019 "Re-architecture of a decade-old app with BFF/GraphQL"
kenju
0
8.8k
Introduction to TypeScript
kenju
0
680
Introduction to Programmatic Ad
kenju
0
220
Other Decks in Programming
See All in Programming
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
280
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
3
480
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
160
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
720
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
260
Effective Signals in Angular 19+: Rules and Helpers @ngbe2024
manfredsteyer
PRO
0
140
Jakarta EE meets AI
ivargrimstad
0
260
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
3
500
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
180
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
520
39k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
Rails Girls Zürich Keynote
gr2m
94
13k
Faster Mobile Websites
deanohume
305
30k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Become a Pro
speakerdeck
PRO
26
5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
How to Ace a Technical Interview
jacobian
276
23k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Designing for humans not robots
tammielis
250
25k
Transcript
$PPLQBEͷࠂ৴Λ ࢧ͑ΔΞʔΩςΫνϟ $PPLQBE*OD զ࠺ݠथʢ,FOKV8BHBUTVNBʣ
8IP Kenju Wagatsuma - Serverside Engineer - Ruby, Go, AWS
- Recruit HD -> Bit Journey -> Cookpad - github.com/kenju - twitter.com/itiskj - itiskj.hatenablog.com
"SDIJUFDUVSF
4FSWJDFT • ad4 • admin site • ads • ads
delivery server • log architecture • Offline … fluentd/S3/Redshift • Realtime … Kinesis Streams/DynamoDB/Lambda
0WFSBMM"SDIJUFDUVSF BE BET CBUDI ! DBDIF .Z42- .Z42- 4%,
-PH"SDIJUFDUVSF
%PNBJO.PEFMT
0QFSBUJPO $BNQBJHO Ωϟϯϖʔϯɺ৴ͷ୯Ґ $BNQBJHO1FSJPE Ωϟϯϖʔϯͷ৴ظؒ #PPLJOH $BNQBJHOͱ1SPEVDUͷؔ࿈ςʔϒϧ 1SPEVDU ৴ରͷࠂ 1MBDFNFOU
ෳͷ1SPEVDUͷू߹ମ $SFBUJWF ΫϦΤΠςΟϒɺը૾λά $MJFOU डઌͷΫϥΠΞϯτ
0QFSBUJPO$BNQBJHO
0QFSBUJPO$SFBUJWFT
0QFSBUJPO $BNQBJHO 1FSJPE #PPLJOH 1MBDFNFOU $MJFOU $BNQBJHO 1SPEVDU 0SHBOJ[BUJPO $SFBUJWF
0SEFS
%FMJWFSZ %FMJWFSZ1MBO Ωϟϯϖʔϯ͝ͱͷྲྀྔΛهड़ͨ͠৴ܭը %FMJWFSZ1BZMPBE ৴͢Δ+40/1BZMPBET (PBM#VEHFUFE $1$࠷దԽܕ (PBM1FSDFOUBHF ৴ൺϕʔε (PBM*NQSFTTJPO
ඪ*NQSFTTJPOೖߘܕ (PBM$MJDL ඪ$MJDLೖߘܕ (PBM3FNOBOU ༨ࡏݿ৴ܕ
%FMJWFSZ%FMJWFSZ1MBO { "version": 1, "site_id": 3, "product_id": 537, "product_capacity": 1,
"campaigns": [ { "id": 18585, "goal_type": "percentage", "creatives": [ { "id": 60057, "formats": [ "category_hijack_spw_with_image" ], "targets": [ { "keywords": [ "͘Ζ·Ί", "ΫϩϚϝ" ] } ] } ], "rate_numerator": 10000, "rate_denominator": 10000 },
%FMJWFSZ%FMJWFSZ1BZMPBE [ { "key": "cookpad-android-search-master", "creatives": [ [ { "id":
111, "template": "image", "click_url": "https://...", "media": { "mime_type": "image/jpeg", "original": "https://example.com/d6663ab44a0c48a1996debc690893493.jpg?1510564210", "width": 300, "height": 250 } } ] ] }
5BSHFUJOH $SFBUJWF ʢ࠶ܝʣ $SFBUJWF5BSHFU λʔήςΟϯάϧʔϧΛද͢நϞσϧ "SFB3VMF ΤϦΞผλʔήςΟϯά "VEJFODF3VMF ηάϝϯτผλʔήςΟϯά ,FZXPSE3VMF
ݕࡧΩʔϫʔυผλʔήςΟϯά 3FDJQF3VMF ϨγϐผλʔήςΟϯά 4DIFEVMF3VMF ༵ɾ࣌ؒଳผλʔήςΟϯά
5BSHFUJOH $SFBUJWF $SFBUJWF 5BSHFU ,FZXPSE 3VMF 3FDJQF 3VMF 4DIFEVMF 3VMF
"SFB 3VMF "VEJFODF 3VMF
+BWB4DSJQU4%, EJTQMBZKT
EJTQMBZKT'FBUVSFT • Request to the ads delivery server • Parse
response & build creative tags • Header Bidding wrapper • Logging for viewable impressions
EJTQMBZKT-JCSBSJFT • webpack for building • babel for compile •
eslint for static analysis • eslint-plugin-compat (<- one of maintainers #) • karma / jasmine • pupetter as an emulator • istanbul for coverage
EJTQMBZKT3FRVFTU3FTQPOTF $ curl --globoff ‘https://example-ads.com/display?slots[pc-top-panel-main][capacity]=1' | jq . { "slots":
[ { "key": "pc-top-panel-main", "creatives": [ [ { "id": 62596, "template": "image", "media": { "mime_type": "image/jpeg", "original": "https://img5-ak.cpcdn.com/ad4/19584ec3bf844581a0cfd1917cd785d8.jpg?1535448767", "width": 300, "height": 600, "center_crop": false } } ]
3FTQPOTFKT EJTQMBZKTBSDIJUFDUVSF $SFBUJWFKT 4MPUKT 3FRVFTUKT 1BZMPBEKT )FBEFS#JEEJOH )FBEFS#JEEJOH 8SBQQFSKT -PHHJOH
-PHHFSKT -PH3FDPSEKT -PHHFS$MJFOUKT
EJTQMBZKT)FBEFS#JEEJOH
IUUQTUFDIMJGFDPPLQBEDPNFOUSZ .PSF%FUBJMT
WT-FHBDZ
ϨΨγʔΞʔΩςΫνϟ wϝϯόʔ͕େ͖͘มΘΓҾ͖ܧ͗ࠔ w ݱঢ়ͷίʔυͱHJUCMBNFHJUMPH w ࣾʹԿਓ͔࣌ͷϝϯόʔ͕͍Δ͜ͱ·ͩٹ͍ wزଟͷ7FSTJPOJOH w ೖߘϩδοΫɺ৴ϩδοΫɺλʔήςΟϯάϩδοΫɺ 4%,7FSTJPOͯ͢ಠཱͯ͠ੈଘࡏ͢Δ
wػೳ։ൃ༏ઌɺϦΞʔΩςΫνϟઐෆࡏ w ϧʔϧͰಓʹย͚͍ͯͬͨ
ϨΨγʔͱͷઓ͍ํ wlௐࠪతϦϑΝΫλϦϯάzʹΑΔʮཧղʯ w ʰϨΨγʔιϑτΣΞվળΨΠυʱ wςετʹΑΔʮ࣭ʯͷݟ͑ΔԽ w ʰ৫ʹςετΛॻ͘จԽΛ͔ࠜͤΔઓུͱઓज़ʱ CZ!U@XBEB͞Μ wϦϑΝΫλϦϯάͷʮٕज़ʯΛʹ͚ͭΔ w
ʢ࣍ܝʣ
ϦϑΝΫλϦϯάͷʮٕज़ʯͱ ۜͷؙͳ͍ɺಓͳٕज़ͷੵΈॏͶ w3FBEBCJMJUZ w ʰ5IF"SUPG3FBEBCMF$PEFʱ wσβΠϯύλʔϯ w ʰ(BNF1SPHSBNNJOH1BUUFSOTʱ wΦϒδΣΫτࢦઃܭ w
ʰΦϒδΣΫτࢦઃܭ࣮ફΨΠυʱ w FUD
ϦϑΝΫλϦϯάͷʮελϯεʯ wطଘͷίʔυϕʔεͷʮଚܟʯ w ࠓͷձࣾͷച্Λ࡞ͬͨڝ૪ྗͷݯઘ wʮ͋Δ͖࢟ʯ͔Βߟ͑Δ w அࡐྉʜࠓٻΊΒΕΔ༷ɺϝϯόʔͷٕज़ϨϕϧɺӨڹ ൣғͱϦεΫ wతͱखஈΛࠞಉ͠ͳ͍ w
αʔϏεͷΛՃͤ͞ɺ࣭ΛߴΊΔͨΊ w ಈతݴޠܕ੩తղੳ$*ʜશͯखஈ
ਖ਼͍͠ίετஅΛ͢Δ खͨΓ࣍ୈʹ͞ͳ͍ɻ lࠓԿ͠ͳ͍͜ͱͷɺ কདྷతͳίετͲΕ͚ͩ ͩΖ͏ʁz ʰΦϒδΣΫτࢦઃܭ ࣮ફΨΠυʱQ
$IBMMFOHFT
ٕज़తνϟϨϯδ wνʔϜͷεϩʔΨϯͰ͋Δ wٕज़తνϟϨϯδΛ௨ͨ͡Ռˍ wٕज़తνϟϨϯδΛ͠ͳ͍ͱރΕͯ͠·͏ wΩϟϦΞҎલʹਫ਼ਆӴੜ্ඞཁ w؆୯ʹͰ͖ΔͷzνϟϨϯδzͰͳ͍ wࣗͷݶքΛ্͛ΔӦΈ
ԿΛʮνϟϨϯδʯ͢Δ͔ ʮ৽͍ٕ͠ज़ʯ͚͕ͩνϟϨϯδͰͳ͍ w ࣅͨΑ͏ͳϑϨʔϜϫʔΫΛͬͨ͜ͱ͕͋Εɺֶͼ ࣮গͳ͍ʢ͔͠Εͳ͍ʣ w ߴ࣭Λ࣮ݱ͢ΔͨΊͷϦΞʔΩςΫνϟɺίεύͷྑ͍ ςετɺγϡϛϨʔγϣϯ౷߹ςετͷΈɺϩάʹ ΑΔՄࢹԽɺೲظతͳνϟϨϯδ
ຖͷྉཧΛָ͠Έʹ͢Δ 5IBOLZPV