Save 37% off PRO during our Black Friday Sale! »

黒騎士と白の魔王で見るFastly によるキャッシングの活用と実践

C61c4df7cb3f2da2b4a7e7fe08bca7e1?s=47 guitarrapc
October 17, 2017

黒騎士と白の魔王で見るFastly によるキャッシングの活用と実践

2017/10/17(火)
Fastly Yamagoya Meetup 2017 登壇資料
https://techplay.jp/event/633461

C61c4df7cb3f2da2b4a7e7fe08bca7e1?s=128

guitarrapc

October 17, 2017
Tweet

Transcript

  1. ࠇٍ࢜ͱനͷຐԦ Fastly ʹΑΔΩϟογϯάͷ׆༻ͱ࣮ફ Fastly Yamagoya Meetup 2017 2017/10/17 – Ikiru

    Yoshizaki / guitarrapc
  2. About Speaker ٢࡚ ੜ / Ikiru Yoshizaki / @guitarrapc_tech גࣜձࣾάϥχ

    ΤϯδχΞ (ΠϯϑϥΤϯδχΞ -> VRΤϯδχΞ) Microsoft MVP for Cloud and Datacenter Management AWS + Azure / Fastly + CloudFront / gRPC + C# + Unity גࣜձࣾάϥχ http://grani.jp 2012೥9݄19೔ɺϞόΠϧήʔϜ։ൃاۀͱͯ͠ઃཱ 2017೥4݄26೔ɺʮࠇٍ࢜ͱനͷຐԦʯΛiOS/AndroidͰϦϦʔε
  3. About this session Why Fastly? ͳͥFastly ͳͷ͔ɺͦͷબ୒ཧ༝ How we use

    Fastly? Fastly Λʮࠇٍ࢜ͱനͷຐԦʯͰͲͷΑ͏ʹ͔͍ͭͬͯΔͷ͔ Fastly and monitoring Fastly ͷ؂ࢹ΍ӡ༻͸Ͳ͏͍ͯ͠Δͷ͔
  4. None
  5. None
  6. Why Fastly? Grani meets Fastly since Jan 2016

  7. Grani and CDNs Histories with our Games 2012- CloudFront 2013-

    CloudFront 2014- Akamai (1st), CloudFront (2nd) 2015- CloudFront (1st), Akamai (2nd) 2016- Fastly (1st), CloudFront (2nd) 2014೥ Cloud Front ো֐Λظʹ MultiCDN ମ੍΁ ౰ॳɺAkamai ΛϝΠϯʹ CloudFront Λαϒ΁ ͦͷޙɺAkamai ͔Β Fastly ʹεΠον
  8. Grani and CDNs Histories with our Games 2012- CloudFront 2013-

    CloudFront 2014- Akamai (1st), CloudFront (2nd) 2015- CloudFront (1st), Akamai (2nd) 2016- Fastly (1st), CloudFront (2nd) 2014೥ Cloud Front ো֐Λظʹ MultiCDN ମ੍΁ ౰ॳɺAkamai ΛϝΠϯʹ CloudFront Λαϒ΁ ͦͷޙɺAkamai ͔Β Fastly ʹεΠον 1λΠτϧ 2λΠτϧ 3λΠτϧ 2017೥ݱࡏ 4λΠτϧ + όοΫΤϯυ 27 Services
  9. Why we choose Fastly Reasons (Compare to Akamai) Akamai ΛϝΠϯൺֱର৅ʹɺKeyCDN

    ΍ MaxCDNɺCDNetworks ͳͲ֤ ࣾΛαϯϓϦϯάܾͭͭ͠ఆ - Robustness - Rapid Response - Instant Purge - Immediate configuration Apply and Rollback - Flexible configuration via VCL - S3, GCS, BigQuery and Datadog friendly - Github is using Fastly https://www.fastly.com/customers/github/
  10. Remarkable point of Fastly Fastly Response ฐࣾͷήʔϜʹ͓͍ͯ͸ɺಉ͡ίϯςϯπʹ͓͍ͯ΋࠷΋ૉૣ͘ΤϯυϢʔβʔ ʹϨεϙϯεΛฦ͍ͯͨ͠ɻ Instant Purge

    150ms Ҏ಺ͷύʔδՄೳ ࠇٍ࢜ͱനͷຐԦͰ΋Ұ೔ʹෳ਺ճPurgeʹΑΔ੍ޚ͕͔͔͍ͬͯΔ Quick Recovery ো֐͸0Ͱ͸ͳ͍ɺಛච͢΂͖͸ճ෮ͷ଎͞ Ωϟγϡ͕ޮ͍ͯͳ͍ίϯςϯπ΋ૣ ͘ͳΔ͜ͱ͕͋Γճઢબ୒͕ྑ͍ EventLog ͕ PurgeཤྺͰຒ·Δͷ͸ վળͯ͠΄͍͠ ϑΣʔϧΦʔόʔͯ͠΋͙͢ʹ෮چ͠ ͯFastlyʹ΋Ͳͬͯ͠·͏!
  11. How we use Fastly? Caching, Purging, Failover

  12. None
  13. None
  14. Caching Assets ը૾ɺΦʔσΟΦɺϜʔϏʔ Master Data JSON ϨεϙϯεͷΩϟογϡɺMessagePackͰύοΫ͞ΕͨόΠφϦ WordPress Ϩεϙϯε·Δ͝ͱFastlyͰΩϟγϡ ΫϥΠΞϯτʹ഑৴͍ͯ͠Δ

    શΞηοτ͸ Fastlyܦ༝ APIϨεϙϯεΛγϦΞϥΠζ ΦϒδΣΫτετϨʔδʹอ࣋ σϓϩΠ࣌ʹPurgeͯ͠هࣄߋ৽
  15. Purging Assets Ξηοτͷ௥Ճ΍ߋ৽λΠϛϯάͰPurge͕͔͔Δ Master Data Blue/Green σϓϩΠͰ઀ଓઌ৘ใΛߋ৽ɺPurge ϝϯςφϯεεςʔλεͷߋ৽ Ұ෦ΞϓϦͰ͸ɺαʔόʔϨεʹϚελ৘ใΛ഑৴ɺPurgeͰߋ৽ σϓϩΠ͕೔ʹෳ਺ൃੜ͢Δ

    ͨΊߴ଎ͳPurge͕خ͍͠
  16. Failover Fastly Primary Ͱ 99.999% ՔಇΛલఏʹߏ੒͍ͯ͠Δ CloudFront FastlyͰϚϨʹ 3෼ఔ౓ (͋Δ͍͸15-30෼ఔ౓)ͷ

    Fastly ϨεϙϯεྼԽ͕͋Δ AzureFunctions (FaaS) Ͱৗ࣌ Fastly ͷϨεϙϯεΛϦΞϧλΠϜ؂ࢹ Error Budget ߟྀ͕΄΅ෆཁ ͳ͙Β͍ʹ͸҆ఆ͍ͯ͠Δ Route53 ͷWeightedϨίʔυΛ ࢖ͬͯॏΈ෇͚όϥϯγϯά
  17. Failover Sample 3෼ޙʹࣗಈ෮چ ো֐ݕ஌ ->ࣗಈFailover

  18. Fastly and Monitoring? Datadog, GCS and BigQuery

  19. Streaming Insert to BigQuery Fastly ͔Β BigQuery ʹ௚ ઀Streaming Insert

    ͕Մೳ
  20. Fastly -> GCS ->BigQuery Expensive -> Cheap BigQuery ΁ͷ Streaming

    Insert ͸ɺFastlyͷϦΫΤετ͕૿͑Δ΄Ͳ ՝͕ۚരൃ͠͏Δɻ Ұ౓ GCS Λܦ༝ͯ͠ bq ίϚϯυͰΠϯαʔτ͢Δ͜ͱͰɺ՝ۚΛ཈͑ Δ͜ͱ͕Մೳ Fastly ͔ΒGCS ΁ ௚઀ϩΪϯάՄೳ
  21. Monitoring with Datadog Fastly Integration ؂ࢹର৅ͷFastly αʔϏεΛࢦఆՄೳ ΄΅ϦΞϧλΠϜ؂ࢹΛҡ࣋ͭͭ͠શମΛ೺ѲͰ͖ΔͷͰΦεεϝ Personal API

    TokenͰ ର৅αʔϏεݶఆ readonly ͕ྑ͞ ͛
  22. Conclusion

  23. Grani loves Fastly Fastly Λ࢖͏͜ͱͰϢʔβʔʹΑΓྑ͍ମݧΛ ίϯςϯπ഑৴͔Βɺߋ৽ɺϞχλϦϯάʹࢸΔ·ͰCDNΛ࢖͍ͬͯ ͯᙱ͍෦෼ʹ΋ख͕ಧ͍͍ͯΔ ͨͩར༻͢Δ͚ͩͰ͸ͳ͘ɺΞΫηεϩάͷ෼ੳ͔Βվળ·Ͱ࢖͑Δͷ ͰΦεεϝ

  24. We’re awaiting

  25. using CSharp;

  26. None