Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
[LT]Amazon Neptuneで始める初めてのグラフDB ー グラフDBを使う意味を考える ー
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Satoshi Kaneyasu
September 06, 2024
Programming
580
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
[LT]Amazon Neptuneで始める初めてのグラフDB ー グラフDBを使う意味を考える ー
Satoshi Kaneyasu
September 06, 2024
More Decks by Satoshi Kaneyasu
See All by Satoshi Kaneyasu
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
380
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
【業務アプリのモダナイズ】このまま保守・改修し続けて大丈夫ですか?
satoshi256kbyte
1
76
今から学ぶベクトルデータベース基礎知識からAmazon Bedrock Knowledge Basesまで
satoshi256kbyte
2
24
Amazon Managed Grafana で Amazon DynamoDB のデータを可視化する Infinity Plugin + プライベート API 構成
satoshi256kbyte
1
42
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
850
AWS Transform Customによる Spring Boot 2.xから4.xへのVerUp
satoshi256kbyte
2
170
運用ダッシュボードの設計を誰も教えてくれないのだけどみなさんどうしてるんですか? - チームに監視するという文化を根付かせるための第一歩を踏みたい -
satoshi256kbyte
1
240
AWS CDK ExpressモードとCI/CDの組み合わせ
satoshi256kbyte
1
79
Other Decks in Programming
See All in Programming
Domain-Driven Transformation
hschwentner
2
2.3k
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
120
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
130
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
300
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.2k
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
300
R8 の設定見直しでアプリサイズ削減
andpad
0
220
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
140
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
180
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
570
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Visualization
eitanlees
153
17k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
480
WCS-LA-2024
lcolladotor
0
890
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
600
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.2k
Google's AI Overviews - The New Search
badams
0
1.6k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
890
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Transcript
Amazon Neptuneで始める初めてのグラフDB -グラフDBを使う意味を考える- 2024.09.07
2 自己紹介 氏名:兼安 聡 所属:株式会社サーバーワークス アプリケーションサービス部 在住:広島(フルリモート) 担当:DevOps、PM、SM 2024 Japan
AWS Top Engineers (Database) 2024 Japan AWS All Certifications Engineers 認定スクラムマスター X:@satoshi256kbyte
3 今回のLTについて Amazon NeptuneはグラフDBが扱えるマネージドサービス です これを用いて生まれて初めてグラフDBを触ってみました 触ってみた結果自分が感じたグラフDBの意味を共有します
4 Amazon Neptuneで表現したグラフDB API Gateway CPU 最適化 メモリ 最適化 一般
EC2 ALB ECS オンプレ Tom Sawyerで出力してますが、 発表用に見やすさ重視で加工してます
5 Amazon Neptuneで表現したグラフDB わかる人にはわかる知識のつながり を表現している API Gateway CPU 最適化 メモリ
最適化 一般 EC2 ALB ECS オンプレ
6 Amazon Neptuneで表現したグラフDB つまりベテランの頭の中を 図示したもの、マインドマップ API Gateway CPU 最適化 メモリ
最適化 一般 EC2 ALB ECS オンプレ
7 Amazon Neptuneで表現したグラフDB ある程度の知識があれば、 これを見て新たな気づきが得られる API Gateway CPU 最適化 メモリ
最適化 一般 EC2 ALB ECS オンプレ ALBって、オンプレとも連携できる かもしれないのか(気づき)
8 グラフのモデルとクエリ言語 モデル クエリ言語 構造 プロパティグラフ • Gremlin (Apache TinkerPop)
• Cypher (Neo4j) • ノード(頂点)とエッジ(辺)で構成 • ノードとエッジに任意のプロパティを持つ • ノード: エンティティやオブジェクト • エッジ: ノード間の関係 RDF • SPARQL • トリプル形式(主語、述語、目的語) • 主語: リソースやエンティティ • 述語: 関係やプロパティ • 目的語: 関係の相手やプロパティの値
9 グラフのモデルとクエリ言語 モデル クエリ言語 構造 プロパティグラフ • Gremlin (Apache TinkerPop)
• Cypher (Neo4j) • ノード(頂点)とエッジ(辺)で構成 • ノードとエッジに任意のプロパティを持つ • ノード: エンティティやオブジェクト • エッジ: ノード間の関係 RDF • SPARQL • トリプル形式(主語、述語、目的語) • 主語: リソースやエンティティ • 述語: 関係やプロパティ • 目的語: 関係の相手やプロパティの値 今回はプロパティグラフと Gremlinを使用
10 構成図 グラフDBにAmazon Neptuneを使用 データ登録はPython+Gremlin プログラムはJupyter Notebookで実行 勉強目的なのであえてプログラムでデータ 投入 データの参照はマーケットプレイスの、
Tom Sawyerを使用 Tom Sawyerはグラフの可視化に優れる 自前でグラフDBをインストールして 準備するより圧倒的に楽
11 Amazon Neptuneへのデータ投入 port = 8182 server = '{Amazon Neptuneのエンドポイント}'
endpoint = f'wss://{server}:{port}/gremlin' graph = Graph() connection = DriverRemoteConnection(endpoint, 'g', transport_factory=lambda: AiohttpTransport(call_from_event_loop=True)) g.addV('compute').property(T.id, '1').property('name', 'EC2').iterate() g.addV('networking & container delivery').property(T.id, '4').property('name', 'ELB').iterate() # エッジ(繋がり)を追加 (ELBとEC2) g.V('4').addE('connect').to(__.V('1')).iterate() 雰囲気だけ感じてください 一見面倒に見えるが、 新たな繋がりを作る時にテーブル定義の 変更が発生しないのが大きい
12 一部を切り出すこともできる g.V().has('name', 'EC2').outE('instance type') CPU 最適化 メモリ 最適化 一般
EC2
13 一部を切り出すこともできる import pandas as pd # EC2とインスタンスタイプの情報を取得し、表形式で表示する ec2_instance_type_info =
g.V().has('name', 'EC2') \ .as_('ec2') \ .outE('instance type').inV() \ .project('compute_name', 'instance_type_name', 'first_character') \ .by(__.select('ec2').values('name')) \ .by(__.values('name')) \ .by(__.values('first character')) \ .toList() # 結果をDataFrameに変換 df = pd.DataFrame(ec2_instance_type_info) compute_name instance_type_name first_character EC2 一般 m EC2 コンピューティング最適化 c EC2 メモリ最適化 r
14 知識のデータの話なのでベクトルDBとグラフDBの違いを考える ベクトルDB 生成AIに使われる 類似性検索を得意としている グラフDB 複雑な関係をより自然に表現できる 人に理解と気づきを与えるのに適している データの準備に時間がかかるのは同じ
16 <まとめ>私が感じたグラフDBの意味 グラフDBはわかる人にはわかる繋がりを表現できる つまり、ベテランの頭の中であり、これを見たほうが 早く理解と気づきを得られる可能性がある という方向性でグラフDBを試行錯誤してます 同士がいたら一緒に活用方法を考えさせてください
17 ありがとうございました
None
19 Appendix 今回検証に使用したソースコード https://github.com/satoshi256kbyte/study-graphdb-neptune