Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

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

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

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

monochromegane

December 25, 2017
Tweet

More Decks by monochromegane

Other Decks in Programming

Transcript

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

    System Architecture ݚڀձ (WSAݚ) #1 ෼ࢄΞϓϦέʔγϣϯʹ͓͚Δ ෳ਺୺຤ར༻Λߟྀͨ͠ ϓϥΠϕʔτσʔλͷ؅ཧ
  2. • IPFS (InterPlanetary File System) • σʔλͷ෼ࢄอଘͱσʔλ಺༰ʹجͮ͘ΞυϨογϯά • σΟϨΫτϦߏ଄Λѻ͑Δ •

    σʔλมߋ͕ΞυϨεมߋͱಉҙͳͷͰΞυϨεΛ؅ཧ͢Δඞཁ͕͋Δ • IPNS(InterPlanetary Name Service)ʹΑΔ೚ҙΞυϨεΛݻఆతʹࢀর 17 P2Pܕ෼ࢄϑΝΠϧγεςϜ - IPFS -
  3. 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. 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. KaleidoscopeͰͷ୺຤ؒσʔλڞ༗ (1) 30 $ kes > use my-db # =>

    Get newest hash value from IPNS → ݱঢ়ɺIPNSͷߋ৽ॲཧʹ਺ඵ͔͔ΔͨΊɺϦΞϧλΠϜͷಉظ͕೉͍͠
  6. 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. ࠩ෼ํࣜʹΑΔߋ৽࣌ؒͷൺֱ 34      .# .# .#

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

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