Database Reference
In-Depth Information
The only thing we want to highlight in this section is that, although each of these APIs can
be used individually to interact with the graph, they build on each other to a certain extent
(in a bit of a stack-like manner). More importantly, they each have their own sweet spots.
Depending on what you're trying to do, it's up to you to choose the right tool for the job.
Figure 11.4 provides an overview of the primary goals and approaches used by each API.
Figure 11.4. Programmatic API stack
If performance is of the utmost importance, you'll probably want to drop down and use the
Core API, as this provides you with the most flexibility and control over your interaction
with the graph. This comes at a price, as it requires explicit knowledge of exactly how the
graph data is laid out in order to interact with it, and this interaction can be quite verbose.
The Traversal API provides a slightly more friendly API, where users provide goals such
as “do a depth-first search to depth 3,” allowing Neo4j to take care of interacting with the
core API to realize the results. Although this API is easier for the developer to use, the
slightly higher level of abstraction means that it may not perform quite as optimally as the
Core API.
Then there's Cypher—the declarative, humane, graph query language, and arguably the
most intuitive and friendly of all the APIs to use. Many would say Cypher represents the
future of Neo4j, as so much development effort is being directed in this area. Its general
 
Search WWH ::




Custom Search