I am a newbie to Neo4j, and can't quite understand why Neo4j must be faster than an efficient SQL query. Is it because of data structure or underlying query implementation? I really appreciate if someone can help me to get a crack on this.
Every join makes SQL slower, but traversals in Neo4j, from node to node, tend to be almost immediate. Since most queries involve some form of deeply connected data, there is a wide array of use cases where Neo4j and other graph databases outperform standard SQL databases.
Neo4j is the most famous graph database management system and it is also a NoSQL database system which is developed by Neo4j, Inc. It is different from Mysql or MongoDB as it has its features that makes it special compared to other Database Management System.
Additionally, Neo4j has scalability weaknesses related to scaling writes, hence if your application is expected to have very large write throughputs, then Neo4j is not for you.
Complex queries typically run faster in graph databases than they do in relational databases. Relational databases require complex joins on data tables to perform complex queries, so the process is not as fast.
Neo4j ist not generally faster than an SQL database. It is just in many cases faster for graph based problems. For example if you'd like to find the shortest path between two entities Neo4j will most likely outperform MySQL etc. because of the way the data is structured and the algorithms you can use because of this structure. Neo4j stores it's data as nodes and relationships between these nodes. They are directly connected. A simple shortest path algorithm is a breadth-first search. You start at one node and expand it's connected nodes, then for each of it's children you do the same, until you find the end node. This way you will touch only a small amount of data. In an SQL query you can't do this easily, so you have to build something in your code, that traverses the result sets and generates new queries for each result and so on. So you will end up with a lot of queries.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With