Upload
Download free for 30 days
Login
Submit search
Graph Database and Amazon Neptune
4 likes
13,382 views
Amazon Web Services Japan
AWS Dev Day 資料: Graph Database and Amazon Neptune
Technology
Read more
1 of 70
Download now
Downloaded 49 times
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
More Related Content
PDF
20190424 AWS Black Belt Online Seminar Amazon Aurora MySQL
Amazon Web Services Japan
PDF
The Twelve-Factor Appで考えるAWSのサービス開発
Amazon Web Services Japan
PDF
20200722 AWS Black Belt Online Seminar AWSアカウント シングルサインオンの設計と運用
Amazon Web Services Japan
PDF
20190911 AWS Black Belt Online Seminar AWS Batch
Amazon Web Services Japan
PDF
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design Pattern
Amazon Web Services Japan
PDF
20210316 AWS Black Belt Online Seminar AWS DataSync
Amazon Web Services Japan
PPTX
20211109 JAWS-UG SRE keynotes
Amazon Web Services Japan
PDF
20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...
Amazon Web Services Japan
20190424 AWS Black Belt Online Seminar Amazon Aurora MySQL
Amazon Web Services Japan
The Twelve-Factor Appで考えるAWSのサービス開発
Amazon Web Services Japan
20200722 AWS Black Belt Online Seminar AWSアカウント シングルサインオンの設計と運用
Amazon Web Services Japan
20190911 AWS Black Belt Online Seminar AWS Batch
Amazon Web Services Japan
AWS Black Belt Online Seminar 2018 Amazon DynamoDB Advanced Design Pattern
Amazon Web Services Japan
20210316 AWS Black Belt Online Seminar AWS DataSync
Amazon Web Services Japan
20211109 JAWS-UG SRE keynotes
Amazon Web Services Japan
20180425 AWS Black Belt Online Seminar Amazon Relational Database Service (Am...
Amazon Web Services Japan
What's hot
(20)
PDF
20200811 AWS Black Belt Online Seminar CloudEndure
Amazon Web Services Japan
PDF
20190806 AWS Black Belt Online Seminar AWS Glue
Amazon Web Services Japan
PDF
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...
Amazon Web Services Japan
PDF
20190731 Black Belt Online Seminar Amazon ECS Deep Dive
Amazon Web Services Japan
PDF
オンプレミスRDBMSをAWSへ移行する手法
Amazon Web Services Japan
PDF
[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティス
Amazon Web Services Japan
PDF
20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)
Amazon Web Services Japan
PDF
20190129 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
Amazon Web Services Japan
PDF
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
Amazon Web Services Japan
PDF
AWS Black Belt Online Seminar 2017 AWSにおけるアプリ認証パターンのご紹介
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 2017 Amazon DynamoDB
Amazon Web Services Japan
PDF
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
Amazon Web Services Japan
PDF
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
Amazon Web Services Japan
PDF
AWS Black Belt Online Seminar 2017 Amazon ElastiCache
Amazon Web Services Japan
PDF
20190320 AWS Black Belt Online Seminar Amazon EBS
Amazon Web Services Japan
PDF
20190319 AWS Black Belt Online Seminar Amazon FSx for Windows Server
Amazon Web Services Japan
PDF
AWSのログ管理ベストプラクティス
Akihiro Kuwano
PDF
AWS BlackBelt Online Seminar 2017 Amazon CloudFront + AWS Lambda@Edge
Amazon Web Services Japan
PDF
AWS Black Belt Online Seminar コストの観点から見るアカウント管理
Amazon Web Services Japan
20200811 AWS Black Belt Online Seminar CloudEndure
Amazon Web Services Japan
20190806 AWS Black Belt Online Seminar AWS Glue
Amazon Web Services Japan
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...
Amazon Web Services Japan
20190731 Black Belt Online Seminar Amazon ECS Deep Dive
Amazon Web Services Japan
オンプレミスRDBMSをAWSへ移行する手法
Amazon Web Services Japan
[Aurora事例祭り]Amazon Aurora を使いこなすためのベストプラクティス
Amazon Web Services Japan
20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)
Amazon Web Services Japan
20190129 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
Amazon Web Services Japan
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
Amazon Web Services Japan
AWS Black Belt Online Seminar 2017 AWSにおけるアプリ認証パターンのご紹介
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 2017 Amazon DynamoDB
Amazon Web Services Japan
20190220 AWS Black Belt Online Seminar Amazon S3 / Glacier
Amazon Web Services Japan
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
Amazon Web Services Japan
AWS Black Belt Online Seminar 2017 Amazon ElastiCache
Amazon Web Services Japan
20190320 AWS Black Belt Online Seminar Amazon EBS
Amazon Web Services Japan
20190319 AWS Black Belt Online Seminar Amazon FSx for Windows Server
Amazon Web Services Japan
AWSのログ管理ベストプラクティス
Akihiro Kuwano
AWS BlackBelt Online Seminar 2017 Amazon CloudFront + AWS Lambda@Edge
Amazon Web Services Japan
AWS Black Belt Online Seminar コストの観点から見るアカウント管理
Amazon Web Services Japan
Ad
Similar to Graph Database and Amazon Neptune
(20)
PDF
20180703 AWS Black Belt Online Seminar Amazon Neptune
Amazon Web Services Japan
PDF
AWSの様々なアーキテクチャ
Kameda Harunobu
PDF
20180619 AWS Black Belt Online Seminar データレイク入門: AWSで様々な規模のデータレイクを分析する効率的な方法
Amazon Web Services Japan
PPT
Blueprintsについて
Tetsuro Nagae
PDF
Re invent 2017 データベースサービス総復習!
Satoru Ishikawa
PDF
大規模ネットワークの性質と先端グラフアルゴリズム
Takuya Akiba
PDF
AWSによるグラフDB構築
Alexander Patrikalakis
PDF
Lunch & Learn, AWS NoSQL Services
Insight Technology, Inc.
PDF
セマンテックウェブとRDFDB
Hirosuke Asano
PDF
社会ネットワーク分析第7回
Satoru Mikami
PPTX
Neoの世界へ
時雨 大西
PPTX
Getting Started with Graph Database with Python
ロフト くん
PDF
AWSクラウドサービスツアー
a-hisame
PDF
レコメンデーション(協調フィルタリング)の基礎
Katsuhiro Takata
PDF
RDBでのツリー表現入門2024
Kent Ohashi
PDF
RDBでのツリー表現入門
Kent Ohashi
PDF
Apache tinkerpopとグラフデータベースの世界
Yuki Morishita
PDF
「NOSQLの基礎知識」講義資料 第20回JDMC定例セミナー(201310)
CLOUDIAN KK
KEY
activerecord-turntable
Drecom Co., Ltd.
PPTX
Game Architecture Trends in Tokyo Kansai Social Game Study#5
Yasuhiro Matsuo
20180703 AWS Black Belt Online Seminar Amazon Neptune
Amazon Web Services Japan
AWSの様々なアーキテクチャ
Kameda Harunobu
20180619 AWS Black Belt Online Seminar データレイク入門: AWSで様々な規模のデータレイクを分析する効率的な方法
Amazon Web Services Japan
Blueprintsについて
Tetsuro Nagae
Re invent 2017 データベースサービス総復習!
Satoru Ishikawa
大規模ネットワークの性質と先端グラフアルゴリズム
Takuya Akiba
AWSによるグラフDB構築
Alexander Patrikalakis
Lunch & Learn, AWS NoSQL Services
Insight Technology, Inc.
セマンテックウェブとRDFDB
Hirosuke Asano
社会ネットワーク分析第7回
Satoru Mikami
Neoの世界へ
時雨 大西
Getting Started with Graph Database with Python
ロフト くん
AWSクラウドサービスツアー
a-hisame
レコメンデーション(協調フィルタリング)の基礎
Katsuhiro Takata
RDBでのツリー表現入門2024
Kent Ohashi
RDBでのツリー表現入門
Kent Ohashi
Apache tinkerpopとグラフデータベースの世界
Yuki Morishita
「NOSQLの基礎知識」講義資料 第20回JDMC定例セミナー(201310)
CLOUDIAN KK
activerecord-turntable
Drecom Co., Ltd.
Game Architecture Trends in Tokyo Kansai Social Game Study#5
Yasuhiro Matsuo
Ad
More from Amazon Web Services Japan
(20)
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
PDF
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
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
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
Amazon Web Services Japan
Recently uploaded
(7)
PDF
ココロ分解帳|感情をやさしく分解し自分と他者を理解するためのモバイルノートアプリ
hatedwunao
PDF
Working as an OSS Developer at Ruby Association Activity Report 2025
Hiroshi SHIBATA
PDF
翔泳社 「C++ ゼロからはじめるプログラミング」対応 C++学習教材(三谷純)
Jun MITANI
PDF
[email protected]
Matsushita Laboratory
PPTX
生成AIとモデルベース開発:実はとても相性が良いことを説明します。まあそうだろうなと思われる方はご覧ください。
Akira Tanaka
PDF
AIシステムのセキュリティ:脅威となりつつあるAIの現状と課題 [English] Security of AI Systems: The Current...
Takeshi Takahashi
PDF
20250826_Devinで切り拓く沖縄ITの未来_AI駆動開発勉強会 沖縄支部 第2回
Masaki Yamakawa
ココロ分解帳|感情をやさしく分解し自分と他者を理解するためのモバイルノートアプリ
hatedwunao
Working as an OSS Developer at Ruby Association Activity Report 2025
Hiroshi SHIBATA
翔泳社 「C++ ゼロからはじめるプログラミング」対応 C++学習教材(三谷純)
Jun MITANI
[email protected]
Matsushita Laboratory
生成AIとモデルベース開発:実はとても相性が良いことを説明します。まあそうだろうなと思われる方はご覧ください。
Akira Tanaka
AIシステムのセキュリティ:脅威となりつつあるAIの現状と課題 [English] Security of AI Systems: The Current...
Takeshi Takahashi
20250826_Devinで切り拓く沖縄ITの未来_AI駆動開発勉強会 沖縄支部 第2回
Masaki Yamakawa
Graph Database and Amazon Neptune
1.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. Graph Database and Amazon Neptune 2018.11.01
2.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 自己紹介 五十嵐 建平 技術統括本部 ソリューションアーキテクト 好きなサービス • Amazon Aurora • Amazon RDS Performance Insights • Amazon Neptune
3.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 内容についての注意点 • 本資料では2018年11月1日時点のサービス内容および価格についてご説明しています。最新の情報 は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.
4.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 本セッションの内容 • どのような場面でグラフデータベースを使うべきか • Amazon Neptuneの特徴 • Gremlinの例 • 開発時のベストプラクティス • 可視化
5.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. どのような場面で グラフデータベースを 使うべきなのか?
6.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. グラフ構造〜ノードとエッジ ソーシャルグラフ 出身地
7.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 自分が開発している アプリケーションのデータは グラフ構造なのか? 出身地
8.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. データモデリングからの視点 多対多 グラフデータベース 1対1 Key-Value ストア 多対1 RDBMS
9.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 請求書では? すべての関連が 多対1 It's Relational Data 請求書 マスタ 請求書 明細 顧客 https://images-fe.ssl-images-amazon.com/images/G/09/help/others/b2b_invoice_sample.png
10.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. ソーシャルグラフでは? すべての関連が多対多 It's Graph
11.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. Many Many-to-Many
12.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. SQLからの視点 使用するSQL文に 再帰With句や Connect By (Oracle) を使う必要がある with tab(ID,PID,Lv,Path) as( select ID,PID,1 from Data where PID is null union all select d.ID,d.PID,t.Lv+1 from tab t, Data d where t.ID = d.PID) select * from tab; グラフ探索はクエリの複雑性が高くなりやすい
13.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. グラフデータのユースケース ソーシャル グラフ ライフサイエンス ネットワーク/IT運用不正検出 レコメンデーション ナレッジグラフ
14.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. RDBによるグラフデータ(高度に連結したデータ)での課題 SQL グラフ処理 に不向き 厳格なスキーマ
15.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. グラフデータベース グラフ構造のために最適化された 効率的なストレージと 探索エンジン
16.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. グラフ処理の分類 Traversal Analytics
17.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. Amazon Neptuneの特徴
18.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 従来のグラフデータベースの課題にアプローチ 可用性スケール I/F価格
19.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. クエリ性能 • Traversalワークロードにおいて 毎秒100,000件のクエリをサポートするよう設計 • 最大15個のリードレプリカ • 専用に設計されたクラウドネイティブなストレージサービス • 最適化されたインメモリアーキテクチャ • クエリの最適化 • 索引を作成する必要がない • Neptune側で自動的に最適なI/Oパスを実行
20.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. リージョン • 米国東部 (バージニア北部) • 米国東部 (オハイオ) • 米国西部 (オレゴン) • 欧州 (アイルランド) • 欧州 (ロンドン) 順次拡大予定
21.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. Gremlinの例(基礎)
22.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 2つのグラフモデルとフレームワーク Apache TinkerPop™ (OSS) Gremlin Traversal Language W3C標準 SPARQL Query Language RDFプロパティグラフ https://docs.aws.amazon.com/ja_jp/neptune/latest/userguide/access-graph-gremlin-differences.html
23.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. プロパティグラフ • 頂点(Vertex)はエンティティ/ドメイン • 辺(Edge)は頂点間の関係 name: Bill name: Sarah UserUser FRIEND strength: 1
24.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. プロパティグラフの作成 g.addV('User').property('name','Bill'); g.addV('User').property('name','Sarah'); g.V().has('name','Sarah').as('a'). V().has('name','Bill'). addE('FRIEND').to('a').property('strength',1); g.V().has('name','Bill').out('FRIEND') name: Sarah User name: Bill User 2つの頂点を追加 FRIEND strength: 1 エッジで接続 BillからFRIEND をたどって Sarahを得る
25.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. Gremlin • グラフ構造を渡り歩くための専用言語 • Domain-specific Language • オブジェクトを探索する小人のイメージ • 順序よくステップを踏んでいく • エッジに行って… ラベルやプロパティを見て… 必要であれば計算処理もして…
26.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. トラバーサルの例 g.V().has("name", "Sue"). in("WORKS_FOR"). in("WORKS_FOR"). count() name: Sue name: Ed name: Helen WORKS_FOR WORKS_FOR name: Bill name: Mary WORKS_FOR WORKS_FOR name: Terry WORKS_FOR
27.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 探索ソース g.V().has("name", "Sue"). in("WORKS_FOR"). in("WORKS_FOR"). count() name: Sue name: Ed name: Helen WORKS_FOR WORKS_FOR name: Bill name: Mary WORKS_FOR WORKS_FOR name: Terry WORKS_FOR g
28.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 探索の生成 g.V().has("name", "Sue"). in("WORKS_FOR"). in("WORKS_FOR"). count() name: Sue name: Ed name: Helen WORKS_FOR WORKS_FOR name: Bill name: Mary WORKS_FOR WORKS_FOR name: Terry WORKS_FOR T 開始ノードを 探索
29.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. IN側の WORKS_FOR エッジをフォロー g.V().has("name", "Sue"). in("WORKS_FOR"). in("WORKS_FOR"). count() name: Sue name: Ed name: Helen WORKS_FOR WORKS_FOR name: Bill name: Mary WORKS_FOR WORKS_FOR name: Terry WORKS_FOR TT Incoming エッジ 探索されるのは 頂点
30.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. さらにIN側のWORKS_FORエッジをフォロー g.V().has("name", "Sue"). in("WORKS_FOR"). in("WORKS_FOR"). count() name: Sue name: Ed name: Helen WORKS_FOR WORKS_FOR name: Bill name: Mary WORKS_FOR name: Terry WORKS_FORWORKS_FOR TT T
31.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. ノードのカウント g.V().has("name", "Sue"). in("WORKS_FOR"). in("WORKS_FOR"). count() name: Sue name: Ed name: Helen WORKS_FOR WORKS_FOR name: Bill name: Mary WORKS_FOR WORKS_FOR name: Terry WORKS_FOR 3
32.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. Gremlinの例 (Social Networkにおける レコメンデーション)
33.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 三角閉路を作る FRIEND 太郎 花子
34.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 三角閉路を作る FRIEND FRIEND 雲海 太郎 花子
35.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 三角閉路を作る FRIEND FRIEND 雲海 太郎 花子
36.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 三角閉路を作る FRIEND FRIEND 雲海 太郎 花子 FRIEND
37.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. いいところ • 似たもの同士を結びつける • 類は友を呼ぶ • 友だちの友だちは友だちだろう • オンラインレコメンデーション • "雲海"にバインド • 周りのグラフから友だちではない"友だちの友だち"を探索 • 新たなエッジをレコメンデーション
38.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 新たなエッジをレコメンデーション 雲海
39.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 既に存在する友だち関係 FRIEND 雲海 太郎
40.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 見つけた! FRIEND FRIEND 雲海 太郎 花子
41.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. レコメンデーション FRIEND FRIEND 雲海 太郎 花子
42.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. サンプルデータ
43.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 新たな友だちをレコメンドする g.V().has('name','Terry').as('user'). both('FRIEND').aggregate('friends'). both('FRIEND'). where(neq('user')).where(without('friends')). groupCount().by('name'). order(local).by(values, decr)
44.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. Terryを探す g.V().has('name','Terry').as('user'). both('FRIEND').aggregate('friends'). both('FRIEND'). where(neq('user')).where(without('friends')). groupCount().by('name'). order(local).by(values, decr) ユーザ
45.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. Terryの友だちを探索 g.V().has('name','Terry').as('user'). both('FRIEND').aggregate('friends'). both('FRIEND'). where(neq('user')).where(without('friends')). groupCount().by('name'). order(local).by(values, decr) ユーザ 友だち 方向は無視 探索集合をくくって 名前付け
46.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 友だちの友だち・・・ g.V().has('name','Terry').as('user'). both('FRIEND').aggregate('friends'). both('FRIEND'). where(neq('user')).where(without('friends')). groupCount().by('name'). order(local).by(values, decr) ユーザ 友だち 友だちの 友だち FRIEND FRIEND
47.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. …だけどTerryの友だちではない g.V().has('name','Terry').as('user'). both('FRIEND').aggregate('friends'). both('FRIEND'). where(neq('user')).where(without('friends')). groupCount().by('name'). order(local).by(values, decr) ユーザ 友だち 友だちの 友だち X FRIEND FRIEND 自分以外 名前付けされた 探索集合でもない
48.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 名前ごとにグループ化してカウント g.V().has('name','Terry').as('user'). both('FRIEND').aggregate('friends'). both('FRIEND'). where(neq('user')).where(without('friends')). groupCount().by('name'). order(local).by(values, decr) nameごとに グループ化して カウントした値を valuesに追加
49.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 共通の友だちの数でソート g.V().has('name','Terry').as('user'). both('FRIEND').aggregate('friends'). both('FRIEND'). where(neq('user')).where(without('friends')). groupCount().by('name'). order(local).by(values, decr)
50.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 結果 [Henry:3, Emily:2, Colin:2, Kate:1, Sarah:1, Chloe:1]
51.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. クエリ性能 • Traversalワークロードにおいて 毎秒100,000件のクエリをサポートするよう設計 g.V().has('name','Terry').as('user'). both('FRIEND').aggregate('friends'). both('FRIEND'). where(neq('user')).where(without('friends')). groupCount().by('name'). order(local).by(values, decr)
52.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 開発時のベストプラクティス
53.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. RDBMSからの移行 (TinkerPop) データベース S3バケット バルクロードCSV作成/配置 SQL発行+整形を EC2やコンテナで実施 フォルダ指定して 実行 スキーマ ユーザ 商品 ノード ユーザ-商品 エッジ ユーザ-ユーザ フォルダ
54.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. EC2やLambdaからのアクセス Neptune はVPC内に配置される • Public IP は付与されない • Lambdaを使うならVPC内に https://docs.aws.amazon.com/ja_jp/neptune/latest/userguide/access-graph-launch-ec2-instance.html VPC インターネットEC2 Lambda S3バケット
55.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. バルクロード • トランザクションとはならない • 追加のみ • 1ファイルずつマルチスレッド実行される 大きなgzip圧縮されたファイルを用いるのが良い • インスタンスタイプによりほぼ線形に速度が変わる バルクロード時だけ r4.8xlarge を使用して終わったら 通常クエリ用のインスタンスタイプにする
56.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. SQL文の移行 • SQLの実行計画をヒントにトラバーサルを組み立てる PK検索 NESTED LOOPS FILTER NESTED LOOPS g.V().has(…). both(…). where(…). both(…)
57.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. デバッグ path(), simplePath(), cyclicPath() を使ってトラバー サルを把握する gremlin> g.V(1).both().both() ==>v[1] ==>v[4] ==>v[6] ==>v[1] ==>v[5] ==>v[3] ==>v[1] gremlin> g.V(1).both().both().simplePath() ==>v[4] ==>v[6] ==>v[5] ==>v[3] gremlin> g.V(1).both().both().simplePath().path() ==>[v[1], v[3], v[4]] ==>[v[1], v[3], v[6]] ==>[v[1], v[4], v[5]] ==>[v[1], v[4], v[3]] gremlin> g.V(1).both().both().cyclicPath() ==>v[1] ==>v[1] ==>v[1] gremlin> g.V(1).both().both().cyclicPath().path() ==>[v[1], v[3], v[1]] ==>[v[1], v[2], v[1]] ==>[v[1], v[4], v[1]]
58.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. インターフェイス一覧 Tinkerpop/Gremlin RDF/SPARQL バルクロード Neptuneの管理 コンソール Gremlin Console RDF4J Console RDF4J Workbench - AWS CLI Java Gremlin Driver RDF4J - AWS SDK for Java Python Gremlin-Python Driver - - boto3 .NET Gremlin.NET - - AWS SDK for .NET HTTP REST HTTP REST (Gremlin) HTTP REST (SPARQL) Neptune Loader API Health Status REST以外の HTTP Gremlin HTTP WebSocket API SPARQL HTTP - -
59.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 返り値はjson pythonの例 graph = Graph() g = graph.traversal().withRemote( DriverRemoteConnection( 'ws://your-neptune-endpoint:8182/gremlin','g')) print(g.V().limit(2).toList()) WebSocket APIの結果 がパススルーされる
60.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 更新処理 • 1リクエスト = 1トランザクションとなる (READ COMMITTED) • よくある悩み: 大量一括更新 スループットを最適化するためには・・・ • アプリ側で並列化 並列度 = 2 x vCPU数からスタートして調整 • ただし並列化するとトランザクションも分割される • 並列化時の更新競合が発生しないようにする • 粒度を大きくする 1リクエストの最大サイズは150MB • deleteはリクエストサイズが小さい • r4.8xlarge で数億件一括削除も可能 • スループットを上げるのなら並列化する • ロングラン時には neptune_query_timeout を調整する • デフォルト2分
61.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. インメモリ最適化 • Neptuneはインメモリ処理に最適化している • ホットデータがインスタンスにキャッシュされておくようにする • メモリ量はインスタンスタイプに依存する • リードレプリカを活用する • 更新と読み取りの分離 • アプリケーション側でグラフ領域によってエンドポイントを変える • 定常時にストレージ読み込みがないことが望ましい • CloudWatchメトリックの ReadThroughput が低いことを確認する
62.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. マルチテナンシー • Gremlin • 単一グラフのみをサポート • 複数グラフを扱う際はアプリケーション側でカバーすればOK • ラベルやプロパティを重複しないようにすれば良い • SPARQL • 名前付きグラフをサポート • データローダーは NQuads またはトリプルでの名前付きグラフ 指定をサポート
63.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 可視化
64.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 何のための可視化か? 全体を見るための 可視化 一部を見るための 可視化 大規模グラフのOLTP用途では こちらが中心となる 視覚的に全体的な構造を把握 クラスタリングの仮説を立てる ドリルダウン 視覚的にターゲット周辺の構造を把握 トラバーサルの仮説を立てる 大規模グラフではすべてのデータを 描画しても情報過多となる
65.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. オープンなインターフェイスの活用 GremlinまたはRDF/SPARQLに対応した可視化ツールを使用 ※ Neptune自体は可視化機能を提供しない 可視化ツールの例 カテゴリ インターフェイス Graphexp オープンソース Gremlin Tom Sawyer Software 商用 Gremlin RDF/SPARQL Metaphactory 商用 Gremlin RDF/SPARQL Cambridge Intelligence / Keylines 商用 RDF/SPARQL
66.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. Graphexp JavaScriptベースのシンプルな 可視化ツール 簡単な設定でNeptuneに対応 Webブラウザから直接Neptune エンドポイントにアクセス できる必要がある https://github.com/bricaud/graphexp
67.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. 可視化の使用例 クエリのデバッグの補助
68.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. まとめ • どのような場面でグラフデータベースを使うべきか • Amazon Neptuneの特徴 • Gremlinの例 • 開発時のベストプラクティス • 可視化
69.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. さいごに Amazon Neptune についてもっと知りたい方はこちら • 公式ページ https://aws.amazon.com/jp/neptune/ • ドキュメントやチュートリアルなどのリソース https://aws.amazon.com/jp/neptune/developer-resources/ • Amazon Neptune Forum https://forums.aws.amazon.com/forum.jspa?forumID=253 • [AWS Black Belt Online Seminar] Amazon Neptune https://aws.amazon.com/jp/blogs/news/webinar-bb-neptune-20180703/ Amazon Neptune で スケーラブルで堅牢なグラフデータベースを 実現しましょう!
70.
© 2018, Amazon
Web Services, Inc. or its Affiliates. All rights reserved. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ご参加ありがとうございました
Download