SlideShare a Scribd company logo
Polyglot persistence and
graph schema
Smart selection of data schemas for a feature of services
Profile
ブログ : http://blog.processtune.com
プロフィール : Facebook, Twitter or MVP
コミュニティ : .NETラボの運営スタッフ
Microsoft MVP : July 2010 ~ Jun 2022
Current expertise : MVP for Developer Technologies
システム構築のプロセス評価、改善、策定、
開発フレームワークの設計、実装管理、プリ
セールスやプロジェクトの立ち上げなど
Agenda
ポリグロット・パーシステンス
Graphスキーマ
ドキュメント DB
サンプル
まとめ
Polyglot persistence
モデル
クエリ言語
およびAPI
代表的な
アーキテクチャ
特性
Relational
Transact SQL
SQL Server
MySQL
Oracle DB
履歴・差分データIO、
OLTP
Time Series
Flux
Transact SQL
InfluxDB
Prometheus
eXtremeDB
高速書込
書込 > 読取
Document
MongoDB Shell
Driver+各種言語
MongoDB
CouchDB
Cosmos DB
レポート
O/R map開発不要
文書、成果物
Columnar
Cassandra Query
Language
Cassandra
(Wide-column)
HBase
大量データIO、OLAP
Triple Store
SPARQL
RDF query language
RDF4j
Jena
Virtuoso
モデル可変、複数
ソース、関係性の表
現、拡張検索
書込 < 読取
Graph
Gremlin
Cypher Query
Language
openCypher
Neo4j
Neptune
Cosmos DB
関係性の表現、高速
な接続トラバース、
深い関連、相互関連
Key-Value Store
ライブラリ+各言語
Cypher Query
Language
openCypher
Cassandra
Redis
DynamoDB
大規模スケールアウ
ト/イン、高速分散処
理
And more
Hive
KQL
(Kusto Query
Language)
…
Hadoop
Data Lake
…
高速分析
Big Data分析
…
※各ストアはマルチプルなスキーマを定義できますので、主なストアモデルを代表して分類しています(例:VirtuosoやCassandra、Cosmos DBはKey-Valueを保持できます)。
※クアッドストアや名前付きGraphはトリプルストアの拡張として表現しています。
Graph Schema
関係性の表現
高速な接続
トラバース
深い関連 相互関連
Graph
レポート
O/Rマップ不要
文書 成果物
Document
Document Schema
関係性の表現
高速な接続
トラバース
深い関連 相互関連
Graph
レポート
O/Rマップ不要
文書 成果物
Document
サンプル – データ作成
サンプル – データ作成
サンプル – データ作成
$ sudo docker pull mongo
$ sudo docker run -d -p 27017:27017 --init --name MusicChartDb mongo:latest
Docker やWSL2の説明:
Nginx run on Windows Subsystem for Linux 2 (processtune.com)
Node + MongoDB container for Azure Functions (processtune.com)
サンプル – データ作成
mongodb://127.0.0.1:27017
サンプル – データ作成
$ sudo docker commit MusicChartDb musicchartdb:v0.1
サンプル – Graphの準備
サンプル – ドライバーのインストール
https://github.com/TetsuroTakao/GenericHostMeshEndpoint
> dotnet add package Neo4j.Driver --version 5.1.0
プロジェクト選択
↓
DB選択
↓
詳細タブが選択されてい
るペインが表示されます
サンプル – クエリ
Conclusion
ポリグロット・パーシステンス
Graphスキーマ
ドキュメント DB
サンプル
まとめ
Links
freepik
https://www.freepik.com/free-photos-vectors/blue-background
Polyglot Persistence with Azure Data Services
https://techcommunity.microsoft.com/t5/data-architecture-blog/polyglot-persistence-with-azure-data-services/ba-p/1514912
Open Data Commons
https://opendatacommons.org/licenses/by/1-0/
Download Neo4j Desktop
https://neo4j.com/download/
Using Neo4j from .NET
https://neo4j.com/developer/dotnet/
neo4j: DOCKER OFFICIAL IMAGE
https://hub.docker.com/_/neo4j/
Neo4jClient 4.1.26
https://www.nuget.org/packages/Neo4jClient
neo4j-examples/movies-dotnetcore-bolt
https://github.com/neo4j-examples/movies-dotnetcore-bolt
Neo4j.Driver 5.1.0: NuGet
https://www.nuget.org/packages/Neo4j.Driver
Neo4j.Driver Namespace
https://neo4j.com/docs/api/dotnet-driver/current/html/f7d9eea1-5357-f1de-8a54-336a77141b6d.htm

