Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cookpad の広告配信を支えるアーキテクチャ

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

Cookpad の広告配信を支えるアーキテクチャ

Avatar for Ken Wagatsuma

Ken Wagatsuma

October 03, 2018
Tweet

More Decks by Ken Wagatsuma

Other Decks in Programming

Transcript

  1. 8IP Kenju Wagatsuma - Serverside Engineer - Ruby, Go, AWS

    - Recruit HD -> Bit Journey -> Cookpad - github.com/kenju - twitter.com/itiskj - itiskj.hatenablog.com
  2. 4FSWJDFT • ad4 • admin site • ads • ads

    delivery server • log architecture • Offline … fluentd/S3/Redshift • Realtime … Kinesis Streams/DynamoDB/Lambda
  3. %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 },
  4. %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 } } ] ] }
  5. 5BSHFUJOH $SFBUJWF ʢ࠶ܝʣ $SFBUJWF5BSHFU λʔήςΟϯάϧʔϧΛද͢ந৅Ϟσϧ "SFB3VMF ΤϦΞผλʔήςΟϯά "VEJFODF3VMF ηάϝϯτผλʔήςΟϯά ,FZXPSE3VMF

    ݕࡧΩʔϫʔυผλʔήςΟϯά 3FDJQF3VMF ϨγϐผλʔήςΟϯά 4DIFEVMF3VMF ༵೔ɾ࣌ؒଳผλʔήςΟϯά
  6. EJTQMBZKT'FBUVSFT • Request to the ads delivery server • Parse

    response & build creative tags • Header Bidding wrapper • Logging for viewable impressions
  7. 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
  8. 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 } } ]