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

エッジコンピューティングに向けた分散キャッシュ技術の調査 / edge caching survey

エッジコンピューティングに向けた分散キャッシュ技術の調査 / edge caching survey

Yuuki Tsubouchi (yuuk1)

April 13, 2019
Tweet

More Decks by Yuuki Tsubouchi (yuuk1)

Other Decks in Research

Transcript

  1. ͘͞ΒΠϯλʔωοτ
    גࣜձࣾ
    (C) Copyright 1996-2019 SAKURA Internet Inc
    ͘͞ΒΠϯλʔωοτ
    ݚڀॴ
    ΤοδίϯϐϡʔςΟϯάʹ޲͚ͨ
    ෼ࢄΩϟογϡٕज़ͷௐࠪ
    2019/04/13 ݚڀһ ௶಺ ༎थ
    ୈ4ճWebSystemArchitectureݚڀձ@ژ౎
    @yuuk1t / id:y_uuki

    View Slide

  2. 2
    1. എܠͱ໨త
    2. ΦϒδΣΫτΩϟογϡ
    3. ΫΤϦϦβϧτΩϟογϡ
    4. ·ͱΊ
    ໨࣍

    View Slide

  3. 1.
    എܠͱ໨త

    View Slide

  4. 4
    WebαʔϏεͷϢʔβʔͷମݧͷ޲্
    ɾԠ౴଎౓ͷվળʹΑΓɼϢʔβʔͷମݧ͕޲্͢Δ
    ɾ40%Ҏ্ͷWebαʔϏεͷϢʔβʔ͸ϖʔδͷಡΈࠐΈΛ3ඵҎ্଴
    ͯͳ͍ͱ͍͏ௐࠪ݁Ռ͕͋Δ[2]
    ɾಡΈࠐΈ஗ԆͷཁҼ
    ɾ(1) Ϋϥ΢υͷσʔληϯλʔ಺Ͱͷॲཧ஗Ԇ
    ɾ(2) ΤϯυϢʔβʔͱσʔληϯλʔؒͷωοτϫʔΫసૹ஗Ԇ
    ɾ(3) ϒϥ΢β্Ͱͷίϯςϯπදࣔ஗Ԇ
    ɾ(2)ͷ஗ԆΛ௿ݮ͢Δʹ͸ΤϯυϢʔβʔͷۙ๣Ͱॲཧ͢Δඞཁ͕͋Δ
    [2]: Forrester Consulting, "eCommerce Web Site Performance Today: An Updated Look At Consumer Reaction To A Poor Online Shopping Experience", 2019.

    View Slide

  5. 5
    CDNʹΑΔ੩తϑΝΠϧͷԠ౴ੑೳ޲্
    ɾCDN͸ɼΞΫηεݩ͔Β࠷΋͍ۙαʔόΛબ୒͠ɼϑΝΠϧΛ഑৴
    ͢Δ͜ͱʹΑΓɼωοτϫʔΫ஗ԆΛ௿ݮ͢Δ
    ɾ௨ৗɼCDNͷαʔό্ʹ഑ஔ͢Δίϯςϯπ͸Ωϟογϡͱͯ͠ར
    ༻͞ΕɼΦϦδϯͷίϯςϯπ͸σʔληϯλʔ্ʹ͋Δ
    ɾϑΝΠϧͰ͸ͳ͘ɼॲཧΛ഑ஔ͢Δ͜ͱʹΑΓಈతίϯςϯπΛߴ
    ଎ʹ഑৴͍ͨ͠

    View Slide

  6. 6
    CDNʹΑΔಈతίϯςϯπ഑৴
    ɾFastlyͳͲ͕ΩϟογϡͷແޮԽॲཧΛߴ଎Խ
    ɾෆཁͳΩϟογϡແޮԽΛ͠ͳ͍ͨΊʹɼίϯςϯπͷߏ੒෦Ґʹ
    λάΛ෇༩͢Δ͜ͱʹΑΓɼಈతʹมԽ͢Δ෦ҐͷΈΛແޮԽՄೳ

    View Slide

  7. 7
    CDN Edge Worker
    ɾCDNͷΤοδαʔό্Ͱཁٻʹରͯ͠೚ҙͷॲཧΛ࣮ߦ͍ͨ͠
    ɾϑΝΠϧͰ͸ͳ͘ɼΞϓϦέʔγϣϯΛϢʔβʔͷۙ๣ʹ഑ஔ͢Δ
    CDN Edge Workerͱݺ͹ΕΔαʔϏε͕ొ৔͍ͯ͠Δ
    ɾAWS [email protected][3]ɼCloudflare Workers[4]ɼfly.io[5]ͳͲ
    ɾϓϩάϥϛϯάݴޠॲཧܥͷ੍໿͸͋Δ

    View Slide

  8. 8
    ՝୊ͱݚڀ໨త
    ɾCDN؀ڥͰ͸ɼΤοδؒͱΤοδ-Ϋϥ΢υؒͷσʔλҰ؏ੑ͕ऑ
    ͘ɼΞϓϦέʔγϣϯϩδοΫΛΤοδ޲͚ʹ࠷దԽ͠ͳ͚Ε͹ͳ
    Βͳ͍ͱ͍͏՝୊͕͋Δ
    ɾσʔλҰ؏ੑΛڧΊɺΞϓϦέʔγϣϯΛมߋͤͣʹɺΤοδΛ׆
    ༻͠Ԡ౴ੑೳΛ޲্Ͱ͖ͳ͍͔ʁ
    ɾҎ্ͷ؍఺ͰɼωοτϫʔΫ஗ԆΛ௿ݮ͢ΔͨΊʹɼΤοδ্Ͱί
    ϯςϯπੜ੒΍഑৴ʹඞཁͳσʔλͷΩϟογϡΛ΋ͭͨΊͷ෼ࢄ
    Ωϟογϡٕज़Λௐࠪ͢Δ

    View Slide

  9. 9
    ΤοδίϯϐϡʔςΟϯά
    ɾIoTɼεϚʔτγςΟɼԾ૝ݱ࣮ͳͲਓʑͷ਎
    ۙʹίϯϐϡʔςΟϯά͕ਁಁ
    ɾਓΛ଴ͨͤͣʹԠ౴͠ͳ͚Ε͹ͳΒͳ͍
    ɾΫϥ΢υίϯϐϡʔςΟϯάͰ͸ɼωοτ
    ϫʔΫϨΠςϯγ͕େ͖͘ߴ଎ʹԠ౴Ͱ͖ͳ͍
    ɾΤϯυϢʔβʔͷۙ๣ʢΤοδʣʹαʔόΛ഑
    ஔͯ͠ɼཁٻΛॲཧ
    Cloud
    Edge
    Edge
    Edge
    Edge
    ωοτϫʔΫϨΠςϯγ࠷খԽ

    View Slide

  10. 10
    ຊݚڀʹ͓͚ΔΤοδͷείʔϓ
    ɾখɾதن໛ͳσʔληϯλʔɼϥοΫ୯Ґͷσʔληϯλʔ
    ɾΫϥ΢υͰల։͢ΔIaaS૬౰͔ͦΕҎ্ͷந৅౓ͷج൫͕ಈ࡞
    ɾج൫͕ఏڙ͢ΔαʔϏεͷൣғ಺ͰWebαʔϏε։ൃऀ͕؅ཧՄೳ
    ɾݱࡏɼఏҊɾ࣮ݱ͞Ε͍ͯΔ΋ͷͱͯ͠ɼCloudletɼMicro
    DataCenter·ͨ͸CDN Edge WorkerͳͲ͕͋Δ

    View Slide

  11. 2.
    ΦϒδΣΫτΩϟογϡ

    View Slide

  12. 12
    ΦϒδΣΫτΩϟογϡ
    ɾΞϓϦέʔγϣϯ͕೚ҙͷΦϒδΣΫτΛΩϟογϡ͢ΔͨΊͷػ
    ߏ
    ɾωοτϫʔΫܕͷ෼ࢄΩϟογϡ
    ɾΞϓϦέʔγϣϯϓϩηεͱಉҰͷϝϞϦۭؒʹΩϟογϡσʔλ
    Λอ࣋͢Δ૊ΈࠐΈܕͷ෼ࢄΩϟογϡ

    View Slide

  13. 13
    ωοτϫʔΫܕͷ෼ࢄΩϟογϡ
    ɾΞϓϦέʔγϣϯϓϩηε͕ωοτϫʔΫ௨
    ৴ͯ͠ར༻͢Δ
    ɾෳ਺ͷΩϟογϡϊʔυ΁ෛՙ෼ࢄ͢ΔͨΊ
    ʹɼϋογϡ๏Λར༻͢Δ
    ɾΦϒδΣΫτͷΩʔͱ෼ࢄઌͷΩϟογϡ
    ϊʔυΛඥ͚ͮ͠ɼΦϒδΣΫτ୯ҐͰ෼ࢄ͞
    ͤͯΩϟογϡϊʔυ΁σʔλΛ഑ஔ͢Δ
    ɾMemcached΍Redis͕ར༻͞ΕΔ
    ɾΩϟογϡϊʔυಉ࢜͸ڠௐ͍ͯ͠ΔΘ͚Ͱ
    ͸ͳ͍
    Cache
    Node
    Cache
    Node
    Cache
    Node
    App
    Node

    View Slide

  14. App
    Node
    14
    ૊ΈࠐΈܕͷ෼ࢄΩϟογϡ(Groupcache)
    ɾෳ਺ͷϊʔυ͕ڠௐͯ͠ҰͭͷΩϟογϡۭؒ
    Λ࡞੒Մೳ
    ɾσʔλΛੵۃతʹڞ༗͠ͳ͍
    ɾϐΞϊʔυ͸ίϯγεςϯτϋογϡ๏ʹΑΓ
    બ୒͞ΕΔ
    ɾϩʔΧϧͰͷΩϟογϡϛε࣌ʹ͢΂ͯͷϐ
    ΞʹϑΥʔϧόοΫ͠ͳͯ͘Α͍
    ɾߋ৽ͱ࡟আΛαϙʔτ͓ͯ͠ΒͣɼLRUʹΑΓ
    Ωϟογϡ͕ഁغ͞Εͳ͍͔͗Γɼීวͷσʔ
    λΛ֨ೲ͢Δ
    Cache
    App
    Node
    Cache
    App
    Node
    Cache
    ᶃ ϩʔΧϧΩϟογϡऔಘ
    ᶅϩʔΧϧ
    Ωϟογϡ
    ʹ֬཰తʹ
    ॻ͖ࠐΈ
    ᶄϐΞϊʔυ΁ϑΥʔϧόοΫ


    View Slide

  15. 15
    ΤοδίϯϐϡʔςΟϯά΁ͷల։
    ɾ௿ϨΠςϯγͰΩϟογϡΛऔಘ͢ΔͨΊʹɼۙྡͷΤοδʹ഑ஔ͞
    ΕͨΩϟογϡϊʔυ͔ΒσʔλऔಘΛ׬͍݁ͨ͠
    ɾΤοδ܈ΛΤϦΞʹ۠੾ΓɼΤϦΞ͝ͱʹΩϟογϡΫϥελΛ༻ҙ
    ͢Δ
    ɾԾʹΩϟογϡͷࢀরύλʔϯ͕ಉ͡ΤϦΞʹภΔ৔߹ɼͳΜΒ͔ͷ
    ํ๏Ͱڑ཭͕͍ۙΤοδ܈Λೝࣝ͢Δ͜ͱʹΑΓɼۙ๣Τοδ಺Ͱ׬
    ݁ͯ͠ΩϟογϡΛಡΈॻ͖Մೳ

    View Slide

  16. 3.
    ΫΤϦϦβϧτΩϟογϡ

    View Slide

  17. 17
    ΫΤϦϦβϧτΩϟογϡ
    ɾσʔλϕʔεϛυϧ΢ΣΞͷ૚ͰɼΫΤϦ݁ՌΛΩϟογϡ͢Δ࢓
    ૊Έ
    ɾDBαʔόܕΫΤϦΩϟογϡ
    ɾϓϩΩγܕΫΤϦΩϟογϡ
    ɾProxySQL (ελϯυΞϩʔϯ)
    ɾDBProxy (෼ࢄڠௐ)
    ɾFerdinand (෼ࢄڠௐ)

    View Slide

  18. 18
    DBαʔόܕΫΤϦΩϟογϡ
    ɾσʔλϕʔεαʔόࣗମ͕ΩϟογϡػߏΛ΋ͭ
    ɾ௥Ճͷιϑτ΢ΣΞͳ͠ʹར༻Մೳ
    ɾMySQLͷΫΤϦΩϟογϡ͸͜Εʹ֘౰
    ɾMySQL͸ɺςʔϒϧʹߋ৽͕͋Ε͹ɼ౰֘ςʔϒϧͷมߋ͕݁Ռʹ
    Өڹ͢ΔΫΤϦͷΩϟογϡΛഁغ͢ΔͨΊɺςʔϒϧͱΩϟο
    γϡؒͰҰ؏ੑ͸อͨΕΔ
    ɾ→ Ωϟογϡώοτ཰͕௿͍
    ɾΩϟογϡͦͷ΋ͷΛϢʔβʔͷۙ๣ʹ഑ஔͰ͖ͳ͍ͨΊɼωοτ
    ϫʔΫ஗Ԇͷ௿ݮ͸Ͱ͖ͳ͍

    View Slide

  19. 19
    ϓϩΩγܕΫΤϦΩϟογϡ: ProxySQL
    ɾMySQLϓϩτίϧΛղऍ͢Δಠཱϓϩηεͱͯ͠ىಈ͢ΔϓϩΩγ
    ɾMySQLαʔόΑΓ΋ΑΓϑϩϯτΤϯυʹ͍ۙҐஔʹ഑ஔՄೳ
    ɾΞϓϦέʔγϣϯαʔόͱಉҰͷϗετ্ʹ഑ஔ͢Δ͜ͱʹΑΓɼ
    ΞϓϦέʔγϣϯαʔόͱMySQLαʔόؒͷRTTΛ࡟ݮ
    App
    Node
    Proxy
    SQL
    App
    Node
    Proxy
    SQL
    MySQL
    Server
    ɾTTL(Time to Live)Λར༻ͯ͠ΩϟογϡΛແ
    ޮԽ͢ΔͨΊɼΞϓϦέʔγϣϯʹݹ͘ͳͬ
    ͨσʔλΛฦ͢Մೳੑ͕͋Δ
    ɾ෼ࢄڠௐͯ͠ಈ࡞͢ΔΘ͚Ͱ͸ͳ͍

    View Slide

  20. 20
    ϓϩΩγܕΫΤϦΩϟογϡ: DBProxy
    ɾΤοδ্ʹ഑ஔ͞Ε֤ͨΞϓϦέʔγϣϯαʔό͕தԝͷσʔλ
    ϕʔεαʔόʹର͢ΔΫΤϦ݁ՌΛΩϟογϡ
    ɾΫΤϦ݁Ռ͕ଞͷΫΤϦʹΑΓΩϟογϡ͞ΕͨσʔλʹΑΔߏங
    Ͱ͖ΔͷͰ͋Ε͹ɼະΩϟογϡͷΫΤϦͷ݁ՌΛฦ͢
    App
    Node
    DB
    Proxy
    App
    Node
    DB
    Proxy
    DB
    Server
    ɾߋ৽Λߪಡ͠ετϦʔϜͰҰ؏ੑΛอূ
    ɾதԝूݖతʹҰ؏ੑΛ؅ཧ͢Δ͜ͱʹΑ
    Γɼ֤Ωϟογϡ͸தԝσʔλϕʔεʹର͠
    ͯίώʔϨϯτ
    ɾΫΤϦΩϟογϡΛར༻͢Δෳ਺ͷεςʔ
    τϝϯτΛؚΉτϥϯβΫγϣϯʹ͸ରԠͰ
    ͖ͳ͍
    Subscribe
    Update

    View Slide

  21. 21
    ϓϩΩγܕΫΤϦΩϟογϡ: Ferdinand
    ɾಈతίϯςϯπ഑৴ͷͨΊͷڠௐಈ࡞͢ΔΫΤϦΩϟογϡϓϩΩγ
    ɾτϐοΫϕʔεͷpub/subϞσϧʹΑΓɼΩϟογϡͷҰ؏ੑΛҡ࣋
    ɾҰ؏ੑʹ͍ͭͯ͸DBProxyͱಉ༷
    ɾ෼ࢄϋογϡςʔϒϧΛར༻͢
    ΔͨΊɼ֤ϓϩΩγ͕ಉ͡σʔ
    λΛڞ༗͍ͯ͠ͳ͍
    ɾΩϟογϡϛεͯ͠΋ଞͷϓϩ
    Ωγϊʔυ΁ϑΥϫʔυ
    ɾγϯϓϧͳΩϟογϡͱൺֱ
    ͠ɺ3ഒͷੑೳ޲্ ग़య: [9]: C Garrod, et al., "Scalable query result caching for web applications", VLDB
    Endowment, vol.1, no.1, pp.550-561, 2008

    View Slide

  22. 22
    ϓϩΩγܕΫΤϦΩϟογϡ: Ferdinand
    ɾϓϩΩγαʔόؒͱதԝσʔλ
    ϕʔεؒͷ஗Ԇͱεϧʔϓοτͷ
    ؔ܎
    ɾ஗Ԇ50msఔ౓ͰFerdinandͷε
    ϧʔϓοτ͕SimpleCacheΑΓ௿
    ɾ(౦ژ-ੴङؒͰ20msະຬఔ౓)
    ɾFerdinandͷϩʔΧϧͱϚελʔ
    Ωϟογϡͷ྆ํͷΩϟογϡϛ
    ε࣌ͷωοτϫʔΫϗοϓͷͨΊ

    View Slide

  23. 4.
    ·ͱΊ

    View Slide

  24. 24
    ·ͱΊ
    ɾWebαʔϏεͷϢʔβʔମݧ޲্ͷͨΊʹΤϯυϢʔβʔͷۙ๣Ͱ
    ཁٻΛॲཧ͍ͨ͠
    ɾCDNɼCDN Edge Worker͸ΤοδؒͰσʔλΛڞ༗͢Δͱ͖ʹҰ
    ؏ੑͷ՝୊Λ΋ͭ
    ɾಡΈग़͠ੑೳ޲্ͷͨΊͷ෼ࢄΩϟογϡٕज़Λௐࠪ
    ɾΩϟογϡΛڞ༗ͤͣɼίϯγεςϯτϋογϡ๏΍Groupcacheͷ
    ڠௐΩϟογϯάɼ෼ࢄϋογϡςʔϒϧΛར༻͢Δ͜ͱ͕͋Δ
    ɾΤοδίϯϐϡʔςΟϯάʹ͓͍ͯ΋ɼ͢΂ͯͷΤοδͰΩϟο
    γϡΛڞ༗ͤͣʹɼΩϟογϡ͕ঃʑʹඞཁͱ͞ΕΔ৔ॴʹҠಈ͢
    ΔΑ͏ͳ࢓૊ΈΛߟ͑ΒΕͳ͍͔

    View Slide

  25. 25
    ࠓޙͷ՝୊
    ɾP2P΍Content-Centric Network(CCN)ͳͲͷΫϥ΢υͰ͸ͳ͘ɼΤ
    ϯυσόΠε΍ωοτϫʔΫϧʔλʔͰॲཧΛ͢ΔΑ͏ͳख๏ͷௐ

    View Slide