More Related Content

Similar to Polyglot Persistence and Graph Schema

ASP.NETCoreOptionsPattern.pptx
ASP.NETCoreOptionsPattern.pptxASP.NETCoreOptionsPattern.pptx
ASP.NETCoreOptionsPattern.pptx
Takao Tetsuro
 
ADO.NET Entity Framework
ADO.NET Entity Framework ADO.NET Entity Framework
ADO.NET Entity Framework
Microsoft
 
これまでのアーキテクチャの変遷と今後の技術戦略
これまでのアーキテクチャの変遷と今後の技術戦略これまでのアーキテクチャの変遷と今後の技術戦略
これまでのアーキテクチャの変遷と今後の技術戦略Kazuyuki Nomura
 
DOO-005_裏 Inside Azure ~OSS 視点で理解する、Azure のテクノロジ & アーキテクチャ~
DOO-005_裏 Inside Azure ~OSS 視点で理解する、Azure のテクノロジ & アーキテクチャ~DOO-005_裏 Inside Azure ~OSS 視点で理解する、Azure のテクノロジ & アーキテクチャ~
DOO-005_裏 Inside Azure ~OSS 視点で理解する、Azure のテクノロジ & アーキテクチャ~
decode2016
 
Azure serverless!! azure functionsでサーバーを意識しない開発
Azure serverless!! azure functionsでサーバーを意識しない開発Azure serverless!! azure functionsでサーバーを意識しない開発
Azure serverless!! azure functionsでサーバーを意識しない開発
Yuki Hattori
 
Case study of DevOps for Hadoop in Recruit.
Case study of DevOps for Hadoop in Recruit.Case study of DevOps for Hadoop in Recruit.
Case study of DevOps for Hadoop in Recruit.
DataWorks Summit/Hadoop Summit
 
Case study of DevOps for Hadoop in Recruit.
Case study of DevOps for Hadoop in Recruit.Case study of DevOps for Hadoop in Recruit.
Case study of DevOps for Hadoop in Recruit.
Recruit Technologies
 
Google Cloud Dataflow を理解する - #bq_sushi
Google Cloud Dataflow を理解する - #bq_sushiGoogle Cloud Dataflow を理解する - #bq_sushi
Google Cloud Dataflow を理解する - #bq_sushi
Google Cloud Platform - Japan
 
[DI01] 窓は開かれた! SQL Server on Linux で拡がる可能性
[DI01] 窓は開かれた! SQL Server on Linux で拡がる可能性[DI01] 窓は開かれた! SQL Server on Linux で拡がる可能性
[DI01] 窓は開かれた! SQL Server on Linux で拡がる可能性
de:code 2017
 
Ignite 2021秋 recap - 開発者向け新機能紹介
Ignite 2021秋 recap - 開発者向け新機能紹介Ignite 2021秋 recap - 開発者向け新機能紹介
Ignite 2021秋 recap - 開発者向け新機能紹介
Kazushi Kamegawa
 
サーバー管理よ、サヨウナラ。サーバーレス アーキテクチャの意義と実践
サーバー管理よ、サヨウナラ。サーバーレス アーキテクチャの意義と実践サーバー管理よ、サヨウナラ。サーバーレス アーキテクチャの意義と実践
サーバー管理よ、サヨウナラ。サーバーレス アーキテクチャの意義と実践
真吾 吉田
 
Net advantage 2012 volume2 最新情報 xaml プラットフォーム編
Net advantage 2012 volume2 最新情報 xaml プラットフォーム編Net advantage 2012 volume2 最新情報 xaml プラットフォーム編
Net advantage 2012 volume2 最新情報 xaml プラットフォーム編
Daizen Ikehara
 
