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

MicroservicesのCache戦略

kosako
August 30, 2018

 MicroservicesのCache戦略

Microservices Meetup vol.8 Lightning Talks Battle!
https://microservices-meetup.connpass.com/event/99190/
でLTしたときの資料

kosako

August 30, 2018
Tweet

More Decks by kosako

Other Decks in Technology

Transcript

  1. .JDSPTFSWJDFTͷ$BDIFઓུ

    .JDSPTFSWJDFT.FFUVQWPM-JHIUOJOH5BMLT#BUUMF
    "LJIJSP,PTBLP

    View full-size slide

  2. ɾ"LJIJSP,PTBLP
    ɾٕज़౷ׅ.(3
    ɾ΍ͬͯΔ͜ͱ
    ΤϯδχΞ૊৫Ϛωδϝϯτ
    શମͷϓϩμΫτϚωʔδϟʔ
    ٕज़ෛ࠴΍՝୊΁ͷऔΓ૊Έ
    ΋ͱ΋ͱ͸J04ΞϓϦാ
    About Me

    View full-size slide

  3. ࠃ಺/P໊࣮άϧϝαʔϏε3FUUZͷӡӦ
    ݄ؒສ66
    ೔ຊɾ߳ߓɾλΠͰαʔϏεఏڙ

    View full-size slide

  4. w 1)1ͰϞϊϦγοΫ ਺(#

    w ೥ϞϊͷϨΨγʔίʔυ
    w ΞϓϦ༻ͷ"1*ͳͲҰ෦͸ผαʔϏεͱͯ͠੾Γग़͕ͨ͠ɺ
    ґવͱͯ͠8ͷओཁ෦෼͕ϞϊϦγοΫͳ··
    w ฐࣾ΋෼அ͞ΕͨϞϊϦεঢ়ଶͰ͢ ͍ͭ࠷͍ۙΖ͍Ζऔ
    Γ૊Έ࢝Ίͨ

    RettyͷαʔϏεʹ͍ͭͯ

    View full-size slide

  5. ݱࡏ.JDSPTFSWJDFTԽ͍ͯͨ͘͠Ίͷ
    ϓϩδΣΫτΛ࣮ࢪத

    View full-size slide

  6. ·ͩ࡞ΓதͳͨΊؒҧ͍ͬͯΔͱ͜Ζ͕͋Ε͹
    ͥͻࢦఠΛ͓ئ͍͠·͢

    View full-size slide

  7. w ޮ཰త
    w αʔϏεཁ݅ʹద͍ͯ͠Δ
    Microservicesʹ͓͚ΔCacheઓུ

    View full-size slide

  8. CacheͷλΠϓ
    w 55-
    Ұఆͷ࣌ؒΩϟογϡ͢Δ
    TTL͕ઃఆ͞Εɺͦͷؒݩσʔλ͕ߋ৽͞Εͨͱͯ͠΋มߋ͕൓ө͞Εͳ͍
    w Ұ؏ੑ
    DB CacheͷΑ͏ͳσʔλͷҰ؏ੑ͕อূ͞Ε͍ͯΔλΠϓ

    σʔλͷߋ৽࣌ʹΩϟογϡΛΫϦΞͨ͠Γɺॻ͖׵͑Δ

    View full-size slide

  9. TTLλΠϓ
    w ؾΛ͚ͭͳ͍ͱ໰୊͕ى͖΍͍͢
    w ଟॏΩϟογϡ͞ΕΔߏ଄ʹͳ͍ͬͯΔͱߋ৽࣌ظ͕ίϯ
    τϩʔϧͰ͖ͳ͍
    w ಛఆͷσʔλΛ࠷৽ʹͰ͖ͳ͍ͱ͍ͬͨ͜ͱ΍ɺ55-ͷઃ
    ఆͷϛεʹΑͬͯΩϟογϡ͕͍ͭ·Ͱ΋ͷ͜ΔͳͲ

    View full-size slide

  10. "1*

    (BUFXBZ
    .JDSPTFSWJDF
    .JDSPTFSWJDF
    .JDSPTFSWJDF
    3%#
    3%#
    .JDSPTFSWJDF
    .JDSPTFSWJDF

    View full-size slide

  11. "1*

    (BUFXBZ
    .JDSPTFSWJDF
    .JDSPTFSWJDF
    .JDSPTFSWJDF
    3%#
    3%#
    .JDSPTFSWJDF
    .JDSPTFSWJDF
    $%/

    View full-size slide

  12. API Gateway Cache
    w ͦ΋ͦ΋ύϑΥʔϚϯεʹ໰୊ͳ͍ͳΒͳͯ͘Α͍
    w બ୒ࢶ͕͋Δ
    w "1*"HHSFHBUJPOͨ݁͠ՌͷσʔλΛΩϟογϡ͢Δ
    w "HHSFHBUJPOલͷσʔλΛΩϟογϡ͢Δ

    View full-size slide

  13. Aggregationͨ݁͠ՌͷσʔλΛCache
    w γϯϓϧ੍͕ͩ໿͕ଟ͍
    w QSPT
    w ؅ཧ͕ൺֱతϥΫ
    w σʔλͷϦϑϨογϡ΋γϯϓϧ
    w DPOT
    w 55-Λ௕͘͠ਏ͍
    w ҰׅͰ͔͠Ωϟογϡͷߋ৽͕Ͱ͖ͳ͍
    w Ωϟογϡޮ཰͕ѱ͘ͳΓ΍͍͢
    w ࡉ͔͍νϡʔχϯά͸΍ΓͣΒ͍
    w ղܾͰ͖ͳ͍໰୊͕ग़ͯ͘ΔՄೳੑ͕͋Δ

    View full-size slide

  14. AggregationલͷσʔλΛCache
    w ෳࡶ͕ͩΩϟογϡޮ཰͸Α͍
    w QSPT
    w .JDSPTFSWJDF͝ͱʹద੾ͳ55-ΛઃఆͰ͖Δ
    w Ωϟογϡޮ཰Λߴ͘Ͱ͖Δ
    w ॏͯ͘ߋ৽ස౓͕௿ͯ͘Α͍ΩϟογϡΛ௕ͨ͘͠ΓͰ͖Δ
    w DPOT
    w ؅ཧ͕ෳࡶʹ΍Γ΍͍͢
    w 55-ͷઃܭ΍ઃఆ͕.JDSPTFSWJDF͝ͱʹඞཁ
    w σʔλͷϦϑϨογϡ͕ෳࡶ

    View full-size slide

  15. w αʔϏεͷཁ݅ʹΑͬͯΩϟογϡઓུ͸ҟͳΔ
    w ݱࡏͱ͋Δఔ౓ະདྷΛΛݟਾ͑ͨΩϟογϡઓུ͕ඞཁ
    w "1*(BUFXBZͰͷ$BDIF͸Α͘ߟ͑ͯ࠾༻͠Α͏
    ·ͱΊ

    View full-size slide

  16. 8F`SF)JSJOH
    IUUQTDPSQSFUUZNFSFDSVJU

    View full-size slide