Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Graph databases for fun and profit (Geekcamp.sg)
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
vivekprahlad
August 18, 2012
Technology
490
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Graph databases for fun and profit (Geekcamp.sg)
vivekprahlad
August 18, 2012
More Decks by vivekprahlad
See All by vivekprahlad
Continuous Delivery in Practice
vivekprahlad
0
57
Other Decks in Technology
See All in Technology
Android の公式 Skill / Android skills
yanzm
0
160
[チョークトーク資料]AWS DevOps Agent を使いこなす / AWS Dev Ops Agent Chalk Talk AWS Summit Japan 2026
kinunori
3
630
Chainlitで作るお手軽チャットUI
ynt0485
0
280
10年間のブログ発信を振り返って見えたWebアプリケーションエンジニアとしての軌跡
stefafafan
0
170
PostgreSQL 19 新機能概要 OSC Hokkaido 2026
nori_shinoda
0
190
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
2k
AIチャット検索改善の3週間
kworkdev
PRO
2
150
AWS Security Agent といっしょに脅威モデリングをやってみよう
amarelo_n24
1
190
新しいUbuntu/GNOMEが使いたいからXからWaylandへ移行頑張ってるの巻 2026-06-20
nobutomurata
0
160
現場のトークンマネジメント
dak2
1
150
ACE-Step-1.5で見る 音楽生成AIのしくみと“破綻だけ直す”Retake機能の開発【zennfes spring 2026 登壇資料】
personabb
1
550
AWS Security Hub CSPMの成功・失敗体験
cmusudakeisuke
0
320
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
225
10k
Speed Design
sergeychernyshev
33
1.9k
Un-Boring Meetings
codingconduct
0
320
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
610
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
56k
Git: the NoSQL Database
bkeepers
PRO
432
67k
We Are The Robots
honzajavorek
0
250
Building AI with AI
inesmontani
PRO
1
1.1k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
210
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
850
Transcript
Graph databases for fun and profit Vivek Prahlad
About me
None
None
Contributor to Neo4j.rb
Multitenancy, Versioning, Performance
Author of Frankenstein
A graph primer What can you use graph databases for?
Examples (Neo4j.rb)
A graph primer What can you use graph databases for?
Examples (Neo4j.rb)
What is a graph?
A graph is an abstract representation of a set of
objects where some pairs of objects are connected by links
Graphs are all around us
Object graphs
Product Order Customer places 1: n chooses 1: n
None
None
http://tambrahmrage.tumblr.com/post/8594230361/rage-against-the-macchinar
None
None
None
None
None
None
Undirected Graph
Directed Graph
Knows Knows
Knows Knows Name: Vivek Name: Paul Name: Andy
Knows Knows Name: Vivek Name: Paul Name: Andy Since: April
2012
Knows Knows Name: Vivek Name: Paul Name: Andy Since: April
2012 Since: September 2003
What on earth is a graph database?
A database with an explicit graph structure
Each node knows it’s neighbours
Typically directed graphs
None
Two main operations
Find nodes
Either explicitly
Node[node_id]
Or use an index
Car.find(“name: Ferr*”)
Traverse, given an origin
None
Graph algorithms
Shortest path
14 2 11 15 14 9 6 9 10
Graph database options
None
None
The examples will use Neo4j
What is Neo4j?
Neo4j is an ACID compliant graph database
“Graph databases like Neo4j are an esoteric but powerful member
of the NoSQL family”
Capacity?
32 Billion nodes 32 Billion relationships 64 Billion properties
Threadsafe
Single depth transactions
Nested transactions: ‘Placebo’ transactions
Lucene integration
TWO query languages
Cypher
Gremlin
Advanced and enterprise editions for monitoring, replication, hot backup
A graph primer What can you use graph databases for?
Neo4j.rb
Typical applications
None
None
None
Recommendation systems
None
Fraud detection
Geospatial analysis
None
But
Most complex domains
Involve an object graph
A graph primer What can you use graph databases for?
Examples (Neo4j.rb)
Modeling graphs is important
None
Partitioning data crucial
Neo4j Language bindings
Java, C#, Ruby, Node.js
Embedded vs. REST server
Runs on JRuby
Builds on ActiveModel
validations, nested attributes, composed_of, all work
Built in migration support
Multitenancy support
Versioning
3 layer API
Layer 1: Nodes, Relationships
Neo4j::Transaction run do Neo4j::Node.new(:name => “A”) end
Layer 2: Node and Relationship Mixins
class SportsCar include Neo4j::NodeMixin property :brand end
Layer 3: Rails Model support
class SportsCar < Neo4j::Rails::Model property :brand end
class SportsCar < Neo4j::Rails::Model include Neo4j::Rails::Versioning property :brand end
class SportsCar < Neo4j::Rails::Model include Neo4j::Rails::Versioning property :brand, :index =>:fulltext
end
class User < Neo4j::Rails::Model attr_accessor :password attr_accessible :email, :password, :password_confirmation,
:pending_account after_save :encrypt_password email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i # add an exact lucene index on the email property property :email, :index => :exact has_one(:avatar).to(Avatar) validates :email, :presence => true,:format => { :with => email_regex } validates :email, :uniqueness => true, :unless => :pending_account? accepts_nested_attributes_for :avatar, :allow_destroy => true end
Versioning
None
None
None
None
None
Multitenancy
None
None
A few cypher examples
START a=node(3) MATCH (a)-[:KNOWS]->(b)-[:KNOWS]->(c) RETURN a,b,c
|a | b | c | |Node[3]{name->Vivek}|Node[2] |Node[3]|
START d=node(1), e=node(2) MATCH p = shortestPath( d-[*..15]->e ) RETURN
p
(1)--[KNOWS,2]-->(3)--[KNOWS,0]-->(4)--[KNOWS,3]-->(2)
In conclusion
Graphs are a compelling way to store interconnected data
No O/R mismatch
More widely applicable than you’d think
Try it out!
https://github.com/andreasronge/ neo4j.git
Thank You
@vivekprahlad
[email protected]