最新のプラットフォーム技術と開発ツールを活用した Web の構築
最新のプラットフォーム技術と開発ツールを活用した Web の構築最新のプラットフォーム技術と開発ツールを活用した Web の構築
最新のプラットフォーム技術と開発ツールを活用した Web の構築
Tomoyuki Iwade
 
【de:code 2020】 アマダの Azure への取り組みと DevOPS・MLOPS 環境の構築と運用
【de:code 2020】 アマダの Azure への取り組みと DevOPS・MLOPS 環境の構築と運用【de:code 2020】 アマダの Azure への取り組みと DevOPS・MLOPS 環境の構築と運用
【de:code 2020】 アマダの Azure への取り組みと DevOPS・MLOPS 環境の構築と運用
日本マイクロソフト株式会社
 
[MW11] OSS on Azure で構築する ウェブアプリケーション
[MW11] OSS on Azure で構築する ウェブアプリケーション[MW11] OSS on Azure で構築する ウェブアプリケーション
[MW11] OSS on Azure で構築する ウェブアプリケーション
de:code 2017
 
【de:code 2020】 PostgreSQL もスケールさせよう! - Hyperscale (Citus) -
【de:code 2020】 PostgreSQL もスケールさせよう! - Hyperscale (Citus) -【de:code 2020】 PostgreSQL もスケールさせよう! - Hyperscale (Citus) -
【de:code 2020】 PostgreSQL もスケールさせよう! - Hyperscale (Citus) -
日本マイクロソフト株式会社
 
local launch small language model of AI.
local launch small language model of AI.local launch small language model of AI.
local launch small language model of AI.
Takao Tetsuro
 
Windows Azure for PHP Developers
Windows Azure for PHP DevelopersWindows Azure for PHP Developers
Windows Azure for PHP Developersfumios
 
TypeScript ファースト ステップ (v.0.9 対応版) ~ Any browser. Any host. Any OS. Open Sourc...
TypeScript ファースト ステップ (v.0.9 対応版) ~ Any browser. Any host. Any OS. Open Sourc...TypeScript ファースト ステップ (v.0.9 対応版) ~ Any browser. Any host. Any OS. Open Sourc...
TypeScript ファースト ステップ (v.0.9 対応版) ~ Any browser. Any host. Any OS. Open Sourc...Akira Inoue
 
【de:code 2020】 Power Platform で広がるデータ インテグレーションの世界 (1/2)
【de:code 2020】 Power Platform で広がるデータ インテグレーションの世界 (1/2)【de:code 2020】 Power Platform で広がるデータ インテグレーションの世界 (1/2)
【de:code 2020】 Power Platform で広がるデータ インテグレーションの世界 (1/2)
日本マイクロソフト株式会社
 

Similar to Polyglot Persistence and Graph Schema (20)

ASP.NETCoreOptionsPattern.pptx
ASP.NETCoreOptionsPattern.pptxASP.NETCoreOptionsPattern.pptx
ASP.NETCoreOptionsPattern.pptx
 
ADO.NET Entity Framework
ADO.NET Entity Framework ADO.NET Entity Framework
ADO.NET Entity Framework
 
これまでのアーキテクチャの変遷と今後の技術戦略
これまでのアーキテクチャの変遷と今後の技術戦略これまでのアーキテクチャの変遷と今後の技術戦略
これまでのアーキテクチャの変遷と今後の技術戦略
 
DOO-005_裏 Inside Azure ~OSS 視点で理解する、Azure のテクノロジ & アーキテクチャ~
DOO-005_裏 Inside Azure ~OSS 視点で理解する、Azure のテクノロジ & アーキテクチャ~DOO-005_裏 Inside Azure ~OSS 視点で理解する、Azure のテクノロジ & アーキテクチャ~
DOO-005_裏 Inside Azure ~OSS 視点で理解する、Azure のテクノロジ & アーキテクチャ~
 
