To graphdb or not to graphdb is elasticsearch the answer


(Janet Harrison) #1

Why benefits does Elastic Search offer over graph databases such as neo4j???


(Steve Kearns) #2

Hi Janet,

It all depends on what you're planning to do :slight_smile:

They are build on very different technological foundations. Elasticsearch is designed as a scalable near-real-time search and analytics engine. As such, when documents are added to Elasticsearch, we index them into both an inverted index, and a column store. The Elasticsearch query DSL makes it easy to ask complex questions and combine the attributes of high-speed filtering and relevance ranking using the inverted index, with analytical queries that allow you to summarize & slice/dice with multi-level aggregations.

Graph databases, on the other hand, have a very different indexing strategy, focusing on exact-matches, and don't have the same ability to calculate relevance when walking their graphs, or do the same kind of general aggregations queries. Instead, they provide a rich, graph-centric query language, which gives you a lot of power to explore highly connected datasets, based primarily on the number of link occurrences. Some graph databases do now use some search-like capabilities to help jumpstart the graph-walking process, but these are typically used for "find starting nodes" and then exact-match expansion is used from there.

The timing of your question is good! We are actually in the process of building our own graph query API on top of Elasticsearch, which capitalizes on our strengths - identifying the relevant, or meaningful links - while keeping the API itself simple. This Graph API isn't intended as a wholesale replacement for Graph DB's, but should provide new ways to explore the relationships in the data that you store in ES. The beauty of this approach is that it doesn't require a separate system or different index. The Graph API will work against the same indexes you already have, and just provide a new graph-centric way of querying it. Stay tuned for more information on this in the coming months!

Hope that helps!
Steve


(system) #3