Graph Databases can solve problems that your normal database struggle with. These can be hard problems, and not all of them were mentioned as graph problems in your CS classes. Using a Graph Database correctly can save the day, and make you look like a super star among your peers.
Find out what a Graph Database can do for you. You might not have a classic "graph problem," but a Graph Database might still be a good solution for your data. Learn what problems Graph Databases solve, how to use one, and most importantly when to use a Graph Database. All of this with concrete examples using the Neo4j Graph Database.
With this talk, we want to:
* Show you what kinds of data are at the sweet spot of Graph Databases.
* How to structure your database to reap the benefits of graphy data
* Teach you how to know when to use a Graph Database, and the fundaments of how to do so
* Show you real application examples on the Neo4j Graph Database
Graph Databases can solve problems that your normal database struggle with. These can be hard problems, and not all of them were mentioned as graph problems in your CS classes. Using a Graph Database correctly can save the day, and make you look like a super star among your peers.\n\nFind out what a Graph Database can do for you. You might not have a classic "graph problem," but a Graph Database might still be a good solution for your data. Learn what problems Graph Databases solve, how to use one, and most importantly when to use a Graph Database. All of this with concrete examples using the Neo4j Graph Database.\n\nWith this talk, we want to:\n* Show you what kinds of data are at the sweet spot of Graph Databases.\n* How to structure your database to reap the benefits of graphy data\n* Teach you how to know when to use a Graph Database, and the fundaments of how to do so\n* Show you real application examples on the Neo4j Graph Database\n
\n
\n
We are assuming that you are pretty much like us. We want to build things, useful, cool things. Sure theoretical discussions are fun, but at the end of the day, I want things that work, and things that make my users go “wow”. \n
Database performance is like air. You don’t miss it until it’s not there. We don’t want to have to think about the performance. \n
This is another we don’t want to have to think about is if our data is safe. We just assume it is. If the database tells us it’s saved the data, we should trust it.\n
\n
\n
Relational databases are very useful, in some contexts. The pain comes when we try to shoe horn in our data. We loose semantics, and we have to do a lot of extra work to make it work.\n
Databases introduce accidental complexity, i.e. not complexity that has to do with the domain complexity. I want a database that gets out of my way. \n
First you whiteboard a sketch of how you want your data. Then you create a ER-diagram, which is then mapped to a physical model. And let’s not forget our normal forms - I’m sure everyone here makes sure that their database schema is at least in Boyce-Codd Normal Form, right? This is by no means an intuitive process - it takes time to learn. I remember clearly the first few times I had to do this.\n
When we shoehorn our data into a mold it doesn’t really fit in, we also loose performance. The key factor here is that as data size grows, query time grows. And modern systems today create a lot of data.\n
\n
So what are the alternatives? \n
So what are the alternatives? \n
So what are the alternatives? \n
So what are the alternatives? \n
So what are the alternatives? \n
So what are the alternatives? \n
So what are the alternatives? \n
Use the right shape of database for the right kind of object\n
When it comes to size, most databases scale just fine for most of the use cases. The second question is how much complexity your database can handle for you. You can do any complex procedure on any database, so the question is: how much can you unload on your database, and how fast does it do it.\n
When it comes to size, most databases scale just fine for most of the use cases. The second question is how much complexity your database can handle for you. You can do any complex procedure on any database, so the question is: how much can you unload on your database, and how fast does it do it.\n
When it comes to size, most databases scale just fine for most of the use cases. The second question is how much complexity your database can handle for you. You can do any complex procedure on any database, so the question is: how much can you unload on your database, and how fast does it do it.\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
nodes\nrelationships between nodes\nrelationships have types and directions\nrelationships are traversed equally fast in each direction, direction may be significant or not\nnodes have properties\nrelationships have properties\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
Querying a graph is done by traversing it.\nTraversing the graph means moving through it to find and gather results\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
A path is one or more nodes with relationships between them,\nthe number of relationships in a path is always one less than the number of nodes, i.e. zero or more\nA node may occur multiple times in a path, but the path defines a sequence by the interconnecting relationships\n
A path is one or more nodes with relationships between them,\nthe number of relationships in a path is always one less than the number of nodes, i.e. zero or more\nA node may occur multiple times in a path, but the path defines a sequence by the interconnecting relationships\n
A path is one or more nodes with relationships between them,\nthe number of relationships in a path is always one less than the number of nodes, i.e. zero or more\nA node may occur multiple times in a path, but the path defines a sequence by the interconnecting relationships\n
A path is one or more nodes with relationships between them,\nthe number of relationships in a path is always one less than the number of nodes, i.e. zero or more\nA node may occur multiple times in a path, but the path defines a sequence by the interconnecting relationships\n
A path is one or more nodes with relationships between them,\nthe number of relationships in a path is always one less than the number of nodes, i.e. zero or more\nA node may occur multiple times in a path, but the path defines a sequence by the interconnecting relationships\n
A path is one or more nodes with relationships between them,\nthe number of relationships in a path is always one less than the number of nodes, i.e. zero or more\nA node may occur multiple times in a path, but the path defines a sequence by the interconnecting relationships\n
A path is one or more nodes with relationships between them,\nthe number of relationships in a path is always one less than the number of nodes, i.e. zero or more\nA node may occur multiple times in a path, but the path defines a sequence by the interconnecting relationships\n
A path is one or more nodes with relationships between them,\nthe number of relationships in a path is always one less than the number of nodes, i.e. zero or more\nA node may occur multiple times in a path, but the path defines a sequence by the interconnecting relationships\n
A path is one or more nodes with relationships between them,\nthe number of relationships in a path is always one less than the number of nodes, i.e. zero or more\nA node may occur multiple times in a path, but the path defines a sequence by the interconnecting relationships\n
A path is one or more nodes with relationships between them,\nthe number of relationships in a path is always one less than the number of nodes, i.e. zero or more\nA node may occur multiple times in a path, but the path defines a sequence by the interconnecting relationships\n
A path is one or more nodes with relationships between them,\nthe number of relationships in a path is always one less than the number of nodes, i.e. zero or more\nA node may occur multiple times in a path, but the path defines a sequence by the interconnecting relationships\n
Contrary to many other non relational databases, Neo4j has full ACID transactions.\n
A transaction is either committed in its entirety, or not at all, never partial.\nNeo4j guarantees the integrity of relationships. The two nodes must exist.\nYou cannot access the state of an uncommitted transaction from outside of that transaction.\nNeo4j guarantees that when a transaction is committed it has been written to disk.\n
A transaction is either committed in its entirety, or not at all, never partial.\nNeo4j guarantees the integrity of relationships. The two nodes must exist.\nYou cannot access the state of an uncommitted transaction from outside of that transaction.\nNeo4j guarantees that when a transaction is committed it has been written to disk.\n
A transaction is either committed in its entirety, or not at all, never partial.\nNeo4j guarantees the integrity of relationships. The two nodes must exist.\nYou cannot access the state of an uncommitted transaction from outside of that transaction.\nNeo4j guarantees that when a transaction is committed it has been written to disk.\n
A transaction is either committed in its entirety, or not at all, never partial.\nNeo4j guarantees the integrity of relationships. The two nodes must exist.\nYou cannot access the state of an uncommitted transaction from outside of that transaction.\nNeo4j guarantees that when a transaction is committed it has been written to disk.\n
A transaction is either committed in its entirety, or not at all, never partial.\nNeo4j guarantees the integrity of relationships. The two nodes must exist.\nYou cannot access the state of an uncommitted transaction from outside of that transaction.\nNeo4j guarantees that when a transaction is committed it has been written to disk.\n
A transaction is either committed in its entirety, or not at all, never partial.\nNeo4j guarantees the integrity of relationships. The two nodes must exist.\nYou cannot access the state of an uncommitted transaction from outside of that transaction.\nNeo4j guarantees that when a transaction is committed it has been written to disk.\n
A transaction is either committed in its entirety, or not at all, never partial.\nNeo4j guarantees the integrity of relationships. The two nodes must exist.\nYou cannot access the state of an uncommitted transaction from outside of that transaction.\nNeo4j guarantees that when a transaction is committed it has been written to disk.\n
A transaction is either committed in its entirety, or not at all, never partial.\nNeo4j guarantees the integrity of relationships. The two nodes must exist.\nYou cannot access the state of an uncommitted transaction from outside of that transaction.\nNeo4j guarantees that when a transaction is committed it has been written to disk.\n
A transaction is either committed in its entirety, or not at all, never partial.\nNeo4j guarantees the integrity of relationships. The two nodes must exist.\nYou cannot access the state of an uncommitted transaction from outside of that transaction.\nNeo4j guarantees that when a transaction is committed it has been written to disk.\n
A transaction is either committed in its entirety, or not at all, never partial.\nNeo4j guarantees the integrity of relationships. The two nodes must exist.\nYou cannot access the state of an uncommitted transaction from outside of that transaction.\nNeo4j guarantees that when a transaction is committed it has been written to disk.\n
A transaction is either committed in its entirety, or not at all, never partial.\nNeo4j guarantees the integrity of relationships. The two nodes must exist.\nYou cannot access the state of an uncommitted transaction from outside of that transaction.\nNeo4j guarantees that when a transaction is committed it has been written to disk.\n
A transaction is either committed in its entirety, or not at all, never partial.\nNeo4j guarantees the integrity of relationships. The two nodes must exist.\nYou cannot access the state of an uncommitted transaction from outside of that transaction.\nNeo4j guarantees that when a transaction is committed it has been written to disk.\n
A transaction is either committed in its entirety, or not at all, never partial.\nNeo4j guarantees the integrity of relationships. The two nodes must exist.\nYou cannot access the state of an uncommitted transaction from outside of that transaction.\nNeo4j guarantees that when a transaction is committed it has been written to disk.\n
A transaction is either committed in its entirety, or not at all, never partial.\nNeo4j guarantees the integrity of relationships. The two nodes must exist.\nYou cannot access the state of an uncommitted transaction from outside of that transaction.\nNeo4j guarantees that when a transaction is committed it has been written to disk.\n
A transaction is either committed in its entirety, or not at all, never partial.\nNeo4j guarantees the integrity of relationships. The two nodes must exist.\nYou cannot access the state of an uncommitted transaction from outside of that transaction.\nNeo4j guarantees that when a transaction is committed it has been written to disk.\n
A transaction is either committed in its entirety, or not at all, never partial.\nNeo4j guarantees the integrity of relationships. The two nodes must exist.\nYou cannot access the state of an uncommitted transaction from outside of that transaction.\nNeo4j guarantees that when a transaction is committed it has been written to disk.\n
\n
\n
TO DECIDE: include or not?\n
\n
[AT]\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
Schema evolution is only in the application layer. Making sense of the data is your applications responsibility, not the databases.\n
[AT]\nIf the data you store is hierarchical, chances are that a graph database is a good solution for you. \n
Has anyone in this room tried to store tree structures in a relational database? Hands up. I’ve done it a number of times - a content management system we built all the way back in 1997, and as late as last year, for an online mobile shopping site. Here are some ways you can do it.\n
The good old adjacency list. Simple, intuitive, and fast for writing. Reading from it is not quite as easy. This is probably the most used way of doing it, and offers no support for a lot of quite common queries you want to do.\n
Nested sets are the brain child of Joe Celko I believe, and a clever way of representing tree structures. The only problem is that adding to a tree, or moving branches of the tree requires roughly half the tree to move to the left or to the right.\n
I have actually never personally encountered this “in the wild”. But it’s an interesting way of solving the problem: just build up strings that show the path from the root to every single node in the tree. \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
[AT]\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
1000 persons = 50’000 relationships\n
1000 persons = 50’000 relationships\n
1000 persons = 50’000 relationships\n
1000 persons = 50’000 relationships\n
1000 persons = 50’000 relationships\n
\n
\n
\n
\n
\n
\n
20 million nodes\n64 million relationships between these nodes\nA* routing in this dataset - avg answer after 100 ms.\nOur worst response took three seconds, and the answer contained 5500 road segments.\n
20 million nodes\n64 million relationships between these nodes\nA* routing in this dataset - avg answer after 100 ms.\nOur worst response took three seconds, and the answer contained 5500 road segments.\n
20 million nodes\n64 million relationships between these nodes\nA* routing in this dataset - avg answer after 100 ms.\nOur worst response took three seconds, and the answer contained 5500 road segments.\n
20 million nodes\n64 million relationships between these nodes\nA* routing in this dataset - avg answer after 100 ms.\nOur worst response took three seconds, and the answer contained 5500 road segments.\n
20 million nodes\n64 million relationships between these nodes\nA* routing in this dataset - avg answer after 100 ms.\nOur worst response took three seconds, and the answer contained 5500 road segments.\n