Azure serverless!! azure functionsでサーバーを意識しない開発
Azure serverless!! azure functionsでサーバーを意識しない開発Azure serverless!! azure functionsでサーバーを意識しない開発
Azure serverless!! azure functionsでサーバーを意識しない開発
 
Case study of DevOps for Hadoop in Recruit.
Case study of DevOps for Hadoop in Recruit.Case study of DevOps for Hadoop in Recruit.
Case study of DevOps for Hadoop in Recruit.
 
Case study of DevOps for Hadoop in Recruit.
Case study of DevOps for Hadoop in Recruit.Case study of DevOps for Hadoop in Recruit.
Case study of DevOps for Hadoop in Recruit.
 
Google Cloud Dataflow を理解する - #bq_sushi
Google Cloud Dataflow を理解する - #bq_sushiGoogle Cloud Dataflow を理解する - #bq_sushi
Google Cloud Dataflow を理解する - #bq_sushi
 
[DI01] 窓は開かれた! SQL Server on Linux で拡がる可能性
[DI01] 窓は開かれた! SQL Server on Linux で拡がる可能性[DI01] 窓は開かれた! SQL Server on Linux で拡がる可能性
[DI01] 窓は開かれた! SQL Server on Linux で拡がる可能性
 
Ignite 2021秋 recap - 開発者向け新機能紹介
Ignite 2021秋 recap - 開発者向け新機能紹介Ignite 2021秋 recap - 開発者向け新機能紹介
Ignite 2021秋 recap - 開発者向け新機能紹介
 
サーバー管理よ、サヨウナラ。サーバーレス アーキテクチャの意義と実践
サーバー管理よ、サヨウナラ。サーバーレス アーキテクチャの意義と実践サーバー管理よ、サヨウナラ。サーバーレス アーキテクチャの意義と実践
サーバー管理よ、サヨウナラ。サーバーレス アーキテクチャの意義と実践
 
Net advantage 2012 volume2 最新情報 xaml プラットフォーム編
Net advantage 2012 volume2 最新情報 xaml プラットフォーム編Net advantage 2012 volume2 最新情報 xaml プラットフォーム編
Net advantage 2012 volume2 最新情報 xaml プラットフォーム編
 
最新のプラットフォーム技術と開発ツールを活用した Web の構築
最新のプラットフォーム技術と開発ツールを活用した Web の構築最新のプラットフォーム技術と開発ツールを活用した Web の構築
最新のプラットフォーム技術と開発ツールを活用した Web の構築
 
【de:code 2020】 アマダの Azure への取り組みと DevOPS・MLOPS 環境の構築と運用
【de:code 2020】 アマダの Azure への取り組みと DevOPS・MLOPS 環境の構築と運用【de:code 2020】 アマダの Azure への取り組みと DevOPS・MLOPS 環境の構築と運用
【de:code 2020】 アマダの Azure への取り組みと DevOPS・MLOPS 環境の構築と運用
 
[MW11] OSS on Azure で構築する ウェブアプリケーション
[MW11] OSS on Azure で構築する ウェブアプリケーション[MW11] OSS on Azure で構築する ウェブアプリケーション
[MW11] OSS on Azure で構築する ウェブアプリケーション
 
【de:code 2020】 PostgreSQL もスケールさせよう! - Hyperscale (Citus) -
【de:code 2020】 PostgreSQL もスケールさせよう! - Hyperscale (Citus) -【de:code 2020】 PostgreSQL もスケールさせよう! - Hyperscale (Citus) -
【de:code 2020】 PostgreSQL もスケールさせよう! - Hyperscale (Citus) -
 
local launch small language model of AI.
local launch small language model of AI.local launch small language model of AI.
local launch small language model of AI.
 
Windows Azure for PHP Developers
Windows Azure for PHP DevelopersWindows Azure for PHP Developers
Windows Azure for PHP Developers
 
TypeScript ファースト ステップ (v.0.9 対応版) ~ Any browser. Any host. Any OS. Open Sourc...
TypeScript ファースト ステップ (v.0.9 対応版) ~ Any browser. Any host. Any OS. Open Sourc...TypeScript ファースト ステップ (v.0.9 対応版) ~ Any browser. Any host. Any OS. Open Sourc...
TypeScript ファースト ステップ (v.0.9 対応版) ~ Any browser. Any host. Any OS. Open Sourc...
 
