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
Adopting Neo4j @ Enterprise scale
Search
Dmitrijs Vrublevskis
October 14, 2016
Programming
84
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Adopting Neo4j @ Enterprise scale
Dmitrijs Vrublevskis
October 14, 2016
More Decks by Dmitrijs Vrublevskis
See All by Dmitrijs Vrublevskis
Cypher Editor
fylmtm
0
160
Cypher in JetBrains IDE
fylmtm
0
210
League of Graphs \w Neo4j
fylmtm
0
1.7k
Performance & Stability testing \w Gatling
fylmtm
0
230
Neo4j Magic Adventures
fylmtm
1
200
Vim introduction
fylmtm
1
130
Google I/O 2014 - Web updates
fylmtm
0
160
Other Decks in Programming
See All in Programming
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
0
180
symfony/aiとlaravel/boost
77web
0
120
Webフレームワークの ベンチマークについて
yusukebe
0
200
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
160
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
500
【やさしく解説 設計編・中級 #1】一つの車に、運転手は一人 ~ある倉庫システムの事例から~
panda728
PRO
0
140
Claude Opus 4.6以後の受託開発エンジニアの変化(Claude Code開発ノウハウ大公開スペシャルbyクラスメソッド)
iidatakuma
1
420
関数型プログラミングのメリットって何だろう?
wanko_it
0
160
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
140
えっ!!コードを読まずに開発を!?
hananouchi
0
170
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
210
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
2
820
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Context Engineering - Making Every Token Count
addyosmani
9
1k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
380
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
460
Making Projects Easy
brettharned
120
6.7k
Product Roadmaps are Hard
iamctodd
55
12k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
970
Documentation Writing (for coders)
carmenintech
77
5.4k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
630
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Transcript
Adopting Neo4j @ Enterprise scale
Dmitry Vrublevsky Software developer @ ƀ
[email protected]
@FylmTM Ambassador @
Agenda 1. Why graph databases? 2. Why Neo4j? 3. Neo4j
internals 4. Use cases
GRAPH
NOT GRAPH
Graphs 101 Circle - node Arrow - relationship
Proof-of-Concept Evaluate Neo4j Graph Database as replacement to existing RDBMS
solution.
Small dataset Medium dataset Large dataset
Why graph databases? Domain Use case
Telecommunication domain
Use case: Validate network 5+ is OK
Use case: Validate network 5+ is OK
Use case: Validate network :( 5+ is OK
Why Neo4j? Highly scalable native graph database that leverages data
relationships as first-class entities. by Neo Technology, Inc.
http://db-engines.com/en/ranking
Features Native Processing & Storage ACID Cypher - Graph Query
Language REST & Native API Optional schema Lock Manager High-performance cache Clustering Backups Monitoring Community Enterprise
First-class Everything is an entity Entities have properties Entities have
a type
First-class {details: —} :LIKES :DMITRY :HighLoadStrategy {works_with: Neo4j} {day: 14.10.2016}
Properties Labels Type
Neo4j internals 1. Native storage 2. Native processing
Native storage Specifically designed to store and manage graphs.
http://neo4j.com/developer/graph-db-vs-rdbms/
http://neo4j.com/developer/graph-db-vs-rdbms/
http://neo4j.com/developer/graph-db-vs-rdbms/
Native processing Efficient way of processing graph data since connected
nodes physically “point” to each other a.k.a. “index-free adjacency”
$ ls -1 data/databases/graph.db | column -c 100 index neostore.propertystore.db.index.id
index.db neostore.propertystore.db.index.keys messages.log neostore.propertystore.db.index.keys.id neostore neostore.propertystore.db.strings neostore.counts.db.a neostore.propertystore.db.strings.id neostore.counts.db.b neostore.relationshipgroupstore.db neostore.id neostore.relationshipgroupstore.db.id neostore.labeltokenstore.db neostore.relationshipstore.db neostore.labeltokenstore.db.id neostore.relationshipstore.db.id neostore.labeltokenstore.db.names neostore.relationshiptypestore.db neostore.labeltokenstore.db.names.id neostore.relationshiptypestore.db.id neostore.nodestore.db neostore.relationshiptypestore.db.names neostore.nodestore.db.id neostore.relationshiptypestore.db.names.id neostore.nodestore.db.labels neostore.schemastore.db neostore.nodestore.db.labels.id neostore.schemastore.db.id neostore.propertystore.db neostore.transaction.db.0 neostore.propertystore.db.arrays neostore.transaction.db.1 neostore.propertystore.db.arrays.id schema neostore.propertystore.db.id store_lock neostore.propertystore.db.index
$ ls -1 data/databases/graph.db | column -c 100 index neostore.propertystore.db.index.id
index.db neostore.propertystore.db.index.keys messages.log neostore.propertystore.db.index.keys.id neostore neostore.propertystore.db.strings neostore.counts.db.a neostore.propertystore.db.strings.id neostore.counts.db.b neostore.relationshipgroupstore.db neostore.id neostore.relationshipgroupstore.db.id neostore.labeltokenstore.db neostore.relationshipstore.db neostore.labeltokenstore.db.id neostore.relationshipstore.db.id neostore.labeltokenstore.db.names neostore.relationshiptypestore.db neostore.labeltokenstore.db.names.id neostore.relationshiptypestore.db.id neostore.nodestore.db neostore.relationshiptypestore.db.names neostore.nodestore.db.id neostore.relationshiptypestore.db.names.id neostore.nodestore.db.labels neostore.schemastore.db neostore.nodestore.db.labels.id neostore.schemastore.db.id neostore.propertystore.db neostore.transaction.db.0 neostore.propertystore.db.arrays neostore.transaction.db.1 neostore.propertystore.db.arrays.id schema neostore.propertystore.db.id store_lock neostore.propertystore.db.index
Storage layout Node (15 bytes) in_use next_rel_id next_prop_id labels extra
Relationship (34 bytes) directed | in_use first_node second_node rel_type first_prev_rel_id first_next_rel_id second_prev_rel_id second_next_rel_id next_prop_id first_in_chain_markers
Storage layout Node (15 bytes) next_rel_id Relationship (34 bytes) first_node
second_node first_prev_rel_id first_next_rel_id
Storage math Node = RecordSize * ID Relationship = RecordSize
* ID
Traversal (Node -> Relationship) Node (15 bytes) next_rel_id=2 Relationships (34
bytes) 2 * 34 = 68 0B 34B 68B 102B 136B 170B
Traversal (Relationship -> Node) Relationship (34 bytes) Nodes (15 bytes)
0B 15B 30B 45B 60B 75B first_node=1 second_node=4 1 * 15 = 15 4 * 15 = 60
Native summary O(1) traversal hops Avoid super nodes!
Cypher Cypher is a declarative graph query language that allows
for expressive and efficient querying. https://github.com/opencypher/openCypher
Cypher 101 ASCII art: ( ) - node --> -
relationship Keywords: MATCH CREATE WHERE RETURN
Cypher example (1) MATCH (root)-->(children) RETURN *
Cypher example (2) MATCH (t:Towers) -[:CHILDREN]-> (n:NetworkPiece) -[:CHILDREN]-> (e:Function) WHERE
NOT (t)-[:CHILDREN]->(:CellJCA) RETURN t
Neo4j adoption
Application Persistence layer Neo4j driver Neo4j Performance Fast Slow Persistence
service
Application Persistence layer Neo4j driver Neo4j Performance Fast Slow Persistence
service
Use cases Measurement average, 98% Resource usage ~ same
UC: Sync Before Neo4j ~90m ~35m Count Per second Node
count 80.32M 37498 Relationship count 80.30M 37488 Properties count 257.78M 120345
UC: Single node Before Neo4j 3ms 2ms MATCH (n) WHERE
n.id = {id} RETURN n
UC: Subgraph Before Neo4j 88ms 14ms MATCH (n)-[r*]->(c) WHERE n.id
= {id} RETURN *
UC: By type Before Neo4j 235ms 194ms MATCH (t:Tower) RETURN
t
UC: Count Before Neo4j 32ms 16ms MATCH (n)-[r*]->(c) WHERE n.id
= {id} RETURN count(*)
3 4 5 6 8 2 7 1 UC: Traversal
Before Neo4j 112ms 39ms MATCH (n)-[r]->(c) WHERE n.id = {id} RETURN *
Future • Real graph API for application • Rewrite manual
traversals to Cypher queries
Deployment • Implemented in Java • Works everywhere • Writes
- vertical scaling • Reads - horizontal scaling • Extensions & Stored procedures
Stability • High load on DB • Kill Slave/master •
Rolling upgrade • Split-brain • Server power-off
None