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

Lambda@Edgeを利用したサードパーティJavaScriptのカナリアリリース / Canary release using Lamdba@Edge

Lambda@Edgeを利用したサードパーティJavaScriptのカナリアリリース / Canary release using Lamdba@Edge

2021-05-28 @AWS Dev Alliance

Edward Fox

May 28, 2021
Tweet

More Decks by Edward Fox

Other Decks in Technology

Transcript

  1. Lambda@Edge Λར༻ͨ͠


    αʔυύʔςΟJavaScriptͷ


    ΧφϦΞϦϦʔε
    Edward Fox 2021/05/28


    @AWS Dev Alliance

    View full-size slide

  2. @edwardkenfox


    Edward Fox


    ɾΤϯδχΞ @ Reproגࣜձࣾ


    ɾWEBʗϒϥ΢βٕज़શൠɺ෼ࢄॲཧ


    ɾόεέɺϏʔϧɺӉ஦
    2/52

    View full-size slide

  3. ࠓ೔࿩͢͜ͱ:


    Lambda@Edge Λར༻͠


    ҆શͳܗͰϦϦʔε͕Ͱ͖Δ


    Α͏ʹͳͬͨ࿩
    3/52

    View full-size slide

  4. ࠓ೔࿩͞ͳ͍͜ͱ:


    Lambda@Edge ͷػೳ঺հ


    ͳͲ
    4/52

    View full-size slide

  5. 1. αʔυύʔςΟJavaScriptͱ͸


    2. ϦϦʔεͷ໰୊఺


    3. ΧφϦΞϦϦʔε ͱ͸


    4. Lambda@Edge Ͱͷ࣮ݱํ๏


    5. ݁Ռ


    6. AWS ͞Μ΁ͷཁ๬
    5/52

    View full-size slide

  6. 1. αʔυύʔςΟJavaScriptͱ͸


    2. ϦϦʔεͷ໰୊఺


    3. ΧφϦΞϦϦʔε ͱ͸


    4. Lambda@Edge Ͱͷ࣮ݱํ๏


    5. ݁Ռ


    6. AWS ͞Μ΁ͷཁ๬

    View full-size slide

  7. αΠτʹຒΊࠐΜͰ΋Β͍


    σʔλΛऩूͨ͠Γૹ৴͢Δ


    αʔυύʔςΟͷJavaScriptίʔυɻ
    Google Analyticsʹ୅ද͞ΕΔΑ͏ͳ


    λά΍޿ࠂܭଌπʔϧ͕͜Εʹ͋ͨΔ
    7/52

    View full-size slide

  8. ※ ฐࣾͰఏڙ͍ͯ͠Δ


    αʔυύʔςΟJavaScript ͸


    Web SDKͱ΋ݺ͹Ε͍ͯ·͢
    8/52

    View full-size slide

  9. ※ ࣮ࡍͷ΋ͷͱ͸ҟͳΓ·͢

    View full-size slide

  10. Web SDK ʹมߋ͕͋Δͨͼʹ


    ϦϦʔεΛ࣮ࢪ͢Δ͕


    repro-sdk.min.js ͸ৗʹ


    ࠷৽όʔδϣϯΛࢀর͢Δ
    10/52

    View full-size slide

  11. 1. αʔυύʔςΟJavaScriptͱ͸


    2. ϦϦʔεͷ໰୊఺


    3. ΧφϦΞϦϦʔε ͱ͸


    4. Lambda@Edge Ͱͷ࣮ݱํ๏


    5. ݁Ռ


    6. AWS ͞Μ΁ͷཁ๬

    View full-size slide

  12. ৽͍͠όʔδϣϯΛϦϦʔε


    ͢Δͱ ଈ࣌͢΂ͯͷ


    ΫϥΠΞϯτͰಈ࡞Λ࢝ΊΔ
    13/52

    View full-size slide

  13. 👍


    ɾ໰୊͕͋ͬͨΒ͙͢ʹؾ෇͚Δ


    👎


    ɾ໰୊͕͋ͬͨͱ͖ͷඃ֐͕ਙେ
    14/52

    View full-size slide

  14. ڪාͷҰٿೖࠢϦϦʔε 😇
    15/52

    View full-size slide

  15. ༷ʑͳϒϥ΢β΍΢ΣϒαΠτͰ
    ಈ࡞͢ΔαʔυύʔςΟ
    JavaScriptͱ͍͏ੑ࣭తʹɺ


    ΫϥΠΞϯτґଘͰى͖Δ໰୊Λ
    ͢΂ͯࣄલʹ༧ଌ͢Δ͜ͱ͸ࠔ೉

    View full-size slide

  16. => ຊ൪ʹग़ͯ͠Έͳ͍ͱ


    ෼͔Βͳ͍ɻ


    Ͱ΋ͳΔ΂҆͘શʹग़͍ͨ͠
    17/52

    View full-size slide

  17. ͦΜͳͱ͖ͷͨΊͷ


    ΧφϦΞϦϦʔε 🐧 🐧 🐧
    18/52

    View full-size slide

  18. 1. αʔυύʔςΟJavaScriptͱ͸


    2. ϦϦʔεͷ໰୊఺


    3. ΧφϦΞϦϦʔε ͱ͸


    4. Lambda@Edge Ͱͷ࣮ݱํ๏


    5. ݁Ռ


    6. AWS ͞Μ΁ͷཁ๬

    View full-size slide

  19. https://martinfowler.com/bliki/
    CanaryRelease.html


    ͔ΒҾ༻
    20/52

    View full-size slide

  20. Web SDKʹ͓͚Δ


    ΧφϦΞϦϦʔεͷཁ݅
    23/52

    View full-size slide

  21. 1. Web SDKʹର͢ΔτϥϑΟοΫશମʹରͯ͠


    ภΓͳ͘৽چόʔδϣϯΛ෼ࢄ͍ͤͨ͞


    2. ΫϥΠΞϯτ͝ͱʹ͸৽چόʔδϣϯΛ


    ͲͪΒ͔ʹݻఆ͍ͤͨ͞


    3. ৽چόʔδϣϯͷৼΓ෼͚ͷׂ߹Λࢦఆ


    ͍ͨ͠ɻ·ͨঃʑʹׂ߹Λม͍͑ͨɻ
    24/52

    View full-size slide

  22. 1. αʔυύʔςΟJavaScriptͱ͸


    2. ϦϦʔεͷ໰୊఺


    3. ΧφϦΞϦϦʔε ͱ͸


    4. Lambda@Edge Ͱͷ࣮ݱํ๏


    5. ݁Ռ


    6. AWS ͞Μ΁ͷཁ๬

    View full-size slide

  23. 1. αʔυύʔςΟJavaScriptͱ͸


    2. ϦϦʔεͷ໰୊఺


    3. ΧφϦΞϦϦʔε ͱ͸


    4. Lambda@Edge Ͱͷ࣮ݱํ๏


    5. ݁Ռ


    6. AWS ͞Μ΁ͷཁ๬

    View full-size slide

  24. 1. Web SDKʹର͢ΔτϥϑΟοΫશମʹରͯ͠


    ภΓͳ͘৽چόʔδϣϯΛ෼ࢄ͍ͤͨ͞


    2. ΫϥΠΞϯτ͝ͱʹ͸৽چόʔδϣϯΛ


    ͲͪΒ͔ʹݻఆ͍ͤͨ͞


    3. ৽چόʔδϣϯͷৼΓ෼͚ͷׂ߹Λ


    ࢦఆ͍ͨ͠ɻ·ͨঃʑʹׂ߹Λม͍͑ͨɻ
    30/52

    View full-size slide

  25. 1. Web SDKʹର͢ΔτϥϑΟοΫશମʹରͯ͠


    ภΓͳ͘৽چόʔδϣϯΛ෼ࢄ͍ͤͨ͞


    2. ΫϥΠΞϯτ͝ͱʹ͸৽چόʔδϣϯΛ


    ͲͪΒ͔ʹݻఆ͍ͤͨ͞


    3. ৽چόʔδϣϯͷৼΓ෼͚ͷׂ߹Λ


    ࢦఆ͍ͨ͠ɻ·ͨঃʑʹׂ߹Λม͍͑ͨɻ
    30/52
    👌👌👌

    View full-size slide

  26. 1. Web SDKʹର͢ΔτϥϑΟοΫશମʹରͯ͠


    ภΓͳ͘৽چόʔδϣϯΛ෼ࢄ͍ͤͨ͞


    2. ΫϥΠΞϯτ͝ͱʹ͸৽چόʔδϣϯΛ


    ͲͪΒ͔ʹݻఆ͍ͤͨ͞


    3. ৽چόʔδϣϯͷৼΓ෼͚ͷׂ߹Λ


    ࢦఆ͍ͨ͠ɻ·ͨঃʑʹׂ߹Λม͍͑ͨɻ
    30/52
    👌👌👌
    👌👌

    View full-size slide

  27. 1. Web SDKʹର͢ΔτϥϑΟοΫશମʹରͯ͠


    ภΓͳ͘৽چόʔδϣϯΛ෼ࢄ͍ͤͨ͞


    2. ΫϥΠΞϯτ͝ͱʹ͸৽چόʔδϣϯΛ


    ͲͪΒ͔ʹݻఆ͍ͤͨ͞


    3. ৽چόʔδϣϯͷৼΓ෼͚ͷׂ߹Λ


    ࢦఆ͍ͨ͠ɻ·ͨঃʑʹׂ߹Λม͍͑ͨɻ
    30/52
    👌👌👌
    👌👌
    👌

    View full-size slide

  28. 1. αʔυύʔςΟJavaScriptͱ͸


    2. ϦϦʔεͷ໰୊఺


    3. ΧφϦΞϦϦʔε ͱ͸


    4. Lambda@Edge Ͱͷ࣮ݱํ๏


    5. ݁Ռ


    6. AWS ͞Μ΁ͷཁ๬

    View full-size slide

  29. ຖճίʔυΛॻ͖׵͑ͳ͚Ε͹


    ͍͚ͳ͍ͷ͸໘౗
    37/52

    View full-size slide

  30. => ͦ͏ͩɺ؀ڥม਺Λ࢖͓͏
    38/52

    View full-size slide

  31. 😱 😱 😱
    43/52

    View full-size slide

  32. ཁ๬1:


    ؀ڥม਺ͷαϙʔτ 🙏
    44/52

    View full-size slide

  33. 🤔 🤔 🤔
    48/52

    View full-size slide

  34. ཁ๬2:


    UIͷվળ 🙏
    49/52

    View full-size slide

  35. ɾLambda@Edge Λར༻ͯ͠ΧφϦΞ


    ϦϦʔεΛ࣮ݱ͠ɺ҆৺ɾ҆શͳܗͰ


    ϦϦʔεΛ࣮ࢪͰ͖ΔΑ͏ʹͳͬͨ


    ɾ͜ΕҎ֎ʹ΋ Lambda@Edge ͸ଟ͘ͷ


    Ϣʔεέʔεʹ࢖͑ΔػೳͳͷͰɺ


    ࠓޙ΋ՄೳੑΛ୳͍͖͍ͬͯͨ
    51/52

    View full-size slide

  36. We are hiring!

    View full-size slide