【de:code 2020】 Power Platform で広がるデータ インテグレーションの世界 (1/2)
【de:code 2020】 Power Platform で広がるデータ インテグレーションの世界 (1/2)【de:code 2020】 Power Platform で広がるデータ インテグレーションの世界 (1/2)
【de:code 2020】 Power Platform で広がるデータ インテグレーションの世界 (1/2)
 

More from Takao Tetsuro

Small Language Model Local Launch on AI Tour Tokyo
Small Language Model Local Launch on AI Tour TokyoSmall Language Model Local Launch on AI Tour Tokyo
Small Language Model Local Launch on AI Tour Tokyo
Takao Tetsuro
 
Implementation Approach of Artifical Intelligence
Implementation Approach of Artifical IntelligenceImplementation Approach of Artifical Intelligence
Implementation Approach of Artifical Intelligence
Takao Tetsuro
 
MAUIGraphicsNamespace.pptx
MAUIGraphicsNamespace.pptxMAUIGraphicsNamespace.pptx
MAUIGraphicsNamespace.pptx
Takao Tetsuro
 
ServiceMeshEndpointWithMinimalAPIPublish.pptx
ServiceMeshEndpointWithMinimalAPIPublish.pptxServiceMeshEndpointWithMinimalAPIPublish.pptx
ServiceMeshEndpointWithMinimalAPIPublish.pptx
Takao Tetsuro
 
OptonsPatternDotNet.pptx
OptonsPatternDotNet.pptxOptonsPatternDotNet.pptx
OptonsPatternDotNet.pptx
Takao Tetsuro
 
gRPCurlDotNet.pptx
gRPCurlDotNet.pptxgRPCurlDotNet.pptx
gRPCurlDotNet.pptx
Takao Tetsuro
 
Layout isfirstprocessofatomicdesign
Layout isfirstprocessofatomicdesignLayout isfirstprocessofatomicdesign
Layout isfirstprocessofatomicdesign
Takao Tetsuro
 
Wasm blazor and wasi 2
Wasm blazor and wasi 2Wasm blazor and wasi 2
Wasm blazor and wasi 2
Takao Tetsuro
 
WebAssemblyとBlazor 、WebAssembly System Interfaceでコンテナライズの設計を解説
WebAssemblyとBlazor 、WebAssembly System Interfaceでコンテナライズの設計を解説WebAssemblyとBlazor 、WebAssembly System Interfaceでコンテナライズの設計を解説
WebAssemblyとBlazor 、WebAssembly System Interfaceでコンテナライズの設計を解説
Takao Tetsuro
 
Team development
Team developmentTeam development
Team development
Takao Tetsuro
 
Interoperability of webassembly with javascript
Interoperability of webassembly with javascriptInteroperability of webassembly with javascript
Interoperability of webassembly with javascript
Takao Tetsuro
 
Interactive connection2
Interactive connection2Interactive connection2
Interactive connection2
Takao Tetsuro
 
M365VM_PowerFX_takao-matsumoto_matsui_kojima
M365VM_PowerFX_takao-matsumoto_matsui_kojimaM365VM_PowerFX_takao-matsumoto_matsui_kojima
M365VM_PowerFX_takao-matsumoto_matsui_kojima
Takao Tetsuro
 
OpenStreetMap and Mapbox
OpenStreetMap and MapboxOpenStreetMap and Mapbox
OpenStreetMap and Mapbox
Takao Tetsuro
 
Excel on OneDrive is not a file
Excel on OneDrive is not a fileExcel on OneDrive is not a file
Excel on OneDrive is not a file
Takao Tetsuro
 
Development toolsforteamdevelopment
Development toolsforteamdevelopmentDevelopment toolsforteamdevelopment
Development toolsforteamdevelopment
Takao Tetsuro
 
