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

TimeFuzeアーキテクチャ構想 / The concept of TimeFuze Architecture

TimeFuzeアーキテクチャ構想 / The concept of TimeFuze Architecture

第1回ウェブシステムアーキテクチャ(WSA)研究会@京都

Yuuki Tsubouchi (yuuk1)

December 23, 2017
Tweet

More Decks by Yuuki Tsubouchi (yuuk1)

Other Decks in Research

Transcript

  1. TimeFuzeΞʔΩςΫνϟߏ૝
    ͸ͯͳ id:y_uuki / @y_uuk1
    2017/12/23 ୈ1ճ΢ΣϒγεςϜΞʔΩςΫνϟ(WSA)ݚڀձ@ژ౎
    ॲཧͱσʔλͱλΠϚʔΛҰମԽͨ͠σʔλύΠϓϥΠϯ

    View full-size slide

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

    View full-size slide

  3. ࣌ݶ৴؅
    Time Fuze

    View full-size slide

  4. ىര૷ஔ+Րༀ+λΠϚʔ

    View full-size slide

  5. ॲཧ+σʔλ+λΠϚʔ

    View full-size slide

  6. TimeFuze
    ΞʔΩςΫνϟ

    View full-size slide

  7. ΋͘͡
    1. എܠͱ໨త
    2. TimeFuzeΞʔΩςΫνϟ
    3. ߟ࡯
    4. Ή͢ͼ

    View full-size slide

  8. 1. എܠͱ໨త

    View full-size slide

  9. WebαʔϏεͷσʔλॲཧཁٻͷෳࡶԽ
    • ϦΫΤετʹରͯ͠HTMLͷϨεϙϯεΛฦ٫͢ΔҎ֎
    ͷϫʔΫϩʔυͷଟ༷Խ͕ਐΜͰ͍Δ
    • ੑೳಛੑͷҟͳΔσʔλετΞͷซ༻΍ɺػցֶशʹΑ
    Δ࣌ؒपظͰͷେن໛ͳσʔλॲཧΛٻΊΒΕ͍ͯΔ
    • εέʔϧͤ͞΍͍͢σʔλύΠϓϥΠϯॲཧ͕ඞཁ

    View full-size slide

  10. ҰൠͷσʔλύΠϓϥΠϯ
    DataSource
    Data
    Destination
    όονॲཧ
    λΠϜεέδϡʔϥʔ
    ىಈ

    View full-size slide

  11. ҰൠͷσʔλύΠϓϥΠϯͷ՝୊
    • σʔλྔ૿େʹ͋ΘͤͨεέʔϦϯάӡ༻ͷ೉͠͞
    • όονॲཧ్தͷΤϥʔॲཧͷ೉͠͞
    • λΠϜεέδϡʔϥͦͷ΋ͷͷӡ༻ͷ൥ࡶ͞
    • ࣮ߦස౓ઃఆͷॊೈੑͷ௿͞

    View full-size slide

  12. σʔλ λΠϚʔ
    σʔλͱॲཧͱλΠϚʔͷҰମԽϞσϧͷఏҊ
    ॲཧ
    DataSource
    σʔλ λΠϚʔ ॲཧ
    DataDestination

    View full-size slide

  13. ҰൠͷσʔλύΠϓϥΠϯͷ՝୊ͷղܾ
    • σʔλྔ૿େʹ͋ΘͤͨεέʔϦϯάӡ༻ͷ೉͠͞
    • ࠷ॳ͔ΒฒߦॲཧΛલఏͱͨ͠ΞʔΩςΫνϟͰղܾ
    • όονॲཧ్தͷΤϥʔॲཧͷ೉͠͞
    • όονॲཧͰ͸ͳ͘Ϩίʔυ୯ҐͰδϣϒఆٛͰղܾ
    • λΠϜεέδϡʔϥͦͷ΋ͷͷӡ༻ͷ൥ࡶ͞
    • σʔλετΞͷTTLʹΑΓεέδϡʔϥϗετ͕ෆཁ
    • ࣮ߦස౓ઃఆͷॊೈੑͷ௿͞
    • λΠϚʔઃఆͷཻ౓ΛϨίʔυ୯ҐͰઃఆ͢Δ͜ͱͰղܾ

    View full-size slide

  14. http://blog.yuuk.io/entry/the-rebuild-of-tsdb-on-cloud

    View full-size slide

  15. ֊૚ܕσʔλετΞߏ଄ͷ࣌ܥྻσʔλϕʔε
    ΠϯϝϞϦ
    DB
    ΦϯσΟεΫ
    DB
    ΦϒδΣΫτ
    ετϨʔδ
    ৽ ݹ
    ߴ ҆
    ஗ ଎

    View full-size slide

  16. ֊૚ܕσʔλετΞͷ೉͍͠ͱ͜Ζͱղܾ
    • σʔλετΞؒͷσʔλҠಈύΠϓϥΠϯͷεέʔϥϏ
    ϦςΟ
    • ಛఆͷϨίʔυͷΈɺσʔλετΞҠಈλΠϛϯάΛ੍
    ޚ͢Δ
    • ͜ΕΒΛTimeFuzeΞʔΩςΫνϟʹΑΓղܾ
    • DynamoDBͷTTLͱLambda TriggerʹΑΔ࣮૷

    View full-size slide

  17. ͦͷଞͷTimeFuzeͷద༻ΞϓϦέʔγϣϯྫ
    • ࣌ܥྻσʔλҟৗݕ஌ͷֶशϞσϧͷఆظߋ৽
    • Ϛϧνςφϯτ؀ڥʹ͓͚Δେن໛ͳSSL/TLSূ໌ॻߋ

    View full-size slide

  18. 2. TimeFuzeΞʔΩςΫνϟ

    View full-size slide

  19. 1. insert
    DataSource
    record
    Data
    TTL
    DataDestination
    Trigger
    Other
    API/DataStore
    record
    2. expire 3. insert or update

    View full-size slide

  20. TimeFuzeͷϝϦοτ
    • ฒߦॲཧΛલఏͱͨ͠ΞʔΩςΫνϟͰ͋Δ͜ͱ
    • Τϥʔ͔Βͷճ෮ॲཧ͕༰қͰ͋Δ͜ͱ
    • λΠϜεέδϡʔϥͱόονॲཧͷͨΊͷϗετ΋͘͠
    ͸Ϋϥελͷߏஙɾӡ༻͕ෆཁͰ͋Δ͜ͱ
    • Ϩίʔυ୯ҐλΠϚʔʹΑΓɺδϣϒͷ࣮ߦස౓ΛϨίʔ
    υ୯ҐͰௐ੔ՄೳͰ͋Δ͜ͱ

    View full-size slide

  21. AWSʹΑΔ࣮૷

    View full-size slide

  22. DynamoDB TTL + Lambda Trigger
    • DynamoDB: ϑϧϚωʔδυܕͷNoSQLσʔλϕʔε
    αʔϏεɻTTLΛαϙʔτ͍ͯ͠Δɻ
    • Lambda: ΠϕϯτൃՐΛܖػʹFunctionΛݺͼग़ͤΔ
    • DynamoDB্ͷϨίʔυʹର͢ΔTTLظݶ੾ΕΠϕϯτ
    ΛܖػʹɺLambda FunctionΛτϦΨʔͱ࣮ͯ͠ߦ

    View full-size slide

  23. 1. insert
    DynamoDB
    record
    Data
    TTL
    DynamoDB,S3,…
    Lambda
    Other
    API/DataStore
    record
    2. expire 3. insert or update

    View full-size slide

  24. ΦϯϓϨϛε؀ڥͰͷ࣮૷

    View full-size slide

  25. Redis Keyspace௨஌ + ϝοηʔδΩϡʔ
    • RedisͷKeyspace௨஌ػೳʹΑΓTTLΠϕϯτΛߪಡͰ͖
    Δ
    • ͨͩ͠ɺ҆શͳτϦΨʔॲཧͷͨΊʹɺߪಡͨ͠Πϕϯ
    τΛϝοηʔδΩϡʔʹΑΓӬଓԽ͢Δඞཁ͕͋Δ
    • ݴޠ໰Θͣར༻͠΍͍͢ϝοηʔδΩϡʔͱͯ͠
    Fireworq͕͋Δ

    View full-size slide

  26. TimeFuzeͷ
    ۩ମతͳΞϓϦέʔγϣϯ
    ͷద༻

    View full-size slide

  27. ࣌ܥྻσʔλͷҟৗݕ஌
    • ऩूͨ͠ϝτϦοΫܥྻʹରͯ͠ɺֶशϞσϧΛߏங
    • ৽نϝτϦοΫͷରԠͷͨΊϞσϧΛఆظతʹߋ৽͢Δ
    • ଞͷσʔλετΞʹҠಈ͢ΔΘ͚Ͱ͸ͳ͘ɺDataSource
    ͱDataDestination͸ಉҰͷσʔλετΞΛར༻
    • ֶ֤शϞσϧͷϨίʔυʹTTLΛઃఆ͠ɺTriggerͰֶश
    ॲཧޙɺϞσϧΛߋ৽͢Δ

    View full-size slide

  28. 1. insert
    DataSource
    record
    Metric
    TTL
    Trigger
    ࣌ܥྻ
    σʔλϕʔε
    2. expire
    3. update
    ֶशॲཧ

    View full-size slide

  29. େن໛SSL/TLSূ໌ॻ؅ཧ
    • ϒϩάαʔϏεͳͲͰେྔͷSSL/TLSূ໌ॻΛ؅ཧ͠ɺ
    ਺ϲ݄͝ͱʹߋ৽͢Δέʔε
    • ূ໌ॻΛσʔλϕʔεʹ֨ೲ͠ಈతऔಘ͢ΔΞʔΩςΫ
    νϟΛલఏͱ͢Δ
    • ֤υϝΠϯʹର͢Δূ໌ॻϨίʔυʹTTLΛઃఆ͠ɺ
    Trigger͕ূ໌ॻΛ࠶औಘ͠ɺDataDestination΁্ॻ͖

    View full-size slide

  30. 1. insert
    DataSource
    record
    ূ໌ॻ
    TTL
    Trigger Let’s Encrypt
    2. expire
    3. update
    ূ໌ॻ
    ߋ৽ॲཧ

    View full-size slide

  31. TimeFuzeͷσϝϦοτ
    • ΞʔΩςΫνϟϨϕϧ
    • DataSource্ͷෳ਺ͷϨίʔυΛϚʔδ͢ΔॲཧΛͮ͠Β͍
    • ࣮૷Ϩϕϧ
    • Ұ࣌తʹϨίʔυ͕࡟আ͞ΕΔͨΊɺσʔλͷҰ؏ੑͷ޻෉
    ͕ඞཁ
    • TTLظݶ͔Β࡟আॲཧ։࢝·ͰͷσΟϨΠ͕࣌ؒϕετΤ
    ϑΥʔτͳͨΊɺִ࣌ؒؒ

    View full-size slide

  32. TimeFuzeͷσϝϦοτղܾҊ
    • TTLΛར༻ͤͣɺTime to EventػೳΛσʔλετΞʹ૊
    ΈࠐΉ
    • Time to Eventػೳ͸ઃఆͨ࣌͠ࠁΛܦաͨ͠Πϕϯτ
    ͷΈΛൃߦ͠ɺϨίʔυ࡟আ͸͠ͳ͍

    View full-size slide

  33. Ή͢ͼ
    • εέʔϧͤ͞΍͍͢σʔλύΠϓϥΠϯΞʔΩςΫνϟ͕
    WebαʔϏε։ൃʹٻΊΒΕ͍ͯΔ
    • ୯ҰͷλΠϜεέδϡʔϥʔʹΑΔσʔλύΠϓϥΠϯͷ
    ՝୊ΛɺσʔλͱॲཧͱλΠϚʔͷҰମԽʹΑΓղܾ͢Δ
    ख๏ΛఏҊͨ͠
    • ࣮૷ͷ໰୊ʹΑΓɺݱஈ֊Ͱ͸࣮ӡ༻͢ΔͨΊʹΞϓϦέʔ
    γϣϯͷ޻෉͕ඞཁͱͳΔ

    View full-size slide

  34. ࠓޙͷऔΓ૊Έ
    • طଘͷఆظσʔλύΠϓϥΠϯͷ՝୊ΛαʔϕΠ͠੔ཧ
    • طଘσʔλετΞ࣮૷ͷTTLσΟϨΠ࣌ؒͷௐࠪ
    • طଘͷσʔλετΞ΁ͷTime to Eventͷ૊ΈࠐΈ

    View full-size slide

  35. ࣗ཯ੑͷ͋ΔσʔλॲཧͷՄೳੑ
    • VM => ίϯςφ, ίϯςφ => εϨου
    • σʔλϕʔε => ςʔϒϧ, ςʔϒϧ => σʔλϨίʔυ

    View full-size slide

  36. SRE/ΦϖϨʔγϣϯΤϯδχΞͷઓ৔
    • TimeFuzeͷΑ͏ͳσʔλॲཧΞʔΩςΫνϟΛ࢓ࣄʹ͸͍ͯ͠ͳ͍
    • ௚ۙͰ΍͍ͬͯΔ͜ͱ͸ɺΠϯϑϥετϥΫνϟࣗମͷมߋ଎౓Λ࠷
    େԽ͢Δ࢓ࣄ
    • ج൫ͷந৅౓͕͕͋ΔʹͭΕɺSREͷ࢓ࣄ͕ΑΓࣄۀʹۙ͘ͳ͍ͬͯ͘
    • ࣄۀʹ͍ۙ΄Ͳɺந৅Խ͕೉͘͠ͳΓج൫Ͱٵऩͮ͠Β͘ͳΔ
    • ෳ਺ͷσʔλετΞΛ͏·͘׆༻ͨ͠Γɺෳ਺ͷϫʔΫϩʔυΛ͏·
    ͘͞͹͍͍ͯ͘ΞʔΩςΫνϟʹؔ৺͕͋Δ

    View full-size slide