分散アプリケーションにおける複数端末利用を考慮したプライベートデータの管理/WSA_1_kaleidoscope

 分散アプリケーションにおける複数端末利用を考慮したプライベートデータの管理/WSA_1_kaleidoscope

第一回 Web System Architecture 研究会 (WSA研)
http://websystemarchitecture.hatenablog.jp/entry/2017/12/17/133301

Cd3d2cb2dadf5488935fe0ddaea7938a?s=128

monochromegane

December 25, 2017
Tweet

Transcript

  1. 1.

    ࡾ୐༔հ / Pepabo R&D Institute, GMO Pepabo, Inc. 2017.12.23 Web

    System Architecture ݚڀձ (WSAݚ) #1 ෼ࢄΞϓϦέʔγϣϯʹ͓͚Δ ෳ਺୺຤ར༻Λߟྀͨ͠ ϓϥΠϕʔτσʔλͷ؅ཧ
  2. 17.

    • IPFS (InterPlanetary File System) • σʔλͷ෼ࢄอଘͱσʔλ಺༰ʹجͮ͘ΞυϨογϯά • σΟϨΫτϦߏ଄Λѻ͑Δ •

    σʔλมߋ͕ΞυϨεมߋͱಉҙͳͷͰΞυϨεΛ؅ཧ͢Δඞཁ͕͋Δ • IPNS(InterPlanetary Name Service)ʹΑΔ೚ҙΞυϨεΛݻఆతʹࢀর 17 P2Pܕ෼ࢄϑΝΠϧγεςϜ - IPFS -
  3. 26.

    26 Kaleidoscopeͷ࢓૊Έ QmFoo ├── __database_name ├── key1 │ └── value

    └── key2 └── value IPFS Kaleidoscope Application Encrypt / Decrypt Key <-> Directory IPNS Current address Name Hash Metadata + data Hash
  4. 29.

    Kaleidoscopeͷجຊతͳར༻ํ๏ 29 # Start IPFS daemon $ ipfs daemon #

    Start Kaleidoscope CLI $ kes > create my-db # => Create datastore key pair and Register directory on IPFS > > set key1 value1 # => Save encrypted data on IPFS > > get key1 value1 # => Get and decrypt data from directory on IPFS > > save # => Update IPNS by newest hash value
  5. 30.

    KaleidoscopeͰͷ୺຤ؒσʔλڞ༗ (1) 30 $ kes > use my-db # =>

    Get newest hash value from IPNS → ݱঢ়ɺIPNSͷߋ৽ॲཧʹ਺ඵ͔͔ΔͨΊɺϦΞϧλΠϜͷಉظ͕೉͍͠
  6. 31.

    KaleidoscopeͰͷ୺຤ؒσʔλڞ༗ (2) 31 # Start IPFS daemon with pubsub option

    $ ipfs daemon --enable-pubsub-experiment $ kes > sync # => Thereafter, operation history from other own terminal online is shared • ૢ࡞छผͱର৅ͱͳͬͨϑΝΠϧͷϋογϡ஋ΛPubSubܦ༝Ͱૹ৴ • ड৴ଆ͸ɺࣗ਎ͷૢ࡞ʹͦΕΒͷૢ࡞Λࠩ͠ࠐΈͳ͕Βॱ൪ʹॲཧ → ࣮ࡍͷӡ༻Ͱ͸λΠϜελϯϓ·Ͱߟྀͨ͠౷߹͕ඞཁ
  7. 33.
  8. 34.

    ࠩ෼ํࣜʹΑΔߋ৽࣌ؒͷൺֱ 34      .# .# .#

    .# .# .# .# .# .# .# pMFCBTFE PQFCBTFE EJSCBTFE • σʔλετΞͷ༰ྔ͝ͱͷ IPFS΁ͷొ࿥࣌ؒΛൺֱ • ϑΝΠϧϕʔεࠩ෼͸༰ྔʹൺ ྫͯ͠ొ࿥͕࣌ؒ૿Ճ • มߋΛہॴԽ͢ΔํࣜͰ͸༰ ྔʹґଘͤͣҰఆ • σΟϨΫτϦϕʔεࠩ෼ํࣜͰ ͸σΟϨΫτϦߋ৽෼ͷΦʔόʔ ϔου͕ݟΒΕΔ
  9. 35.

    ࠩ෼ํࣜʹΑΔॳظىಈ࣌ؒͷൺֱ 35      .# .# .#

    .# .# .# .# .# .# .# pMFCBTFE PQFCBTFE EJSCBTFE • σʔλετΞͷ༰ྔ͝ͱͷॳ ظىಈ࣌ؒΛൺֱ • ϑΝΠϧϕʔεࠩ෼ɺΦϖϨʔ γϣϯϕʔεࠩ෼Ͱ͸༰ྔ·ͨ ͸ཤྺͷ૿Ճʹൺྫ͢Δ • σΟϨΫτϦϕʔεࠩ෼͸ৗʹ ࠷৽Λอ࣋͢ΔͨΊॳظىಈ ࣌ؒ͸ൃੜ͠ͳ͍
  10. 37.
  11. 39.