SlideShare a Scribd company logo
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS 公式 Webinar
https://amzn.to/JPWebinar
過去資料
https://amzn.to/JPArchive
Solutions Architect
秋田 仁雅
2020/7/14
Amazon Neptune
サービスカットシリーズ
[AWS Black Belt Online Seminar]
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
自己紹介
秋田仁雅
技術統括本部 ISV/SaaSソリューション本部
ソリューションアーキテクト
好きなサービス
Amazon Neptune
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Black Belt Online Seminar とは
• 「サービス別」「ソリューション別」「業種別」のそれぞれのテーマに分かれて、ア
マゾン ウェブ サービス ジャパン株式会社が主催するオンラインセミナーシリーズです。
• 質問を投げることができます!
• 書き込んだ質問は、主催者にしか見えません
• 今後のロードマップに関するご質問は
お答えできませんのでご了承下さい
① 吹き出しをクリック
② 質問を入力
③ Sendをクリック
Twitter ハッシュタグは以下をご利用ください
#awsblackbelt
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
内容についての注意点
• 本資料では2020年7月14日時点のサービス内容および価格についてご説明しています。最新の情
報はAWS公式ウェブサイト(http://aws.amazon.com)にてご確認ください。
• 資料作成には十分注意しておりますが、資料内の価格とAWS公式ウェブサイト記載の価格に相違
があった場合、AWS公式ウェブサイトの価格を優先とさせていただきます。
• 価格は税抜表記となっています。日本居住者のお客様が東京リージョンを使用する場合、別途消
費税をご請求させていただきます。
• AWS does not offer binding price quotes. AWS pricing is publicly available and is subject to
change in accordance with the AWS Customer Agreement available at
http://aws.amazon.com/agreement/. Any pricing information included in this document is
provided only as an estimate of usage charges for AWS services based on certain information
that you have provided. Monthly charges will be based on your actual use of AWS services, and
may vary from the estimates provided.
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アジェンダ
1. グラフとは
2. グラフDBとは
3. Amazon Neptuneのご紹介
4. はじめるためには
5. まとめ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アジェンダ
1. グラフとは
2. グラフDBとは
3. Amazon Neptuneのご紹介
4. はじめるためには
5. まとめ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
グラフとは
フォロー
ブロック
フォロー
フォロー
UserA UserB
UserC
Userが「フォロー」「ブロック」
などの矢印で結ばれている
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
グラフとは
Edge
Edge
Node Node
Node
一般化すると、
NodeがEdgeで結ばれている
※NodeはVertexとも呼ばれる
Edge
Edge
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
グラフの例:IP Network
リンク
Router
PC
Node: ルータやPC
Edge: リンク
リンク
PC
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
グラフの例:路線図
線路
C駅
A駅
Node: 駅、バス停
Edge: 線路、バスルート
線路
B駅
バス停
線路
バス路線
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
グラフの例:World Wide Web
リンク
Node: Webページ
Edge: ハイパーリンク
リンク
Webページ
Webページ
Webページ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アジェンダ
1. グラフとは
2. グラフDBとは
3. Amazon Neptuneのご紹介
4. はじめるためには
5. まとめ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
グラフDBとは
“グラフモデル”を効率的に格納し、検索するためのDB
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
2つのグラフモデルとフレームワーク
Apache TinkerPop™ (OSS)
Gremlin Traversal Language
W3C標準
SPARQL Query Language
RDFプロパティグラフ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
プロパティグラフモデル
friend
block
friend
friend
name:UserA name:UserB
name:UserC
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
プロパティグラフモデル
friend
block
friend
friend
name:UserA name:UserB
name:UserC
Nodeのプロパティ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
プロパティグラフモデル
friend
block
friend
friend
name:UserA name:UserB
name:UserC
Nodeのプロパティ
Edgeのプロパティ(ラベル)
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
プロパティグラフモデル
friend
Since:2019-07-14
name:UserA
age:26
gender:male
age:25
job: engineer
プロパティは、この図のように複数もつこ
とも可能です
ノード毎、エッジ毎に異なるプロパティを
もつことも可能です
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RDF
述語
主語 目的語 • ノード=>主語、目的語
• エッジ=>述語
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RDF
friend
UserA UserB
“主語” “述語” “目的語”
UserA friend UserB.
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RDF
friend
UserA UserB
“主語” “述語” “目的語”
UserA friend UserB.
UserA の年齢は 26歳.
26
歳
の年齢は
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Gremlin 101
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Gremlin 101
グラフから全ノードを探したい
g.V()
=> [‘UserA’, ‘UserB’, ‘UserC’]
friend
friendfriend
name:UserA name:UserB
name:UserC
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Gremlin 101
Nameが“UserA”のノードを探したい
g.V().has(‘name’, ’UserA’)
=> [‘UserA’]
friend
friendfriend
name:UserA name:UserB
name:UserC
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Gremlin 101
“UserA”の友達であるユーザを探したい
g.V().has(‘name’, ’UserA’).out(‘friend’)
⇒ [‘UserB’]
friend
friendfriend
name:UserA name:UserB
name:UserC
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Gremlin 101
friend
friendfriend
name:UserA name:UserB
name:UserC
“UserA”にとって、友達の友達であるユーザを探し
たい
g.V().has(‘name’: ‘UserA’).out(‘friend’)
.out(‘friend’)
=> [UserC]
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Gremlin 101
friend
friendfriend
name:UserA name:UserB
name:UserC
“UserA”の友達がLikesをつけているコンテンツを探
したい
g.V().has(‘name’: ‘UserA’).out(‘friend’)
.out(‘likes’)Likes
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アジェンダ
1. グラフとは
2. グラフDBとは
3. Amazon Neptuneのご紹介
4. はじめるためには
5. まとめ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Neptune の特徴
高速 高信頼性、セキュア オープン簡単
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
グラフ処理の分類
• OLTP
• 1処理単位でグラフの一部を探索
• リコメンデーション、不正検知など
並列かつ大量に実行される
• OLAP
• 1処理単位でグラフのすべてを探索
• クラスタリング、全ノードの重みバランスの調整
など
1度の処理が大きい
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
クエリ性能
• OLTPのグラフワークロードにおいて
毎秒100,000件のクエリをサポートするよう設計
• 最大15個のリードレプリカ
• 専用に設計されたクラウドネイティブなストレージサービス
• 最適化されたインメモリアーキテクチャ
• クエリの最適化
• 索引(インデックス)はNeptune側で管理される
• クエリ実行計画やプロファイルの取得も可能
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
リードレプリカ
可用性
• データベースノードの障害は自動的に
検知され、交換される
• データベース処理の障害は自動的に検
知され、リソースはリサイクルされる
• リードレプリカは必要に応じて自動的
にマスタに昇格する
• どのリードレプリカに対して優先的に
フェイルオーバーさせるかを指定でき
る
Primary
Node
Primary
Nodeマスタ
Primary
Node
Primary
Node
リード
レプリカ
Primary
Node
Primary
Node
リード
レプリカ
クラスタ/
インスタンス
モニタリング
パフォーマンス
• リードレプリカによってアプリケーション
の読み込みトラフィックをスケールアウト
させることができる
• 読み込みエンドポイントによってリードレ
プリカを跨がって負荷が分散される
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
クラウドネイティブストレージエンジンの概要
データは3つのアベイラビリティーゾーンに跨がった
6つのレプリカにコピーされる
継続的に堅牢な Amazon S3 へバックアップされる
継続的にノードやディスクが修復される
修復やホットスポットのリバランスのために
10GBのセグメントユニットで管理されている
読み書きにはレイテンシ耐性を持つクォーラムシステムを使
用している
クォーラムのメンバーシップが変更されたとしても書き込み
は阻害されない
ストレージは使用に応じて自動的に64TBまで拡張される
AZ 1 AZ 2 AZ 3
Amazon S3
Amazon
Neptune
ストレージ
ノード
ストレージ
ノード
ストレージ
ノード
ストレージ
ノード
ストレージ
ノード
ストレージ
ノード
ストレージ
モニタリング
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Point-in-Time リストア
オンラインでの point-in-time リストアにより、バックアップからリストアすること
なく指定した時間にデータベースの状態を戻すことができる
t0 t1 t2
t0 t1
t2
t3 t4
t3
t4
1. t1へ戻る
2. t3へ戻る
不可視 不可視
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
セキュリティ
• TLSによるクライアント/サーバ間の通信暗号化
• KMSによるストレージの暗号化
• セキュリティグループによるアクセス制御
• AWS IAMロールによる認証
• 監査ログをCloudWatch Logsに発行
• SOC, PCI-DSSなど各種コンプライアンス準拠
https://docs.aws.amazon.com/ja_jp/neptune/latest/userguide/neptune-compliance.html
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon Neptuneでサポートされるインターフェイス
Tinkerpop/Gremlin RDF/SPARQL
CLI Gremlin Console RDF4J Console
RDF4J Workbench
Java Gremlin Driver RDF4J
Python Gremlin-Python Driver sparqlwrapper
.NET Gremlin.NET -
Node.js gremlin-javascript -
HTTP REST HTTP REST (Gremlin) HTTP REST (SPARQL)
REST以外の
HTTP
Gremlin HTTP
WebSocket API
SPARQL HTTP
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon ElasticSearch Service連携
• Amazon ElasticSearch Serviceにデータをストリームで連携
• Amazon NeptuneからElasticSearchによる文字列検索が可能
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon ElasticSearch Serviceとの連携
Lambda
ElasticSearch
Service
Neptune
Streams
グラフデータの更新をNeptune Streamsから検知、ElasticSearch Serviceを更新
この構成を構築するCloudFormationのテンプレートが用意
https://docs.aws.amazon.com/ja_jp/neptune/latest/userguide/full-text-search-cfn-create.html
neptune_streams パラメータの有効化が必要
Neptune
更新アプリ
ケーション
読取アプリ
ケーション
NeptuneインスタンスからElasticSearchに直接クエリ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ElasticSearch Service連携でLIKE検索やfuzzy検索
Ex1)
g.withSideEffect("Neptune#fts.endpoint", "your-es-endpoint-URL")
.withSideEffect(“Neptune#fts.queryType”, “query_string”)
.withSideEffect(“Neptune#fts.minScore”, 1.5)
.V().has("name", "Neptune#fts m*k*");
Ex2)
g.withSideEffect("Neptune#fts.endpoint", "your-es-endpoint-URL")
.withSideEffect(“Neptune#fts.queryType”, “fuzzy”)
.V().has("name", "Neptune#fts mike");
https://docs.aws.amazon.com/ja_jp/neptune/latest/userguide/full-text-search.html
Fuzzy検索
Query String 検索
Score 1.5以上のDocumentのみ
ワイルドカード
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
その他最近のアップデート
• データベースクラスタの停止が可能に
• 最大停止期間は7日間
• 7日間を超える場合はスナップショットを取得して削除を
• db.t3.mediumインスタンスが利用可能に
• 0.15USD/時間で利用可能(東京リージョン)
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
事例: Zeta Global 顧客識別グラフ
• 顧客を識別するためのブラウザCookie
などの情報を管理
• 異なるCookieやDeviceIDが同じ顧客を
表した場合にEdgeで結合
• 1日あたり4億5000万クエリ
• 平均35msecのレイテンシ
https://aws.amazon.com/jp/blogs/news/building-a-customer-identity-graph-with-amazon-neptune/
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アジェンダ
1. グラフとは
2. グラフDBとは
3. Amazon Neptuneのご紹介
4. はじめるためには
5. まとめ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
データの投入
バルクでデータを投入する方法は2種類
• S3上にCSVファイルを用意し、Neptune Loaderでロード
• AWS Database Migration Serviceを使用して他のDBから移行
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
S3上のCSVファイルによるデータロード
NodeのCSVファイル例
EdgeのCSVファイル例
~id, name:String, age:Int, ~label
v1, UserA, 29, person
v2, UserB, 30, person
~id,~from,~to,~label
e1,v1,v2,follow
e2,v2,v1,follow
https://docs.aws.amazon.com/ja_jp/neptune/latest/userguide/bulk-load.html
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
S3上のCSVファイルによるデータロード
NodeのCSVファイル例
EdgeのCSVファイル例
~id, name:String, age:Int, ~label
v1, UserA, 29, person
v2, UserB, 30, person
~id,~from,~to,~label
e1,v1,v2,follow
e2,v2,v1,follow
curl -X POST -H 'Content-Type:
application/json' https://<neptune-endpoint>:8182/loader -d
'
{
"source" : "s3://<S3 URI>/",
"format" : "csv",
"iamRoleArn" : ”<IAM Role ARN>",
"region" : ”<region>",
"failOnError" : "FALSE",
"parallelism" : "MEDIUM",
"updateSingleCardinalityProperties" : "FALSE",
"queueRequest" : "TRUE"
}'
ロード実行例
https://docs.aws.amazon.com/ja_jp/neptune/latest/userguide/bulk-load.html
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Database Migration Serviceによるデータ移行
RDSや、オンプレミスのRDBなどからデータの移行が可能
RDBのレコードを、ノードやエッジにマッピング
各カラムの値をプロパティに変換
https://docs.aws.amazon.com/ja_jp/neptune/latest/userguide/dms-neptune-replication.html
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CLI (Gremlin Console)
Groovyベースのコンソール
用途: Gremlinの学習/アプリケーション開発/アドホック分析/データベース運用
https://docs.aws.amazon.com/ja_jp/neptune/latest/userguide/access-graph-gremlin-console.html
http://tinkerpop.apache.org/docs/current/reference/#connecting-via-console
https://github.com/tinkerpop/gremlin/wiki/Getting-Started
$ cat conf/neptune-remote.yaml
hosts: [<Neptune end point>]
port: 8182
serializer: { className: (省略)}
$ cat neptune.groovy
:remote connect tinkerpop.server conf/neptune-remote.yaml
:remote console
$ cat bin/mygremlin.sh
bin/gremlin.sh -i neptune.groovy
$ bin/mygremlin.sh
¥,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated:
tinkerpop.utilities
plugin activated:
tinkerpop.tinkergraph
gremlin> g.V().limit(1)
==>v[Luke]
gremlin>
サーバー定義
Neptuneに接続する初期化スクリプト
初期化スクリプトを呼び出す起動シェル
起動シェルの実行
Neptuneへのクエリ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Neptune Workbench:Jupyter Notebookからクエリ実行
“%%sparql”や”%%gremlin”を記
述したセルでクエリを実行
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Gremlin 実行計画 の取得
JupyterNotebookのセルで“%%gremlin explain”の後にクエリ記述
クエリの実行計画
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Gremlin プロファイルの取得
クエリの最後に”.profile()”付与
クエリのプロファイル
”%query_mode profile”マジックコマンドでもprofile取得可能
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Neptune Workbench:その他の機能
各マジックコマンドでNeptuneの様々な機能をJupyterNotebookから
実行
• %status
• Neptuneクラスタの情報を取得して表示
• %load
• S3上のファイルについてURI等を指定し、バルクロードを実行
• %graph_notebook_config
• 使用中のJupyterNotebookの接続情報を表示
• %query_mode (query|explain|profile)
• クエリモードの変更
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
可視化 - 何のための可視化か?
• 全体を見るため
の可視化
• 一部を見るための
可視化
大規模グラフのOLTP用途では
こちらが中心となる
視覚的に全体的な構造を把握
クラスタリングの仮説を立てる
ドリルダウン
視覚的にターゲット周辺の構造を把握
トラバーサルの仮説を立てる
実トランザクションの大規模グラフ
ではすべてのデータを描画しても
情報過多となる
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
例mazon-Workspaces@4x.png
OSSツールによる可視化
JavaScriptベースの可視化ツール “Graphexp”
GitHubリポジトリ以下のファイル一式をWebブラウザで開くだけ
以下設定でNeptuneに対応
Webブラウザから直接Neptuneエンドポイントに
アクセスできる必要がある
const SINGLE_COMMANDS_AND_NO_VARS = true;
const REST_USE_HTTPS = true;
graphConf.js
Neptuneエンドポイントインターネット WorkSpaces
Workspaces上のブラウザでGraphexpを開く
ブラウザのJavaScriptからアクセス
https://github.com/bricaud/graphexp
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
商用ツールによる可視化
Tom Sawyer
https://www.tomsawyer.com/aws-amazon-neptune-visualization/
https://aws.amazon.com/jp/blogs/news/exploring-scientific-research-on-
covid-19-with-amazon-neptune-amazon-comprehend-medical-and-the-tom-
sawyer-graph-database-browser/
Metaphactory
https://metaphacts.com/amazon-neptune
https://aws.amazon.com/jp/blogs/apn/exploring-knowledge-graphs-on-
amazon-neptune-using-metaphactory/
Keylines
ttps://cambridge-intelligence.com/visualizing-the-amazon-neptune-
database-with-keylines/
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Tom Sawyer: ユースケース
Comprehend Medicalで医学論文から意味情報を
抽出しつつトピックごとに分類し、Neptuneに
ロード
同じトピックに属する論文や、同じ意味情報の
多くを共有する論文同士の類似関係を視覚化
https://aws.amazon.com/jp/blogs/news/exploring-scientific-research-on-covid-19-with-amazon-
neptune-amazon-comprehend-medical-and-the-tom-sawyer-graph-database-browser/
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
運用ツール:GraphML 2 Neptune CSV
GraphML ファイルをNeptuneでのバルクロードが可能なCSV ファイ
ルに変換するツール
https://github.com/awslabs/amazon-neptune-tools/tree/master/graphml2csv
# TinkerpopのModernデータのうちGraphML形式の tinkerpop-modern.xml をダウンロード
$ curl https://raw.githubusercontent.com/apache/tinkerpop/master/data/tinkerpop-
modern.xml -o tinkerpop-modern.xml
# Pythonスクリプトを実行してノードとエッジの2つのCSVファイルに変換
$ ./graphml2csv.py -i tinkerpop-modern.xml
infile = tinkerpop-modern.xml
Processing tinkerpop-modern.xml
Wrote 6 nodes and 18 attributes to tinkerpop-modern-nodes.csv.
Wrote 6 edges and 12 attributes to tinkerpop-modern-edges.csv.
# あとは変換されたCSVファイルをS3バケットに配置してNeptuneにバルクロードすればOK
TinkerpopのModernデータを変換する例
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
運用ツール:Neptune Export
• BulkLoaderでNeptuneに取り込み可能なCSVやTurtleフォーマット
• 全データ、またはサンプリングやクエリの結果のみをエクスポート
• ツール自体をAWS Lambdaにデプロイすることも可能
Neptuneのデータをテキストファイルにエクスポートするツール
https://github.com/awslabs/amazon-neptune-tools/tree/master/neptune-
export
# Mavenなどによりjarを作成
$mvn clean install
# endpointとoutputを指定して実行
$ bin/neptune-export.sh export-pg -d ~/neptune/output/ -e <neptune-endpoint> --use-ssl
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
[Gremlin] 学習パスの例
Neptune WorkbenchとGraphexpを用いてクエリを実行しながら学習
• Workbenchのサンプルノートブックを実行してみる
• AWS SamplesのTutorialに沿ってクエリを実行してみる
https://github.com/aws-samples/amazon-neptune-samples/tree/master/gremlin/collaborative-filtering
• TinkerpopのTutorialで学習する
https://tinkerpop.apache.org/docs/current/tutorials/getting-started/
※Neptuneにおける実装での相違点に留意しながら実行する
https://docs.aws.amazon.com/ja_jp/neptune/latest/userguide/access-graph-gremlin-differences.html
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
[RDF/SPARQL] 学習パスの例
• Workbenchのサンプルノートブックを実行してみる
• 公開されたグローバルなナレッジベースを用いてSPARQLを学習
例: DBPedia http://ja.dbpedia.org/sparql
既存のクエリを少しずつ改変しながら学ぶなどが有効。
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
アジェンダ
1. グラフとは
2. グラフDBとは
3. Amazon Neptuneのご紹介
4. はじめるためには
5. まとめ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
まとめ
• グラフとは
• SNS、路線図、WWW等、いたるところに
• Amazon Neptuneの特徴
• 最大で毎秒100,000件のクエリをサポート
• クラウドネイティブストレージによる高信頼性
• 継続的バックアップ、Point-In-Timeリストア
• TLSやKMSによる通信やストレージの暗号化
• CloudWatchLogsへの監査ログの発行
• ElasticSearch Serviceとの連携による、柔軟なクエリ
• Neptune Workbenchや可視化による、高い開発効率
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Q&A
• お答えできなかったご質問については
• AWS Japan Blog
「https://aws.amazon.com/jp/blogs/news/」にて
• 資料公開と併せて、後日掲載します。
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ご清聴ありがとうございました

More Related Content

PDF
20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)
Amazon Web Services Japan
 
PDF
20190130 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
Amazon Web Services Japan
 
PDF
AWS Black Belt Online Seminar AWS Key Management Service (KMS)
Amazon Web Services Japan
 
PDF
20190326 AWS Black Belt Online Seminar Amazon CloudWatch
Amazon Web Services Japan
 
PDF
20190806 AWS Black Belt Online Seminar AWS Glue
Amazon Web Services Japan
 
PDF
20200303 AWS Black Belt Online Seminar AWS Cloud Development Kit (CDK)
Amazon Web Services Japan
 
PDF
AWS Black Belt Online Seminar 2017 Amazon ElastiCache
Amazon Web Services Japan
 
PDF
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design Pattern
Amazon Web Services Japan
 
20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)
Amazon Web Services Japan
 