React Helmet navigates SPA
React Helmet navigates SPAReact Helmet navigates SPA
React Helmet navigates SPA
Takao Tetsuro
 
Reacthelmetcontrolesspa
ReacthelmetcontrolesspaReacthelmetcontrolesspa
Reacthelmetcontrolesspa
Takao Tetsuro
 
One drivesettings
One drivesettingsOne drivesettings
One drivesettings
Takao Tetsuro
 
Galapagosization environment
Galapagosization environmentGalapagosization environment
Galapagosization environment
Takao Tetsuro
 

More from Takao Tetsuro (20)

Small Language Model Local Launch on AI Tour Tokyo
Small Language Model Local Launch on AI Tour TokyoSmall Language Model Local Launch on AI Tour Tokyo
Small Language Model Local Launch on AI Tour Tokyo
 
Implementation Approach of Artifical Intelligence
Implementation Approach of Artifical IntelligenceImplementation Approach of Artifical Intelligence
Implementation Approach of Artifical Intelligence
 
MAUIGraphicsNamespace.pptx
MAUIGraphicsNamespace.pptxMAUIGraphicsNamespace.pptx
MAUIGraphicsNamespace.pptx
 
ServiceMeshEndpointWithMinimalAPIPublish.pptx
ServiceMeshEndpointWithMinimalAPIPublish.pptxServiceMeshEndpointWithMinimalAPIPublish.pptx
ServiceMeshEndpointWithMinimalAPIPublish.pptx
 
OptonsPatternDotNet.pptx
OptonsPatternDotNet.pptxOptonsPatternDotNet.pptx
OptonsPatternDotNet.pptx
 
gRPCurlDotNet.pptx
gRPCurlDotNet.pptxgRPCurlDotNet.pptx
gRPCurlDotNet.pptx
 
Layout isfirstprocessofatomicdesign
Layout isfirstprocessofatomicdesignLayout isfirstprocessofatomicdesign
Layout isfirstprocessofatomicdesign
 
Wasm blazor and wasi 2
Wasm blazor and wasi 2Wasm blazor and wasi 2
Wasm blazor and wasi 2
 
WebAssemblyとBlazor 、WebAssembly System Interfaceでコンテナライズの設計を解説
WebAssemblyとBlazor 、WebAssembly System Interfaceでコンテナライズの設計を解説WebAssemblyとBlazor 、WebAssembly System Interfaceでコンテナライズの設計を解説
WebAssemblyとBlazor 、WebAssembly System Interfaceでコンテナライズの設計を解説
 
Team development
Team developmentTeam development
Team development
 
Interoperability of webassembly with javascript
Interoperability of webassembly with javascriptInteroperability of webassembly with javascript
Interoperability of webassembly with javascript
 
Interactive connection2
Interactive connection2Interactive connection2
Interactive connection2
 
M365VM_PowerFX_takao-matsumoto_matsui_kojima
M365VM_PowerFX_takao-matsumoto_matsui_kojimaM365VM_PowerFX_takao-matsumoto_matsui_kojima
M365VM_PowerFX_takao-matsumoto_matsui_kojima
 
OpenStreetMap and Mapbox
OpenStreetMap and MapboxOpenStreetMap and Mapbox
OpenStreetMap and Mapbox
 
Excel on OneDrive is not a file
Excel on OneDrive is not a fileExcel on OneDrive is not a file
Excel on OneDrive is not a file
 
Development toolsforteamdevelopment
Development toolsforteamdevelopmentDevelopment toolsforteamdevelopment
Development toolsforteamdevelopment
 
React Helmet navigates SPA
React Helmet navigates SPAReact Helmet navigates SPA
React Helmet navigates SPA
 
Reacthelmetcontrolesspa
ReacthelmetcontrolesspaReacthelmetcontrolesspa
Reacthelmetcontrolesspa
 
One drivesettings
One drivesettingsOne drivesettings
One drivesettings
 
Galapagosization environment
Galapagosization environmentGalapagosization environment
Galapagosization environment
 

Recently uploaded

Grokking Simplicity探訪
Grokking Simplicity探訪Grokking Simplicity探訪
Grokking Simplicity探訪
Yoshitaka Kawashima
 
