Slide 1

Slide 1 text

αʔόϨε࣌୅ʹ͓͚Δ ϔςϩδχΞε࣌ܥྻσʔλϕʔε ΞʔΩςΫνϟ ୈ2ճ Web System Architecture(WSA) ݚڀձ@෱Ԭ ͸ͯͳ id:y_uuki / @y_uuk1

Slide 2

Slide 2 text

id:y_uuki / @y_uuk1 Yuuki TSUBOUCHI https://yuuk.io/ ͸ͯͳͷ΢ΣϒΦϖϨʔγϣϯΤϯδχΞ WSAݚ ෭ࠪ

Slide 3

Slide 3 text

΋͘͡ 1. എܠͱ໨త 2. ΞʔΩςΫνϟ 3. ࣮૷ 4. ߟ࡯ 5. ·ͱΊͱࠓޙͷ՝୊

Slide 4

Slide 4 text

1. എܠͱ໨త

Slide 5

Slide 5 text

ߴ͍ੑೳΛ΋ͭ࣌ܥྻDBͷඞཁੑ • ΢ΣϒγεςϜ͕ෳࡶԽͨ݁͠ՌɺΑΓΑ͍ϞχλϦϯ άٕज़͕ඞཁͱ͞Ε͍ͯΔ • ΑΓΑ͍ϞχλϦϯάͷͨΊʹɺ࣌ܥྻσʔλΛߴස౓ ͔ͭେྔʹऩू͠ɺ௕ظؒอଘ͍ͨ͠

Slide 6

Slide 6 text

࣌ܥྻDBͷ࣮૷ํࣜ - ಺෦DBMSํࣜ • ࣌ܥྻσʔλϕʔεʹ࠷దԽ͞ΕͨΤϯδϯΛ࣮૷ • ੑೳͱσʔλอଘޮ཰͸Α͍܏޲͕͋Δ • ҰํͰɺ෼ࢄγεςϜͱͯ͠ͷ৴པੑʹ͍ͭͯɺ࣮ݧஈ ֊Ͱ͋Δ͜ͱ΋ଟ͍ • GraphiteɺInfluxDBɺPrometheusͳͲ [4]: Jensen, Søren Kejser, et al. "Time Series Management Systems: A Survey." IEEE Transactions on Knowledge and Data Engineering, vol.29, no.11, 2017, pp. 2581-2600. [5]: B. Mitschang et al. "Survey and Comparison of Open Source Time Series Databases.", In Proceedings of Database Systems for Business, Technology, and Web, 2017

Slide 7

Slide 7 text

࣌ܥྻDBͷ࣮૷ํࣜ - ֎෦DBMSํࣜ • ൚༻DBMS্ͷΞϓϦέʔγϣϯͱ࣮ͯ͠૷ • ෼ࢄγεςϜͱͯ͠ͷ৴པੑʹؔΘΔ࣮૷͕੒ख़͍ͯ͠ Δ܏޲͕͋Δ • ੑೳͱޮ཰͸಺෦DBMSํࣜʹྼΔ܏޲͕͋Δ • OpenTSDB(HBase)ɺKairosDB(Cassandra)ͳͲ [4]: Jensen, Søren Kejser, et al. "Time Series Management Systems: A Survey." IEEE Transactions on Knowledge and Data Engineering, vol.29, no.11, 2017, pp. 2581-2600. [5]: B. Mitschang et al. "Survey and Comparison of Open Source Time Series Databases.", In Proceedings of Database Systems for Business, Technology, and Web, 2017

Slide 8

Slide 8 text

࣌ܥྻDBͷ՝୊ • ಺෦DBMSํࣜͷߴՄ༻ੑɺεέʔϥϏϦςΟͷ੒ख़౓ • ಺෦DBMSํࣜͷߴՄ༻ੑ࣮૷ͷ೉͠͞ • ֎෦DBMSํࣜͷੑೳͱޮ཰ͷ௿͞ ߴ৴པੑΛٻΊΒΕΔϢʔεέʔεΛ૝ఆ͠ ֎෦DBMSํࣜΛ࠾༻ͭͭ͠ɺੑೳͱޮ཰ͷΑ͍Ξʔ ΩςΫνϟΛఏҊ͢Δ

Slide 9

Slide 9 text

ϔςϩδχΞε࣌ܥྻDBͷఏҊ • ಛੑͷҟͳΔෳ਺ͷ֎෦DBMSΛ૊Έ߹Θͤɺಁաతʹ ΞΫηεՄೳͳ࣌ܥྻDBΛఏҊ͢Δ • DiamondΞʔΩςΫνϟͱݺͿ͜ͱͱ͢Δ

Slide 10

Slide 10 text

2. ΞʔΩςΫνϟ

Slide 11

Slide 11 text

ΞʔΩςΫνϟͷཁ݅ • (a) ࣌ܥྻσʔλʹର͢Δߴ͍ॻ͖ࠐΈεέʔϧΞ΢τੑ • (b) ߴՄ༻ੑ • (c) ॻ͖ࠐΈI/Oͱσʔλอ࣋ͷͦΕͧΕʹ͍ͭͯɺߴ͍ίϯ ϐϡʔςΟϯάϦιʔεޮ཰ • (d) ϦιʔεͷϓϩϏδϣχϯά͓Αͼނো࣌ͷ෮چͷ༰қ͞ • (e) ݕূ͓Αͼ։ൃͷ༰қ͞