20190130 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
Amazon Web Services Japan
 
AWS Black Belt Online Seminar AWS Key Management Service (KMS)
Amazon Web Services Japan
 
20190326 AWS Black Belt Online Seminar Amazon CloudWatch
Amazon Web Services Japan
 
20190806 AWS Black Belt Online Seminar AWS Glue
Amazon Web Services Japan
 
20200303 AWS Black Belt Online Seminar AWS Cloud Development Kit (CDK)
Amazon Web Services Japan
 
AWS Black Belt Online Seminar 2017 Amazon ElastiCache
Amazon Web Services Japan
 
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design Pattern
Amazon Web Services Japan
 

What's hot (20)

PDF
20191105 AWS Black Belt Online Seminar Amazon Route 53 Hosted Zone
Amazon Web Services Japan
 
PDF
AWS Black Belt Online Seminar 2017 AWS Storage Gateway
Amazon Web Services Japan
 
PDF
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
Amazon Web Services Japan
 
PDF
20210330 AWS Black Belt Online Seminar AWS Glue -Glue Studioを使ったデータ変換のベストプラクティス-
Amazon Web Services Japan
 
PDF
20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipeline
Amazon Web Services Japan
 
PDF
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
Amazon Web Services Japan
 
PDF
20190402 AWS Black Belt Online Seminar Let's Dive Deep into AWS Lambda Part1 ...
Amazon Web Services Japan
 