NIST Cybersecurity Framework 2.0の変更点整理をしよう
NIST Cybersecurity Framework 2.0の変更点整理をしようNIST Cybersecurity Framework 2.0の変更点整理をしよう
NIST Cybersecurity Framework 2.0の変更点整理をしよう
You&I
 
20240603_SD輪読&座談会#57_kitazaki_______.pdf
20240603_SD輪読&座談会#57_kitazaki_______.pdf20240603_SD輪読&座談会#57_kitazaki_______.pdf
20240603_SD輪読&座談会#57_kitazaki_______.pdf
Ayachika Kitazaki
 
受発注バスターズ説明資料  株式会社batton Saleshub掲載用.pdf
受発注バスターズ説明資料  株式会社batton Saleshub掲載用.pdf受発注バスターズ説明資料  株式会社batton Saleshub掲載用.pdf
受発注バスターズ説明資料  株式会社batton Saleshub掲載用.pdf
ooishi1
 
アジャイルの30年(Tree Decades of Agileというブログ記事に関する要約)
アジャイルの30年(Tree Decades of Agileというブログ記事に関する要約)アジャイルの30年(Tree Decades of Agileというブログ記事に関する要約)
アジャイルの30年(Tree Decades of Agileというブログ記事に関する要約)
You&I
 
FIWARE Orion Context Broker コンテキスト情報管理 (Orion 4.0.0対応)
FIWARE Orion Context Broker コンテキスト情報管理 (Orion 4.0.0対応)FIWARE Orion Context Broker コンテキスト情報管理 (Orion 4.0.0対応)
FIWARE Orion Context Broker コンテキスト情報管理 (Orion 4.0.0対応)
fisuda
 

Recently uploaded (6)

Grokking Simplicity探訪
Grokking Simplicity探訪Grokking Simplicity探訪
Grokking Simplicity探訪
 
NIST Cybersecurity Framework 2.0の変更点整理をしよう
NIST Cybersecurity Framework 2.0の変更点整理をしようNIST Cybersecurity Framework 2.0の変更点整理をしよう
NIST Cybersecurity Framework 2.0の変更点整理をしよう
 
20240603_SD輪読&座談会#57_kitazaki_______.pdf
20240603_SD輪読&座談会#57_kitazaki_______.pdf20240603_SD輪読&座談会#57_kitazaki_______.pdf
20240603_SD輪読&座談会#57_kitazaki_______.pdf
 
受発注バスターズ説明資料  株式会社batton Saleshub掲載用.pdf
受発注バスターズ説明資料  株式会社batton Saleshub掲載用.pdf受発注バスターズ説明資料  株式会社batton Saleshub掲載用.pdf
受発注バスターズ説明資料  株式会社batton Saleshub掲載用.pdf
 
アジャイルの30年(Tree Decades of Agileというブログ記事に関する要約)
アジャイルの30年(Tree Decades of Agileというブログ記事に関する要約)アジャイルの30年(Tree Decades of Agileというブログ記事に関する要約)
アジャイルの30年(Tree Decades of Agileというブログ記事に関する要約)
 
FIWARE Orion Context Broker コンテキスト情報管理 (Orion 4.0.0対応)
FIWARE Orion Context Broker コンテキスト情報管理 (Orion 4.0.0対応)FIWARE Orion Context Broker コンテキスト情報管理 (Orion 4.0.0対応)
FIWARE Orion Context Broker コンテキスト情報管理 (Orion 4.0.0対応)
 

Polyglot Persistence and Graph Schema

