$30 off During Our Annual Pro Sale. View Details »

LOWYAにおける負荷対策と高速化~GraphQL Caching on Amazon CloudFront with AWS Prototyping Program~

LOWYAにおける負荷対策と高速化~GraphQL Caching on Amazon CloudFront with AWS Prototyping Program~

LOWYAにおける負荷対策と高速化のために導入した、GraphQL Caching on Amazon CloudFront の紹介です。

takashinajundai

September 30, 2022
Tweet

Other Decks in Technology

Transcript

  1. ೥݄೔ɹ+"846(43&ࢧ෦ɹגࣜձࣾϕΨίʔϙϨʔγϣϯɹ∁඼७େɹ -08:"ʹ͓͚Δෛՙରࡦͱߴ଎Խ ~GraphQL Caching on Amazon CloudFront with AWS Prototyping

    Program~
  2. ࣗݾ঺հ ∁඼७େ ɹɹ@datahaikuninja w ॴଐ w גࣜձࣾϕΨίʔϙϨʔγϣϯɹٕज़ઓུ෦43&άϧʔϓ w ܦྺ w

    "1/ͷاۀͰ.41ΦϖϨʔλʔͱΠϯϑϥΤϯδχΞΛܦͯݱ৬ w ޷͖ͳ"84αʔϏε w "NB[PO$MPVE'SPOU w "848"' w "844IJFME 
  3. -08:"ʹ͍ͭͯ 

  4. ຊ೔ͷ಺༰ w (SBQI2-$BDIJOHಋೖલͷ՝୊ͱղܾ͔ͨͬͨ͜͠ͱ w "841SPUPUZQJOH1SPHSBNͷ঺հ w ϓϩμΫγϣϯϦϦʔε·ͰͷಓͷΓͱಋೖޮՌ 

  5. (SBQI2-$BDIJOHಋೖલͷ՝୊ͱ 
 ղܾ͔ͨͬͨ͜͠ͱ 

  6. (SBQI2-$BDIJOHͱ͸ w "LBNBJͷهࣄ͔ΒදݱΛ͓आΓ͢Δͱ w ʮຊػೳͰ͸(SBQI2-Ͱهड़͞ΕͨϦΫΤετʹରͯ͠ɺ)5511045#PEZͷ1BSTF͓ Αͼ)BTI஋ΛऔΓҰҙͷΩϟογϡΩʔΛੜ੒͢Δ͜ͱͰɺ(SBQI2-Ͱݺͼग़͞ΕͨϨ εϙϯε݁ՌΛ$%/্ͷΤοδαʔόʔͰΩϟογϡ͢Δ͜ͱ͕ՄೳʹͳΓ·͢ɻʯ w ຊൃදʹ͓͚Δ(SBQI2-$BDIJOH 


    ʮ(SBQI2-ͷϨεϙϯε݁ՌΛ$MPVE'SPOUͰΩϟογϡ͢Δʯ 
  7. (SBQI2-$BDIJOHಋೖલͷ՝୊ w ਧ͖ग़͠͸ݱࡏͷෛՙରࡦ w ੺͍ପԁ͕՝୊Λײ͍ͯͨ͜͡ͱ w ͍ۙະདྷͷεέʔϥϏϦςΟͷ՝୊ w ίετ૿Ճ 

  8. 0VSNJTTJPO w ࣄۀ֦େʹ߹Θͤߴ͍৴པੑΛҡ࣋ఏڙͰ͖Δ͜ͱ w ࣄۀଆͷ໨ඪʹରͯ͠ɺγεςϜ͕ϘτϧωοΫʹͳΒͣୡ੒ՄೳͰ͋Δ w ՝୊͕ු্ͯ͠΋࢓૊ΈͰղܾ͠ɺ඼࣭ΛߴΊΔࣄ͕Ͱ͖Δ w ͍ۙະདྷʹόοΫΤϯυͷεέʔϥϏϦςΟͱίετ૿Ճ͕ਂࠁͳ՝୊ 


    ͱͳͬͯɺࣄۀ֦େʹ͓͚Δো֐ʹͳΔલʹࡦΛߨ͓͖͍ͯͨ͡
  9. ʮ୭͕ݟͯ΋ಉ͡ʢಉ͡Ͱ͋Δ΂͖ʣ 
 "1*ͷϨεϙϯε݁ՌΛΩϟογϡͤ͞Α͏ʯ 

  10. (SBQI2-$BDIJOHʹΑͬͯղܾ͔ͨͬͨ͜͠ͱ w ਧ͖ग़͠͸ݱࡏͷෛՙରࡦ w ੨͍ପԁ͕ղܾ͔ͨͬͨ͠ɺվળΛظ଴ͨ͜͠ͱ w ͍ۙະདྷͷεέʔϥϏϦςΟͷ՝୊ w ίετ૿Ճͷվળ w

    "1*ͷߴ଎Խ 
  11. "841SPUPUZQJOH1SPHSBNͷ঺հ 

  12. "841SPUPUZQJOH1SPHSBNΛ஌Δ͖͔͚ͬ w ٕज़બఆʹ͍ͭͯ w ౰ॳ͸"84Ͱ࣮૷͢Δ༧ఆ͸ͳ͘ɺҎԼΛൺֱݕ౼͍ͯͨ͠ w $MPVE fl BSFXPSLFST w

    'BTUMZDPNQVUF!FEHF w 4UFMMBUF(SBQI2-&EHF$BDIJOH (SBQI$%/  w "841SPUPUZQJOH1SPHSBNΛ஌͖͔͚ͬͨͬ w ಉ࣌ظʹ%%P4౳ͷ֎෦͔Βͷ߈ܸରࡦʹ"844IJFME"EWBODFEΛ࢖͓͏ͱ͍ͯͨ͠ w ౰࣌ɺ4IJFME"EWBODFEBVUPNBUJDBQQMJDBUJPOMBZFS%%P4NJUJHBUJPOͷαϙʔτର৅͸$MPVE'SPOU ͷΈͩͬͨͷͰɺ$MPVE'SPOUͰ(SBQI2-$BDIJOH͕Ͱ͖ͳ͍͔ɺ"84͞Μʹ૬ஊͯ͠Έͨ w ΤοδιϦϡʔγϣϯΛผϕϯμʔʹد͍ͤͯ͘Մೳੑ͕͋Δ͔΋͠Εͳ͍ɺͱݴͬͯΈͨʢͣΔ͍ʣ 
  13. ʮ"841SPUPUZQJOH1SPHSBNͰղܾͰ͖Δ ͔΋͠Εͳ͍ͷͰɺݕ౼ͯ͠Έ·ͤΜ͔ʁʯ 

  14. "841SPUPUZQJOH1SPHSBNͱ͸ w "84Λ࢖࣮ͬͯݱ͍ͨ͠γεςϜͷϓϩτλΠϓΛɺ"84͕Ϣʔβʔͷ 
 ୅ΘΓʹ։ൃͯ͘͠ΕΔϓϩάϥϜ w "84ͷϓϩτλΠϓΤϯδχΞͱҰॹʹ։ൃ͢Δʢؙ౤͛Ͱ͸ͳ͍ʣ w ࣮ࡍͷϓϩδΣΫτ͕ର৅ w

    ϓϩάϥϜࣗମ͸ແঈ w "84ϓϩτλΠϐϯάνʔϜ๊͕͑Δଟ਺ͷϓϩτλΠϓީิͷத͔Β 
 ࠾༻͞ΕΔඞཁ͕͋Δ 
  15. "841SPUPUZQJOH1SPHSBNΛར༻ͯ͠Α͔ͬͨ͜ͱ w ࣮ݱ͍ͨ͜͠ͱ͕"84ͰͰ͖Δͷ͔෼͔Δ w lࢲͨͪʹͱͬͯz࠷దͳαʔϏε͸ͳʹʁ w ϓϩτλΠϓΤϯδχΞʹ࣭໰Ͱ͖Δ w ೲ඼ޙͷिؒ͸ΦϑΟεΞϫʔ 

  16. ͳͥ$MPVE'SPOU-BNCEB!&EHF͕࠷దͩͬͨͷ͔ w ΞʔΩςΫνϟબఆʹ͓͍ͯ࠷΋ॏࢹͨ͜͠ͱ w όοΫΤϯυͷΠϯϑϥߏ੒ͷมߋΛඞཁͱ͠ͳ͍ w ͍·(SBQI2-3VCZ͔Β"QQ4ZOD΁Ҡߦ͢ΔϝϦοτ͕গͳ͍ w $MPVE'SPOU-BNCEB!&EHFͷϝϦοτ w

    ಋೖ੾Γ཭͕͠ൺֱత༰қͰ͋Δ w ηΩϡϦςΟͷڧԽ "848"' "844IJFME"EWBODFEͷ׆༻
  17. ϓϩμΫγϣϯϦϦʔε·ͰͷಓͷΓ ͱಋೖޮՌ 

  18. ͲΜͳํ๏Ͱ$MPVE'SPOUʹ 
 (SBQI2-ͷϨεϙϯεΛΩϟογϡͤ͞Δͷʁ

  19. (SBQI2-ͱ$MPVE'SPOUͷ૬ੑ w ૬ੑ͸ྑ͘ͳ͍ w (SBQI2-ͷಛ௃ w ௨ৗ͸Ұͭͷ63-ΤϯυϙΠϯτ w ҰํͰɺ$MPVE'SPOUͷ#FIBWJPS͸ϦΫΤετͷύεύλʔϯʢ63-ʣຖʹΩϟογϡΦϒδΣΫτͷ 55-΍ΩϟογϡΩʔΛมߋ͢Δ͜ͱ͕Ͱ͖ΔʢॊೈͳΩϟογϡ੍ޚʣ

    w (SBQI2-͸جຊతʹ͸63-ΤϯυϙΠϯτ͕ҰͭͳͷͰɺॊೈͳઃఆ͸Ͱ͖ͳ͍ w ׳शతʹ1045ϝιουΛ࢖༻͢Δ w ҰํͰɺ$MPVE'SPOU͕ΩϟογϡͰ͖Δͷ͸(&5 )&"% 015*0/4ͷϦΫΤετͷϨεϙϯε݁ՌͷΈ w 1045ϦΫΤετͷϨεϙϯε݁ՌΛΩϟογϡͰ͖ͳ͍ͨΊɺ$%/Λ࢖͏ϝϦοτͷ൒෼͕ফ͑Δ w ͭ·Γɺ(SBQI2-αʔόʔͷલʹ$MPVE'SPOUΛஔ͚ͩ͘Ͱ͸ɺ"84άϩʔόϧωοτϫʔΫʹΑΔ௨৴ͷ҆ఆ Խͱɺ"848"'౳ͱ࿈ܞ͢Δ͜ͱʹΑΔηΩϡϦςΟڧԽɺͱ͍͏ϝϦοτ͔͠ಘΒΕͳ͍ 
  20. -BNCEB!&EHFͰ1045ˠ(&5ʹม׵ ͯ͠ɺ$MPVE'SPOU΁ϦΫΤετ͠௚͢ 

  21. (SBQI2-$BDIJOHPO"NB[PO$MPVE'SPOUͷ࢓૊Έ w  7JFXFS͕(SBQI2-ϦΫΤετ 1045 Λൃߦ͢Δ w  -BNCEB!&EHF ճ໨ͷ0SJHJO3FRVFTU

    Ͱ(&5ʹม׵͠ɺ$MPVE'SPOU΁ϦΫΤετΛൃߦ͢Δ 
 ͜ͷͱ͖ɺϦΫΤετϘσΟ 1BZMPBE Λ෼ׂͯ͠ΩϟογϡΩʔͱ͢Δϔομʔʹ֨ೲ͢Δ w  (&5ϦΫΤετ͕Ωϟογϡϛεͨ͠৔߹ɺ-BNCEB!&EHF ճ໨ͷ0SJHJO3FRVFTU Ͱ1045ʹ࠶ม׵͠ɺ0SJHJO΁ϦΫΤετΛൃߦ͢ Δ 
 ͜ͷͱ͖ɺΩϟογϡΩʔʹ֨ೲ͞ΕͨϦΫΤετϘσΟΛऔΓग़ͯ݁͠߹͠ɺ(SBQI2-ϦΫΤετ 1045 Λ࡞੒͢Δ w  -BNCEB!&EHF͕0SJHJO͔ΒϨεϙϯε݁ՌΛड͚औΓɺΩϟογϡϛεͨ͠(&5ϦΫΤετ ճ໨ͷ0SJHJO3FRVFTU͕ൃߦ ʹର͢ΔϨ εϙϯεͱͯ͠$MPVE'SPOU΁ฦ٫͢Δ 
 ͜ͷͱ͖ɺ$MPVE'SPOUʹΩϟογϡΦϒδΣΫτ͕࡞੒͞ΕΔ w  $MPVE'SPOU͔Β(&5ϦΫΤετͷϨεϙϯε݁Ռ͕-BNCEB!&EHF ճ໨ͷ0SJHJO3FRVFTU ʹฦ٫͞ΕΔͷͰɺ-BNCEB!&EHF͸ 7JFXFS͕ൃߦͨ͠(SBQI2-ϦΫΤετ 1045 ʹର͢ΔϨεϙϯεΛ࡞੒ͯ͠ɺ$MPVE'SPOU΁ฦ٫͢Δ 
 $MPVE'SPOU͸ɺ$MPVE'SPOU'VODUJPOT 7JFXFS3FTQPOTF Ͱ$034౳ͷಈతϔομʔΛ෇༩ͯ͠ɺ7JFXFS΁ϨεϙϯεΛฦ٫͢Δ 
  22. ϓϩμΫγϣϯϦϦʔε·ͰͷಓͷΓ w ղܾ͠ͳͯ͘͸ͳΒͳ͍՝୊͕͍ͭ͘΋͋ͬͨ w ΩϟογϡࣄނΛ๷͙ʢ๫࿐ରࡦʣ w ϦΞϧλΠϜੑͱͷόϥϯε w ΫϥΠΞϯτͷ*1औಘʹ޻෉͕ඞཁ w

    ҙਤͤͣΤϥʔϨεϙϯε͕Ωϟογϡ͞ΕΔ w FUD 
  23. ΩϟογϡࣄނΛ๷͙ʢ๫࿐ରࡦʣ w Ωϟογϡͯ͠͸͍͚ͳ͍ϨεϙϯεΛΩϟογϡ͢Δͱɺݸਓ৘ใ͕ྲྀग़ͯ͠͠·͏ w ྫ͑͹ɺϢʔβʔͷձһ৘ใͳͲ w ΩϟογϡࣄނΛىͯ͜͠͠·͏ͱࣄۀʹେ͖ͳѱӨڹΛ༩͑Δ w Ωϟογϡͯ͠Α͍ͷ͸ʮ୭͕ݟͯ΋ಉ͡ʢಉ͡Ͱ͋Δ΂͖ʣ"1*ͷϨεϙϯε݁Ռʯ͚ͩ w

    Ϩεϙϯεʹݸਓ৘ใؚ͕·ΕΔՄೳੑ͕͋Δ(SBQI2-ϦΫΤετ͸1045ˠ(&5΁ม׵͠ͳ͍Ͱɺ $MPVE'SPOU΁Ωϟογϡͤ͞ͳ͍Α͏ʹͨ͠ 
  24. -BNCEB!&EHFͰ1045ˠ(&5΁ม׵͢Δ৚݅ w ݸਓ৘ใͷྲྀग़Λ๷͙ͨΊʹ-BNCEB!&EHFͰϦΫ ΤετϘσΟΛݕࠪ͢ΔΑ͏ʹͨ͠ w ϨεϙϯεʹϢʔβʔͷݸਓ৘ใؚ͕·ΕΔϦΫ Τετ͸1045ˠ(&5΁ม׵͠ͳ͍ ʢ-BNCEB!&EHFΛᷖճͤ͞Δʣ w ೝূʹඞཁͳϔομʔ͕ͳ͍ϦΫΤετɺ

    
 αΠζ͕ඇৗʹେ͖͍ϦΫΤετ΋(&5ʹม׵͠ͳ ͍ w $MPVE'SPOUͷϔομʔͷΫΥʔλ w ݁߹͞ΕΔ͢΂ͯͷϔομʔ஋͓Αͼ໊લͷ ࠷େ௕ จࣈ 
  25. ಋೖޮՌ w ϦΫΤετͷճʹճ͸Ωϟογϡ)JU w $MPVE'SPOUͰ(SBQI2-$BDIJOHʹ੒ޭͨ͜͠ͱͰɺ 
 ৗ࣌ىಈ͓ͯ͘͠&$4λεΫ਺͕ݮͬͨͨΊɺ&$4ͷඅ༻͕Լ͕ͬͨ w λεΫ਺ͷεέʔϧ্ݶʹରͯ͠༨༟͕ੜ·Εͨ w

    "1*ͷߴ଎Խ w ΫϥΠΞϯτଆͰܭଌͨ͠ 
 "1*ͷϨεϙϯελΠϜ͕࠷େվળͨ͠ 
  26. (SBQI2-$BDIJOHͷΩϟογϡώοτ཰ w $MPVE'SPOUͷΩϟογϡώοτ཰͸ฏۉʢຊൃදͷϲ݄લ͔Βͷฏۉ ஋ʣ w ΦϦδϯ·Ͱ౸ୡ͢ΔϦΫΤετ਺͕ݮͬͨ͜ͱͰɺ&$4ͷλεΫ਺Λ 
 ݮΒ͢͜ͱ͕Ͱ͖ɺඅ༻࡟ݮʹͭͳ͕ͬͨ 

  27. "1*ͷߴ଎Խ w /FX3FMJD#SPXTFSͱ͍͏36. 3FBM6TFS .POJUPSJOH Λ༻͍ͯUJNF5P-PBE&WFOU4UBSU ͱ͍͏σʔλΛܭଌ͢Δͱɺϒϥ΢β͔Β"1* ΁ૹ৴͞Εͨ"+"9ϦΫΤετͷϨεϙϯελ ΠϜ͕େ͖͘୹ॖͨ͜͠ͱ͕෼͔ͬͨ w

    UJNF5P-PBE&WFOU4UBSU 
 ʮ"+"9ϦΫΤετͷ։͔࢝ΒɺͦͷϩʔυΠϕϯτ ͷ։࢝·Ͱͷ࣌ؒʢඵʣɻ 
 ͜ͷ஋͸ɺ୯ҰϖʔδΞϓϦʢ41"ʣ؂ࢹʹΑΔ "+"9ϦΫΤετͷ࣋ଓ࣌ؒΛද͠·͢ɻʯ 
  28. ຊൃදͷ·ͱΊ 

  29. w "84Ͱ΋ɺ$%/Ͱ(SBQI2-ΛΩϟογϡͰ͖Δ w (SBQI2-αʔόʔͷҠߦ͕ෆཁͳͷͰɺൺֱతࢼ͠΍͍͢ w ΤοδιϦϡʔγϣϯΛ࢖༻͢ΔϝϦοτ w ΤοδΩϟογϯάʹΑΔΦϦδϯͷෛՙܰݮͱ"1*ͷߴ଎Խ w ηΩϡϦςΟڧԽʢ"844IJFME"EWBODFE͕ར༻Ͱ͖Δʣ

    w Ωϟογϡ͸৻ॏʹʢ๫࿐ରࡦʣ w ࣮ݱ͍ͨ͜͠ͱ͕"84ͰͰ͖Δ͔෼͔Βͳ͔ͬͨΒɺ"84ͷਓʹ૬ஊͯ͠Έ Α͏ 
  30. &/% ຊൃදΛิ଍͢Δهࣄ΋ެ։༧ఆͰ͢