Spring Data Neo4j Webinar Follow up
Spring Data Neo4j Webinar Follow up
Join the DZone community and get the full member experience.Join For Free
Curator's Note: The following is by Michael Hunger.
Thanks again everyone for attending the Intro to Spring Data Neo4j webinar. We hope you enjoyed the presentation and learned a lot. We answered all of your questions below. Feel free to use the listed resources to learn more or to discuss your open questions with us.
Spring Data Neo4j is a reflection of a graph's nature: they are able to work and play well with other systems, while making it easy to make sense of connected data. It also demonstrates that indeed, graphs are everywhere. For more examples of this, be sure to come to GraphConnect in San Francisco, November 5-6 at the Hyatt Regency. There will be talks by hot start-ups, community contributors, and established enterprises telling their own graph story.
- GitHub Repository with the Twitter-Graph sample: https://github.com/jexp/sdn-twitter-graph
Your Questions and our Answers
Q: Do I always have to start the traversal at the root node?
A: It is possible to start a traversal from any node, or set of nodes. Those nodes can be looked up via and index or their id.
Q: What kind of tools are available to explore graph databases/like Toad, Navicat, etc.?
Q: With hibernate, the created SQL can be helpful when trying to do some performance analysis of my queries. Is there something comparable for Neo4j? Or another way to optimize queries?
A: You can set debug to level INFO and then the generated cypher queries are logged. SDN has custom queries where you can specify exactly how the query looks. We support Cypher and Gremlin. http://static.springsource.org/spring-data/data-graph/snapshot-site/reference/html/#d0e1736
Q: In what format does Neo4j store data in file system?
A: Custom storage, optimized separate stores for nodes, relationships and different property types.
Q: In neo4j-server mode does it support fail-over / load-balancing in case i want multiple db nodes deployed?
A: Yes, the Neo4j Enterprise it can run in a cluster with High Availability
Q: In that case, do nodes have to share the storage area or data gets replicated across nodes?
A: It is configured as master/slave replication, each node running on its own machine and filesystem, using a custom protocol for syncing.
Q: Can you comment on the progress of the Spring-Roo add-on?
A: Right now there was no time to work on the roo add-on. We'll look into that after the 2.1 release which is due in about two weeks.
Q: Is is best to index all searchable fields?
A: As often, it depends on the usage pattern and the queries you want to run. There is a write-time price for indexing. Usually you only index the fields you need to look up start nodes for traversals.
Q: How do I make sure the attribute values (e.g. employee id) to a node are not duplicated in my graph DB?
A: You use a unique constraint on an index: http://static.springsource.org/spring-data/data-graph/snapshot-site/reference/html/#d0e2100
Q: How do I do a one time data setup that is generally required for my enterprise applications.
A: There is a batch inserter if you do not want to use SDN directly: http://docs.neo4j.org/chunked/stable/batchinsert.html
Q: Did you run any performance test? How does it compare against conventional RDBMs in terms of performance?
A: It always depends on the use-case and data model, that's why generic or synthetic benchmarks are difficult. Graph databases are very fast for highly connected queries (lots of joins). For global queries the graph database doesn't perform that well. Usually local graph queries are executed in constant time regardless of the size of the graph. There is an benchmark example in the first (free) chapter of Neo4j in Action by Manning.
Q: Missed out, what are Repositories meant for?
A: Repositories are facades for data access. DAO is a similar pattern. SDN removes a lot of the boiler plate stuff you normally have to write.
Q: How is the support for High Availability (clustering/load balancing/fail over) etc?
A: We have an HA/ master-slave-replication solution: http://docs.neo4j.org/chunked/stable/ha-how.html
Q: What is the level of spring support for Neo4j, in sense like transaction etc?
A: Just add @Transactional to your service methods like you normally would. We also support DI, Exception Translation, Spring Converters, JavaConfig …
Q: Do I need the Spring framework to use this? Can't I use this as a stand alone library?
A: Right now yes, there are plans to make it work for instance in a JEE environment via CDI.
Q: Does it work as a persistence (JPA based) to have a temporary memory data and pushes to the storage?
A: Spring Data Neo4j is similar to JPA but relies on Neo4j's caches and in memory structures. Spring Data Neo4j reads and writes your objects to the graph or provides a live view (advanced mapping).
- See the Spring Data Neo4j site for more info: http://spring.neo4j.org
- Guidebook on Spring Data Neo4j published by InfoQ (e-book & in print) http://bit.ly/sdn-book
- All about Neo4j: http://neo4j.org
- Neo4j & SDN videos and webinars: http://video.neo4j.org
- Spring Data Forum at http://spring.neo4j.org/discussions
- Neo4j Google Group http://neo4j.org/forums
- Local Area Neo4j meetup groups http://neo4j.meetup.com
Published at DZone with permission of Will Soprano . See the original article here.
Opinions expressed by DZone contributors are their own.