Editor's Notes

  1. サービスの特性に合致したデータスキーマを選択することをポリグロット・パーシステンスと言います。 今回はGraphスキーマを使ったサービスとドキュメントDBスキーマを使ったサービスの組合せの例を通じてポリグロット・パーシステンスを解説します。
  2. 自己紹介読む
  3. 本日のアジェンダです。読む
  4. ポリグロットパーシステンスは、サービスの特性に合わせた永続化を行うという考え方です。ここで言うサービスの特性とは、書込が多く読込は必要時に行えばいいログとか、大量のデータを速く読込む必要のある分析ツールなど、サービスの目的によって優先させたいストレージ機能が異なることを指します。Azure Data Serviceでのポリグロットパーシステンスの概要は、巻末のリンクを参照してください。【図を解説】
  5. Graphスキーマの場合、前頁でお話した「関係性の表現」「高速な接続トラバース」「深い関連」「相互関連」についてお話していきます。【クリック】 この図は、先ほどお話ししたAzure Data Serviceの記事の絵です。Graphモデルは記載されていませんが、Azureでは、これらの特性に合致したサービスはCosmos DBを使って解決することができます。パフォーマンス、コスト、セキュリティなどの複数の要因からGraphモデルを選択する場合、そのスキーマをどのように実装していくかという設計は、アーキテクチャに依存するものではありませんので、Graphモデルを保持できるデータストレージとそのスキーマにクエリできるミドルウェアであればあらゆる組合せの選択が可能です。今回は特に意味はありませんがneo4jとGremlinを使います。サンプルのユーザーストーリーとしては、複数のポップを行う関連が相互に必要なBIをやってみます。音楽のチャートデータをGraphスキーマに格納して、何かしらの関連が見つかれば関連と関連のレポートを文書化したドキュメントを作成してDocumentモデルのストレージに格納します。
  6. Documentスキーマの場合、先ほどお話した「レポート」「O/Rマップ不要」「文書」「成果物」についてお話していきます。Graphスキーマと同様にアーキテクチャに依存していないのでDocumentモデルを格納できるストレージ、それをクエリできるスキーマとして、その両方をMongo DBで実装します。文書は解説上簡易にマークダウンで記載した関係性レポートというドキュメントを作ります。
  7. サンプルは、まずデータを作ります。Rapid APIでは多くのOpen Date APIを扱うことができるので、そこで音楽データを収集します。まず、未登録の場合Rapid APIに登録してログインしたらmusicに行き「spotify」を検索します。
  8. Spotify Scraperを選択して「Chart」の「List Weekly Top Albums」を選択します。真ん中のペインの最下部の「Optional Parameters」の「region」に「JP」を入力してTest Endpointをクリックして200 Successが返ってきたらデータをコピーしてVisual Studio Codeに貼り付けます。
  9. これをひとまずMongo DBに入れておきます。以前.NETラボでお話ししたようにDockerのオフィシャルイメージとVisual Studio CodeのMongoDB Extentionを使います。WSL2で「$ sudo docker pull mongo」と「$ sudo docker run -d -p 27017:27017 --init --name MusicChartDb mongo:latest」を実行します。WLS2やDockerの説明はブログでも解説しています。
  10. Mongo DBが動いている状態でVisual Studio CodeのMongoDB ExtentionのPlaygroundを作成して編集します。「use(‘ChartDB‘);」で’ChartDBというデータベースが作成され「db.chart.insertMany」のところに先ほど取得したデータをペーストします。Playボタンをクリックして結果が表示されたらOKです。insertManyの括弧の中の鍵括弧の中に全部を貼り付けます。コピーしたJSONは1件ですが、tracksの中に複数の楽曲情報が入っており、該当の週のWeekly Top Songsというデータなので、複数週のデータを格納できますinsertManyで大丈夫です。
  11. Mongo DBには入りましたが、これ自体Dockerで動いているので保存します。
  12. Graphは高度なGUIを持つNeo4j Desktopのサンプルを利用します。この段階ではCypher Queryを知る必要はありません。まずはVisual Studio Codeからneo4jにアクセスするためにドライバをインストールします。
  13. 前回の.NETラボでご紹介した汎用ホストのサンプルがGitHubにありますので、ダウンロードします。私はプロジェクト名を変えていますが、そのままでも大丈夫です。そのプロジェクトにNuGetからドライバーをインストールします。次に設定ファイルにneo4j用の設定値を追加します。画面はNeo4j Desktopのデフォルト値です。また、URIはNeo4j Desktopで確認することもできます。【クリック】パスワードの変更も可能です。