Slide 12

Slide 12 text

ಈ࡞ϑϩʔ ϝοηʔδ ϒϩʔΧʔ write path ΠϯϝϞϦ ,74 Φϯ44% ,74 Φϯ)%% ,74 SFBEFS OPEF read path XSJUFS OPEF flush flush

Slide 13

Slide 13 text

σʔλߏ଄ • KVSؒͰͷσʔλ੔߹ੑΛ͍͔ʹ୲อ͢Δ͔ • KVS্ͰҎԼͷ2఺Λୡ੒͠ɺղܾ͢Δ • (1) ࣌ܥྻσʔλͷ΂͖౳ॻ͖ࠐΈ • (2) Valueʹؚ·ΕΔσʔλϙΠϯτ਺ͷ࠷େ஋Λ੍ޚ • (1) ͸ϋογϡϚοϓʹΑΓ࣮ݱ • (2) ͸ղ૾౓ΞϥΠϯϝϯτͱλΠϜ΢Οϯυ΢ʹΑΓ࣮ݱ

Slide 14

Slide 14 text

σʔλߏ଄: ϋογϡϚοϓ • timestampΛΩʔɺvalueΛ஋ͱͨ͠ϋογϡϚοϓ • ϋογϡϚοϓʹର͢Δ্ॻ͖ʹΑΔ΂͖౳ॻ͖ࠐΈ͕ Մೳ • ௥هͷͨͼʹɺValueαΠζ͕૿େ͠ɺιϑτϦϛοτ ·ͨ͸ϋʔυϦϛοτΛ௒͑ΔՄೳੑ͕͋Δ (name) —> {timestamp:value, timestamp:value, ...}

Slide 15

Slide 15 text

σʔλߏ଄: λΠϜ΢Οϯυ΢ • ݻఆ෯ͷλΠϜ΢Οϯυ΢ͰϨίʔυΛ۠੾Δ • wtimestamp͸λΠϜ΢Οϯυ΢ͷ։࢝࣌ࠁ • ͔͠͠΢Οϯυ΢಺ͷσʔλϙΠϯτ਺ͷ࠷େ஋͸ෆఆ (name, wtimestamp) —> {timestamp:value,...}

Slide 16

Slide 16 text

σʔλߏ଄: ղ૾౓ΞϥΠϯϝϯτ • λΠϜελϯϓΛΞϥΠϯϝϯτͨ͠ޙʹॻ͖ࠐΉ͜ͱ ͰɺϨίʔυ಺σʔλϙΠϯτ਺ͷ࠷େ஋Λ੍ݶ͢Δ • ࣌ܥྻDB͕αϙʔτ͢Δղ૾౓ͷഒ਺ʹἧ͑Δ

Slide 17

Slide 17 text

3.࣮૷

Slide 18

Slide 18 text

ߏ੒ਤ ,JOFTJT 4USFBNT write path 3FEJT $MVTUFS %ZOBNP%# 4 SFBEFS read path -BNCEB flush flush [2]: ࣌ܥྻσʔλϕʔεͱ͍͏֓೦ΛΫϥ΢υͷٕͰ࠶ߏங͢Δ http://blog.yuuk.io/entry/the-rebuild-of-tsdb-on-cloud, 2017, AWS Summit Tokyo

Slide 19

Slide 19 text

KVSؒͷσʔλҠಈ: Redis => DynamoDB • όονॲཧͰ͸ͳ͘ɺσʔλϙΠϯτॻ͖ࠐΈ࣌ʹඞཁ ʹԠͯ͡Ҡಈͤ͞Δ • Redis্ͷ֘౰ϝτϦοΫܥྻʹؚ·ΕΔσʔλϙΠϯ τ਺͕NݸҎ্͔Ͳ͏͔ͰҠಈ൑ఆ͢Δ

Slide 20

Slide 20 text

KVSؒͷσʔλҠಈ: DynamoDB => S3

Slide 21

Slide 21 text

4. ߟ࡯

Slide 22

Slide 22 text

DiamondΞʔΩςΫνϟͷར఺ • (1) ࠷దԽ͞Εͨ಺෦DBMSํࣜͱൺ΂ɺॲཧޮ཰ͷ؍ ఺Ͱແବ͕ଟ͍ • (2) ֤KVSʹ࣮ͯ૷͞Ε͍ͯΔσʔλߏ଄͕ҟͳΔͨ Ίɺ͋ΔಛఆͷKVSʹ࣮૷͞Ε͍ͯΔಛघͳσʔλߏ଄ Λ࢖͍ͮΒ͍ • (3) ߏ੒͕ҰݟෳࡶʹΈ͑Δ

Slide 23

Slide 23 text

5. ·ͱΊͱࠓޙͷ՝୊

Slide 24

Slide 24 text

·ͱΊ • ॻ͖ࠐΈεέʔϧΞ΢τੑɺߴՄ༻ੑɺඅ༻ޮ཰ɺ௿͍ ӡ༻ੑɺ։ൃ༰қੑΛ࣮ݱ • ෳ਺ͷKVSΛ૊Έ߹ΘͤͨϔςϩδχΞεߏ੒ɺϝο ηʔδϒϩʔΧʔʹΑΔWALϦϓϨΠɺαʔόϨεΞʔ ΩςΫνϟɺ΂͖౳ੑɺσʔλ෯