PDF
AWS Black Belt Online Seminar 2017 Amazon Kinesis
Amazon Web Services Japan
 
PDF
20190604 AWS Black Belt Online Seminar Amazon Simple Notification Service (SNS)
Amazon Web Services Japan
 
PDF
20200422 AWS Black Belt Online Seminar Amazon Elastic Container Service (Amaz...
Amazon Web Services Japan
 
PDF
20180613 AWS Black Belt Online Seminar AWS Cloud9 入門
Amazon Web Services Japan
 
PDF
AWS Black Belt Online Seminar 2017 Amazon DynamoDB
Amazon Web Services Japan
 
PDF
20190521 AWS Black Belt Online Seminar Amazon Simple Email Service (Amazon SES)
Amazon Web Services Japan
 
PDF
AWS Black Belt Techシリーズ AWS Direct Connect
Amazon Web Services Japan
 
PDF
20190911 AWS Black Belt Online Seminar AWS Batch
Amazon Web Services Japan
 
PDF
20191016 AWS Black Belt Online Seminar Amazon Route 53 Resolver
Amazon Web Services Japan
 
PDF
20190320 AWS Black Belt Online Seminar Amazon EBS
Amazon Web Services Japan
 
PDF
AWS EC2 Eメール制限解除 - 逆引き(rDNS)設定 申請手順
Amazon Web Services Japan
 
PDF
20190226 AWS Black Belt Online Seminar Amazon WorkSpaces
Amazon Web Services Japan
 
PDF
Amazon Pinpoint を中心としたカスタマーエンゲージメントの全体像 / Customer Engagement On Amazon Pinpoint
Amazon Web Services Japan
 
20191105 AWS Black Belt Online Seminar Amazon Route 53 Hosted Zone
Amazon Web Services Japan
 
AWS Black Belt Online Seminar 2017 AWS Storage Gateway
Amazon Web Services Japan
 
20190730 AWS Black Belt Online Seminar Amazon CloudFrontの概要
Amazon Web Services Japan
 
20210330 AWS Black Belt Online Seminar AWS Glue -Glue Studioを使ったデータ変換のベストプラクティス-
Amazon Web Services Japan
 
20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipeline
Amazon Web Services Japan
 
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
Amazon Web Services Japan
 
20190402 AWS Black Belt Online Seminar Let's Dive Deep into AWS Lambda Part1 ...
Amazon Web Services Japan
 
AWS Black Belt Online Seminar 2017 Amazon Kinesis
Amazon Web Services Japan
 
20190604 AWS Black Belt Online Seminar Amazon Simple Notification Service (SNS)
Amazon Web Services Japan
 
20200422 AWS Black Belt Online Seminar Amazon Elastic Container Service (Amaz...
Amazon Web Services Japan
 
20180613 AWS Black Belt Online Seminar AWS Cloud9 入門
Amazon Web Services Japan
 
AWS Black Belt Online Seminar 2017 Amazon DynamoDB
Amazon Web Services Japan
 
20190521 AWS Black Belt Online Seminar Amazon Simple Email Service (Amazon SES)
Amazon Web Services Japan
 
AWS Black Belt Techシリーズ AWS Direct Connect
Amazon Web Services Japan
 
20190911 AWS Black Belt Online Seminar AWS Batch
Amazon Web Services Japan
 
20191016 AWS Black Belt Online Seminar Amazon Route 53 Resolver
Amazon Web Services Japan
 
20190320 AWS Black Belt Online Seminar Amazon EBS
Amazon Web Services Japan
 
AWS EC2 Eメール制限解除 - 逆引き(rDNS)設定 申請手順
Amazon Web Services Japan
 
20190226 AWS Black Belt Online Seminar Amazon WorkSpaces
Amazon Web Services Japan
 
Amazon Pinpoint を中心としたカスタマーエンゲージメントの全体像 / Customer Engagement On Amazon Pinpoint
Amazon Web Services Japan
 
Ad

Similar to 20200714 AWS Black Belt Online Seminar Amazon Neptune (20)

PDF
Deep_dive_on_Amazon_Neptune_DAT361.pdf
ShaikAsif83
 
PDF
20200623 AWS Black Belt Online Seminar Amazon Elasticsearch Service
Amazon Web Services Japan
 
PDF
20181205 AWS Black Belt Online Seminar Amazon Athena (20190510update)
Amazon Web Services Japan
 
PDF
20180801 AWS Black Belt Online Seminar Amazon QuickSight アップデート
Amazon Web Services Japan
 
PDF
20200218 AWS Black Belt Online Seminar Next Generation Redshift
Amazon Web Services Japan
 
PDF
20200804 AWS Black Belt Online Seminar Amazon CodeGuru
Amazon Web Services Japan
 
PDF
20200526 AWS Black Belt Online Seminar AWS X-Ray
Amazon Web Services Japan
 
PDF
20191001 AWS Black Belt Online Seminar AWS Lake Formation
Amazon Web Services Japan
 
PDF
20210127 今日から始めるイベントドリブンアーキテクチャ AWS Expert Online #13
Amazon Web Services Japan
 
PPTX
AWSを利用した開発者・データを扱う人向けの資料
Ashitaba YOSHIOKA
 
PDF
20190821 AWS Black Belt Online Seminar AWS AppSync
Amazon Web Services Japan
 
PDF
Sapporo devfesta 2019/11/13
Kameda Harunobu
 
PDF
はじめよう DynamoDB ハンズオン
Amazon Web Services Japan
 
PDF
グラフデータベース Neptune 使ってみた
Yoshiyasu SAEKI
 
PDF
はじめてのグラフデータベース 〜 Amazon Neptune と主なユースケース 〜
Amazon Web Services Japan
 
PDF
20200930 AWS Black Belt Online Seminar Amazon Kinesis Video Streams
Amazon Web Services Japan
 
PDF
What’s the big deal with Graph Databases?
Daniel Zivkovic
 
PPTX
HBaseCon 2015 General Session: Zen - A Graph Data Model on HBase
HBaseCon
 
PPTX
Fin jaws 202103
Yuki Yoshida
 
PDF
20200205 AWSの16あるデータベースを使いこなそう
Amazon Web Services Japan
 
Deep_dive_on_Amazon_Neptune_DAT361.pdf
ShaikAsif83
 
20200623 AWS Black Belt Online Seminar Amazon Elasticsearch Service
Amazon Web Services Japan
 
20181205 AWS Black Belt Online Seminar Amazon Athena (20190510update)
Amazon Web Services Japan
 
20180801 AWS Black Belt Online Seminar Amazon QuickSight アップデート
Amazon Web Services Japan
 
20200218 AWS Black Belt Online Seminar Next Generation Redshift
Amazon Web Services Japan
 
20200804 AWS Black Belt Online Seminar Amazon CodeGuru
Amazon Web Services Japan
 
20200526 AWS Black Belt Online Seminar AWS X-Ray
Amazon Web Services Japan
 
20191001 AWS Black Belt Online Seminar AWS Lake Formation
Amazon Web Services Japan
 
20210127 今日から始めるイベントドリブンアーキテクチャ AWS Expert Online #13
Amazon Web Services Japan
 
AWSを利用した開発者・データを扱う人向けの資料
Ashitaba YOSHIOKA
 
20190821 AWS Black Belt Online Seminar AWS AppSync
Amazon Web Services Japan
 
Sapporo devfesta 2019/11/13
Kameda Harunobu
 
はじめよう DynamoDB ハンズオン
Amazon Web Services Japan
 
グラフデータベース Neptune 使ってみた
Yoshiyasu SAEKI
 
はじめてのグラフデータベース 〜 Amazon Neptune と主なユースケース 〜
Amazon Web Services Japan
 
20200930 AWS Black Belt Online Seminar Amazon Kinesis Video Streams
Amazon Web Services Japan
 
What’s the big deal with Graph Databases?
Daniel Zivkovic
 
HBaseCon 2015 General Session: Zen - A Graph Data Model on HBase
HBaseCon
 
Fin jaws 202103
Yuki Yoshida
 
20200205 AWSの16あるデータベースを使いこなそう
Amazon Web Services Japan
 
Ad

More from Amazon Web Services Japan (20)

PDF
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
Amazon Web Services Japan
 
PDF
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
Amazon Web Services Japan
 
PDF
202204 AWS Black Belt Online Seminar AWS IoT Device Defender
Amazon Web Services Japan
 
PDF
Infrastructure as Code (IaC) 談義 2022
Amazon Web Services Japan
 
PDF
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
Amazon Web Services Japan
 
PDF
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
Amazon Web Services Japan
 
PDF
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Web Services Japan
 
PPTX
20220409 AWS BLEA 開発にあたって検討したこと
Amazon Web Services Japan
 
PDF
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
Amazon Web Services Japan
 
PDF
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
Amazon Web Services Japan
 
PDF
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
Amazon Web Services Japan
 
PDF
Amazon QuickSight の組み込み方法をちょっぴりDD
Amazon Web Services Japan
 
PDF
マルチテナント化で知っておきたいデータベースのこと
Amazon Web Services Japan
 
PDF
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
Amazon Web Services Japan
 
PDF
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
Amazon Web Services Japan
 
PDF
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
Amazon Web Services Japan
 
PDF
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Web Services Japan
 
PDF
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
Amazon Web Services Japan
 
PPTX
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
Amazon Web Services Japan
 
PDF
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
Amazon Web Services Japan
 
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
Amazon Web Services Japan
 
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
Amazon Web Services Japan
 
202204 AWS Black Belt Online Seminar AWS IoT Device Defender
Amazon Web Services Japan
 
Infrastructure as Code (IaC) 談義 2022
Amazon Web Services Japan
 
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
Amazon Web Services Japan
 
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
Amazon Web Services Japan
 
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Web Services Japan
 
20220409 AWS BLEA 開発にあたって検討したこと
Amazon Web Services Japan
 
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
Amazon Web Services Japan
 
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
Amazon Web Services Japan
 
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
Amazon Web Services Japan
 
Amazon QuickSight の組み込み方法をちょっぴりDD
Amazon Web Services Japan
 
マルチテナント化で知っておきたいデータベースのこと
Amazon Web Services Japan
 
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
Amazon Web Services Japan
 
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
Amazon Web Services Japan
 
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
Amazon Web Services Japan
 
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Web Services Japan
 
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
Amazon Web Services Japan
 
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
Amazon Web Services Japan
 
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
Amazon Web Services Japan
 

Recently uploaded (20)

PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
PDF
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
SMACT Works
 
PDF
Make GenAI investments go further with the Dell AI Factory - Infographic
Principled Technologies
 
PDF
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
PDF
DevOps & Developer Experience Summer BBQ
AUGNYC
 
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Captain IT
 
PDF
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
Shreyas_Phanse_Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
SHREYAS PHANSE
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PPTX
C Programming Basics concept krnppt.pptx
Karan Prajapat
 
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
georgschmitzdoerner
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PDF
Enable Enterprise-Ready Security on IBM i Systems.pdf
Precisely
 
PDF
agentic-ai-and-the-future-of-autonomous-systems.pdf
siddharthnetsavvies
 
PDF
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
PPTX
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
DOCX
Top AI API Alternatives to OpenAI: A Side-by-Side Breakdown
vilush
 
PDF
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
CIFDAQ
 
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
SMACT Works
 
Make GenAI investments go further with the Dell AI Factory - Infographic
Principled Technologies
 
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
DevOps & Developer Experience Summer BBQ
AUGNYC
 
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Captain IT
 
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
Doc9.....................................
SofiaCollazos
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Shreyas_Phanse_Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
SHREYAS PHANSE
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
C Programming Basics concept krnppt.pptx
Karan Prajapat
 
madgavkar20181017ppt McKinsey Presentation.pdf
georgschmitzdoerner
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
Enable Enterprise-Ready Security on IBM i Systems.pdf
Precisely
 
agentic-ai-and-the-future-of-autonomous-systems.pdf
siddharthnetsavvies
 
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
Top AI API Alternatives to OpenAI: A Side-by-Side Breakdown
vilush
 
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
CIFDAQ
 

20200714 AWS Black Belt Online Seminar Amazon Neptune

  • 1. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS 公式 Webinar https://amzn.to/JPWebinar 過去資料 https://amzn.to/JPArchive Solutions Architect 秋田 仁雅 2020/7/14 Amazon Neptune サービスカットシリーズ [AWS Black Belt Online Seminar]
  • 2. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 自己紹介 秋田仁雅 技術統括本部 ISV/SaaSソリューション本部 ソリューションアーキテクト 好きなサービス Amazon Neptune
  • 3. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Black Belt Online Seminar とは • 「サービス別」「ソリューション別」「業種別」のそれぞれのテーマに分かれて、ア マゾン ウェブ サービス ジャパン株式会社が主催するオンラインセミナーシリーズです。 • 質問を投げることができます! • 書き込んだ質問は、主催者にしか見えません • 今後のロードマップに関するご質問は お答えできませんのでご了承下さい ① 吹き出しをクリック ② 質問を入力 ③ Sendをクリック Twitter ハッシュタグは以下をご利用ください #awsblackbelt
  • 4. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 内容についての注意点 • 本資料では2020年7月14日時点のサービス内容および価格についてご説明しています。最新の情 報はAWS公式ウェブサイト(http://aws.amazon.com)にてご確認ください。 • 資料作成には十分注意しておりますが、資料内の価格とAWS公式ウェブサイト記載の価格に相違 があった場合、AWS公式ウェブサイトの価格を優先とさせていただきます。 • 価格は税抜表記となっています。日本居住者のお客様が東京リージョンを使用する場合、別途消 費税をご請求させていただきます。 • AWS does not offer binding price quotes. AWS pricing is publicly available and is subject to change in accordance with the AWS Customer Agreement available at http://aws.amazon.com/agreement/. Any pricing information included in this document is provided only as an estimate of usage charges for AWS services based on certain information that you have provided. Monthly charges will be based on your actual use of AWS services, and may vary from the estimates provided.
  • 5. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. アジェンダ 1. グラフとは 2. グラフDBとは 3. Amazon Neptuneのご紹介 4. はじめるためには 5. まとめ
  • 6. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. アジェンダ 1. グラフとは 2. グラフDBとは 3. Amazon Neptuneのご紹介 4. はじめるためには 5. まとめ
  • 7. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. グラフとは フォロー ブロック フォロー フォロー UserA UserB UserC Userが「フォロー」「ブロック」 などの矢印で結ばれている
  • 8. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. グラフとは Edge Edge Node Node Node 一般化すると、 NodeがEdgeで結ばれている ※NodeはVertexとも呼ばれる Edge Edge
  • 9. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. グラフの例:IP Network リンク Router PC Node: ルータやPC Edge: リンク リンク PC
  • 10. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. グラフの例:路線図 線路 C駅 A駅 Node: 駅、バス停 Edge: 線路、バスルート 線路 B駅 バス停 線路 バス路線
  • 11. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. グラフの例:World Wide Web リンク Node: Webページ Edge: ハイパーリンク リンク Webページ Webページ Webページ
  • 12. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. アジェンダ 1. グラフとは 2. グラフDBとは 3. Amazon Neptuneのご紹介 4. はじめるためには 5. まとめ
  • 13. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. グラフDBとは “グラフモデル”を効率的に格納し、検索するためのDB
  • 14. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 2つのグラフモデルとフレームワーク Apache TinkerPop™ (OSS) Gremlin Traversal Language W3C標準 SPARQL Query Language RDFプロパティグラフ
  • 15. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. プロパティグラフモデル friend block friend friend name:UserA name:UserB name:UserC
  • 16. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. プロパティグラフモデル friend block friend friend name:UserA name:UserB name:UserC Nodeのプロパティ
  • 17. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. プロパティグラフモデル friend block friend friend name:UserA name:UserB name:UserC Nodeのプロパティ Edgeのプロパティ(ラベル)
  • 18. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. プロパティグラフモデル friend Since:2019-07-14 name:UserA age:26 gender:male age:25 job: engineer プロパティは、この図のように複数もつこ とも可能です ノード毎、エッジ毎に異なるプロパティを もつことも可能です
  • 19. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. RDF 述語 主語 目的語 • ノード=>主語、目的語 • エッジ=>述語
  • 20. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. RDF friend UserA UserB “主語” “述語” “目的語” UserA friend UserB.
  • 21. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. RDF friend UserA UserB “主語” “述語” “目的語” UserA friend UserB. UserA の年齢は 26歳. 26 歳 の年齢は
  • 22. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Gremlin 101
  • 23. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Gremlin 101 グラフから全ノードを探したい g.V() => [‘UserA’, ‘UserB’, ‘UserC’] friend friendfriend name:UserA name:UserB name:UserC
  • 24. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Gremlin 101 Nameが“UserA”のノードを探したい g.V().has(‘name’, ’UserA’) => [‘UserA’] friend friendfriend name:UserA name:UserB name:UserC
  • 25. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Gremlin 101 “UserA”の友達であるユーザを探したい g.V().has(‘name’, ’UserA’).out(‘friend’) ⇒ [‘UserB’] friend friendfriend name:UserA name:UserB name:UserC
  • 26. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Gremlin 101 friend friendfriend name:UserA name:UserB name:UserC “UserA”にとって、友達の友達であるユーザを探し たい g.V().has(‘name’: ‘UserA’).out(‘friend’) .out(‘friend’) => [UserC]
  • 27. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Gremlin 101 friend friendfriend name:UserA name:UserB name:UserC “UserA”の友達がLikesをつけているコンテンツを探 したい g.V().has(‘name’: ‘UserA’).out(‘friend’) .out(‘likes’)Likes
  • 28. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. アジェンダ 1. グラフとは 2. グラフDBとは 3. Amazon Neptuneのご紹介 4. はじめるためには 5. まとめ
  • 29. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Neptune の特徴 高速 高信頼性、セキュア オープン簡単
  • 30. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. グラフ処理の分類 • OLTP • 1処理単位でグラフの一部を探索 • リコメンデーション、不正検知など 並列かつ大量に実行される • OLAP • 1処理単位でグラフのすべてを探索 • クラスタリング、全ノードの重みバランスの調整 など 1度の処理が大きい
  • 31. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. クエリ性能 • OLTPのグラフワークロードにおいて 毎秒100,000件のクエリをサポートするよう設計 • 最大15個のリードレプリカ • 専用に設計されたクラウドネイティブなストレージサービス • 最適化されたインメモリアーキテクチャ • クエリの最適化 • 索引(インデックス)はNeptune側で管理される • クエリ実行計画やプロファイルの取得も可能
  • 32. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. リードレプリカ 可用性 • データベースノードの障害は自動的に 検知され、交換される • データベース処理の障害は自動的に検 知され、リソースはリサイクルされる • リードレプリカは必要に応じて自動的 にマスタに昇格する • どのリードレプリカに対して優先的に フェイルオーバーさせるかを指定でき る Primary Node Primary Nodeマスタ Primary Node Primary Node リード レプリカ Primary Node Primary Node リード レプリカ クラスタ/ インスタンス モニタリング パフォーマンス • リードレプリカによってアプリケーション の読み込みトラフィックをスケールアウト させることができる • 読み込みエンドポイントによってリードレ プリカを跨がって負荷が分散される
  • 33. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. クラウドネイティブストレージエンジンの概要 データは3つのアベイラビリティーゾーンに跨がった 6つのレプリカにコピーされる 継続的に堅牢な Amazon S3 へバックアップされる 継続的にノードやディスクが修復される 修復やホットスポットのリバランスのために 10GBのセグメントユニットで管理されている 読み書きにはレイテンシ耐性を持つクォーラムシステムを使 用している クォーラムのメンバーシップが変更されたとしても書き込み は阻害されない ストレージは使用に応じて自動的に64TBまで拡張される AZ 1 AZ 2 AZ 3 Amazon S3 Amazon Neptune ストレージ ノード ストレージ ノード ストレージ ノード ストレージ ノード ストレージ ノード ストレージ ノード ストレージ モニタリング
  • 34. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Point-in-Time リストア オンラインでの point-in-time リストアにより、バックアップからリストアすること なく指定した時間にデータベースの状態を戻すことができる t0 t1 t2 t0 t1 t2 t3 t4 t3 t4 1. t1へ戻る 2. t3へ戻る 不可視 不可視
  • 35. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. セキュリティ • TLSによるクライアント/サーバ間の通信暗号化 • KMSによるストレージの暗号化 • セキュリティグループによるアクセス制御 • AWS IAMロールによる認証 • 監査ログをCloudWatch Logsに発行 • SOC, PCI-DSSなど各種コンプライアンス準拠 https://docs.aws.amazon.com/ja_jp/neptune/latest/userguide/neptune-compliance.html
  • 36. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Neptuneでサポートされるインターフェイス Tinkerpop/Gremlin RDF/SPARQL CLI Gremlin Console RDF4J Console RDF4J Workbench Java Gremlin Driver RDF4J Python Gremlin-Python Driver sparqlwrapper .NET Gremlin.NET - Node.js gremlin-javascript - HTTP REST HTTP REST (Gremlin) HTTP REST (SPARQL) REST以外の HTTP Gremlin HTTP WebSocket API SPARQL HTTP
  • 37. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon ElasticSearch Service連携 • Amazon ElasticSearch Serviceにデータをストリームで連携 • Amazon NeptuneからElasticSearchによる文字列検索が可能
  • 38. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon ElasticSearch Serviceとの連携 Lambda ElasticSearch Service Neptune Streams グラフデータの更新をNeptune Streamsから検知、ElasticSearch Serviceを更新 この構成を構築するCloudFormationのテンプレートが用意 https://docs.aws.amazon.com/ja_jp/neptune/latest/userguide/full-text-search-cfn-create.html neptune_streams パラメータの有効化が必要 Neptune 更新アプリ ケーション 読取アプリ ケーション NeptuneインスタンスからElasticSearchに直接クエリ
  • 39. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ElasticSearch Service連携でLIKE検索やfuzzy検索 Ex1) g.withSideEffect("Neptune#fts.endpoint", "your-es-endpoint-URL") .withSideEffect(“Neptune#fts.queryType”, “query_string”) .withSideEffect(“Neptune#fts.minScore”, 1.5) .V().has("name", "Neptune#fts m*k*"); Ex2) g.withSideEffect("Neptune#fts.endpoint", "your-es-endpoint-URL") .withSideEffect(“Neptune#fts.queryType”, “fuzzy”) .V().has("name", "Neptune#fts mike"); https://docs.aws.amazon.com/ja_jp/neptune/latest/userguide/full-text-search.html Fuzzy検索 Query String 検索 Score 1.5以上のDocumentのみ ワイルドカード
  • 40. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. その他最近のアップデート • データベースクラスタの停止が可能に • 最大停止期間は7日間 • 7日間を超える場合はスナップショットを取得して削除を • db.t3.mediumインスタンスが利用可能に • 0.15USD/時間で利用可能(東京リージョン)
  • 41. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 事例: Zeta Global 顧客識別グラフ • 顧客を識別するためのブラウザCookie などの情報を管理 • 異なるCookieやDeviceIDが同じ顧客を 表した場合にEdgeで結合 • 1日あたり4億5000万クエリ • 平均35msecのレイテンシ https://aws.amazon.com/jp/blogs/news/building-a-customer-identity-graph-with-amazon-neptune/
  • 42. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. アジェンダ 1. グラフとは 2. グラフDBとは 3. Amazon Neptuneのご紹介 4. はじめるためには 5. まとめ
  • 43. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. データの投入 バルクでデータを投入する方法は2種類 • S3上にCSVファイルを用意し、Neptune Loaderでロード • AWS Database Migration Serviceを使用して他のDBから移行
  • 44. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. S3上のCSVファイルによるデータロード NodeのCSVファイル例 EdgeのCSVファイル例 ~id, name:String, age:Int, ~label v1, UserA, 29, person v2, UserB, 30, person ~id,~from,~to,~label e1,v1,v2,follow e2,v2,v1,follow https://docs.aws.amazon.com/ja_jp/neptune/latest/userguide/bulk-load.html
  • 45. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. S3上のCSVファイルによるデータロード NodeのCSVファイル例 EdgeのCSVファイル例 ~id, name:String, age:Int, ~label v1, UserA, 29, person v2, UserB, 30, person ~id,~from,~to,~label e1,v1,v2,follow e2,v2,v1,follow curl -X POST -H 'Content-Type: application/json' https://<neptune-endpoint>:8182/loader -d ' { "source" : "s3://<S3 URI>/", "format" : "csv", "iamRoleArn" : ”<IAM Role ARN>", "region" : ”<region>", "failOnError" : "FALSE", "parallelism" : "MEDIUM", "updateSingleCardinalityProperties" : "FALSE", "queueRequest" : "TRUE" }' ロード実行例 https://docs.aws.amazon.com/ja_jp/neptune/latest/userguide/bulk-load.html
  • 46. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Database Migration Serviceによるデータ移行 RDSや、オンプレミスのRDBなどからデータの移行が可能 RDBのレコードを、ノードやエッジにマッピング 各カラムの値をプロパティに変換 https://docs.aws.amazon.com/ja_jp/neptune/latest/userguide/dms-neptune-replication.html
  • 47. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CLI (Gremlin Console) Groovyベースのコンソール 用途: Gremlinの学習/アプリケーション開発/アドホック分析/データベース運用 https://docs.aws.amazon.com/ja_jp/neptune/latest/userguide/access-graph-gremlin-console.html http://tinkerpop.apache.org/docs/current/reference/#connecting-via-console https://github.com/tinkerpop/gremlin/wiki/Getting-Started $ cat conf/neptune-remote.yaml hosts: [<Neptune end point>] port: 8182 serializer: { className: (省略)} $ cat neptune.groovy :remote connect tinkerpop.server conf/neptune-remote.yaml :remote console $ cat bin/mygremlin.sh bin/gremlin.sh -i neptune.groovy $ bin/mygremlin.sh ¥,,,/ (o o) -----oOOo-(3)-oOOo----- plugin activated: tinkerpop.server plugin activated: tinkerpop.utilities plugin activated: tinkerpop.tinkergraph gremlin> g.V().limit(1) ==>v[Luke] gremlin> サーバー定義 Neptuneに接続する初期化スクリプト 初期化スクリプトを呼び出す起動シェル 起動シェルの実行 Neptuneへのクエリ
  • 48. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Neptune Workbench:Jupyter Notebookからクエリ実行 “%%sparql”や”%%gremlin”を記 述したセルでクエリを実行
  • 49. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Gremlin 実行計画 の取得 JupyterNotebookのセルで“%%gremlin explain”の後にクエリ記述 クエリの実行計画
  • 50. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Gremlin プロファイルの取得 クエリの最後に”.profile()”付与 クエリのプロファイル ”%query_mode profile”マジックコマンドでもprofile取得可能
  • 51. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Neptune Workbench:その他の機能 各マジックコマンドでNeptuneの様々な機能をJupyterNotebookから 実行 • %status • Neptuneクラスタの情報を取得して表示 • %load • S3上のファイルについてURI等を指定し、バルクロードを実行 • %graph_notebook_config • 使用中のJupyterNotebookの接続情報を表示 • %query_mode (query|explain|profile) • クエリモードの変更
  • 52. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 可視化 - 何のための可視化か? • 全体を見るため の可視化 • 一部を見るための 可視化 大規模グラフのOLTP用途では こちらが中心となる 視覚的に全体的な構造を把握 クラスタリングの仮説を立てる ドリルダウン 視覚的にターゲット周辺の構造を把握 トラバーサルの仮説を立てる 実トランザクションの大規模グラフ ではすべてのデータを描画しても 情報過多となる
  • 53. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 例[email protected] OSSツールによる可視化 JavaScriptベースの可視化ツール “Graphexp” GitHubリポジトリ以下のファイル一式をWebブラウザで開くだけ 以下設定でNeptuneに対応 Webブラウザから直接Neptuneエンドポイントに アクセスできる必要がある const SINGLE_COMMANDS_AND_NO_VARS = true; const REST_USE_HTTPS = true; graphConf.js Neptuneエンドポイントインターネット WorkSpaces Workspaces上のブラウザでGraphexpを開く ブラウザのJavaScriptからアクセス https://github.com/bricaud/graphexp
  • 54. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 商用ツールによる可視化 Tom Sawyer https://www.tomsawyer.com/aws-amazon-neptune-visualization/ https://aws.amazon.com/jp/blogs/news/exploring-scientific-research-on- covid-19-with-amazon-neptune-amazon-comprehend-medical-and-the-tom- sawyer-graph-database-browser/ Metaphactory https://metaphacts.com/amazon-neptune https://aws.amazon.com/jp/blogs/apn/exploring-knowledge-graphs-on- amazon-neptune-using-metaphactory/ Keylines ttps://cambridge-intelligence.com/visualizing-the-amazon-neptune- database-with-keylines/
  • 55. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Tom Sawyer: ユースケース Comprehend Medicalで医学論文から意味情報を 抽出しつつトピックごとに分類し、Neptuneに ロード 同じトピックに属する論文や、同じ意味情報の 多くを共有する論文同士の類似関係を視覚化 https://aws.amazon.com/jp/blogs/news/exploring-scientific-research-on-covid-19-with-amazon- neptune-amazon-comprehend-medical-and-the-tom-sawyer-graph-database-browser/
  • 56. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 運用ツール:GraphML 2 Neptune CSV GraphML ファイルをNeptuneでのバルクロードが可能なCSV ファイ ルに変換するツール https://github.com/awslabs/amazon-neptune-tools/tree/master/graphml2csv # TinkerpopのModernデータのうちGraphML形式の tinkerpop-modern.xml をダウンロード $ curl https://raw.githubusercontent.com/apache/tinkerpop/master/data/tinkerpop- modern.xml -o tinkerpop-modern.xml # Pythonスクリプトを実行してノードとエッジの2つのCSVファイルに変換 $ ./graphml2csv.py -i tinkerpop-modern.xml infile = tinkerpop-modern.xml Processing tinkerpop-modern.xml Wrote 6 nodes and 18 attributes to tinkerpop-modern-nodes.csv. Wrote 6 edges and 12 attributes to tinkerpop-modern-edges.csv. # あとは変換されたCSVファイルをS3バケットに配置してNeptuneにバルクロードすればOK TinkerpopのModernデータを変換する例
  • 57. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 運用ツール:Neptune Export • BulkLoaderでNeptuneに取り込み可能なCSVやTurtleフォーマット • 全データ、またはサンプリングやクエリの結果のみをエクスポート • ツール自体をAWS Lambdaにデプロイすることも可能 Neptuneのデータをテキストファイルにエクスポートするツール https://github.com/awslabs/amazon-neptune-tools/tree/master/neptune- export # Mavenなどによりjarを作成 $mvn clean install # endpointとoutputを指定して実行 $ bin/neptune-export.sh export-pg -d ~/neptune/output/ -e <neptune-endpoint> --use-ssl
  • 58. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. [Gremlin] 学習パスの例 Neptune WorkbenchとGraphexpを用いてクエリを実行しながら学習 • Workbenchのサンプルノートブックを実行してみる • AWS SamplesのTutorialに沿ってクエリを実行してみる https://github.com/aws-samples/amazon-neptune-samples/tree/master/gremlin/collaborative-filtering • TinkerpopのTutorialで学習する https://tinkerpop.apache.org/docs/current/tutorials/getting-started/ ※Neptuneにおける実装での相違点に留意しながら実行する https://docs.aws.amazon.com/ja_jp/neptune/latest/userguide/access-graph-gremlin-differences.html
  • 59. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. [RDF/SPARQL] 学習パスの例 • Workbenchのサンプルノートブックを実行してみる • 公開されたグローバルなナレッジベースを用いてSPARQLを学習 例: DBPedia http://ja.dbpedia.org/sparql 既存のクエリを少しずつ改変しながら学ぶなどが有効。
  • 60. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. アジェンダ 1. グラフとは 2. グラフDBとは 3. Amazon Neptuneのご紹介 4. はじめるためには 5. まとめ
  • 61. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. まとめ • グラフとは • SNS、路線図、WWW等、いたるところに • Amazon Neptuneの特徴 • 最大で毎秒100,000件のクエリをサポート • クラウドネイティブストレージによる高信頼性 • 継続的バックアップ、Point-In-Timeリストア • TLSやKMSによる通信やストレージの暗号化 • CloudWatchLogsへの監査ログの発行 • ElasticSearch Serviceとの連携による、柔軟なクエリ • Neptune Workbenchや可視化による、高い開発効率
  • 62. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Q&A • お答えできなかったご質問については • AWS Japan Blog 「https://aws.amazon.com/jp/blogs/news/」にて • 資料公開と併せて、後日掲載します。
  • 63. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ご清聴ありがとうございました