Polyglot persistence is all about taking advantage of the strengths of multiple database technologies together to enhance your application. The Neo4j Doc Manager for Mongo Connector allows application developers to use the Neo4j graph database alongside the MongoDB document database to add functionality to applications.
3. Agenda
• MongoDB overview
• Why MongoDB + Neo4j?
• Use case
• Neo4j Doc Manager for Mongo Connector
• New community project
• Demo!
+
MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc.
4. MongoDB
Document Database
• Document datamodel
• JSON-like documents (BSON)
• Complex queries
• Replication / sharding
{
"session": {
"title": "12 Years of Spring: An Open Source Journey",
"abstract": "Spring emerged as a core open source project in early 2003 and
evolved to a broad portfolio of open source projects up until 2015."
},
"topics": [
"keynote",
"spring"
],
"room": "Auditorium",
"timeslot": "Wed 29th, 09:30-10:30",
"speaker": {
"name": "Juergen Hoeller",
"bio": "Juergen Hoeller is co-founder of the Spring Framework open source
project.",
"twitter": "https://twitter.com/springjuergen",
"picture": "http://www.springio.net/wp-content/uploads/2014/11/
juergen_hoeller-220x220.jpeg"
}
}
MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc.
5. Why Neo4j + MongoDB?
Polyglot persistence
• Take advantage of features of each database technology
• http://martinfowler.com/bliki/PolyglotPersistence.html
• Native graph datamodel
• Index free adjacency
• Graph traversal queries
• Document datamodel
• Performant document reads / writes
• Complex querying
• Aggregation (MapReduce)
MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc.
12. Neo4j Doc Manager
Mongo Connector
• Automatically sync documents from
MongoDB to Neo4j
• Convert BSON documents into graph
model
• Alpha version on Github - feedback
welcome!
https://github.com/neo4j-contrib/neo4j_doc_manager
13. Neo4j Doc Manager
Automatically sync documents from MongoDB to Neo4j
MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc.
14. Neo4j Doc Manager
Converts BSON documents into property graph model
• Documents converted to property graph
• Based on structure of the document
15. Document to property graph talk.json
{
"session": {
"title": "12 Years of Spring: An Open Source
Journey",
"abstract": "Spring emerged as a core open source
project in early 2003 and evolved to a broad portfolio of
open source projects up until 2015."
},
"topics": [
"keynote",
"spring"
],
"room": "Auditorium",
"timeslot": "Wed 29th, 09:30-10:30",
"speaker": {
"name": "Juergen Hoeller",
"bio": "Juergen Hoeller is co-founder of the Spring
Framework open source project.",
"twitter": "https://twitter.com/springjuergen",
"picture": "http://www.springio.net/wp-content/
uploads/2014/11/juergen_hoeller-220x220.jpeg"
}
}
16. Document to property graph talk.json
{
"session": {
"title": "12 Years of Spring: An Open Source
Journey",
"abstract": "Spring emerged as a core open source
project in early 2003 and evolved to a broad portfolio of
open source projects up until 2015."
},
"topics": [
"keynote",
"spring"
],
"room": "Auditorium",
"timeslot": "Wed 29th, 09:30-10:30",
"speaker": {
"name": "Juergen Hoeller",
"bio": "Juergen Hoeller is co-founder of the Spring
Framework open source project.",
"twitter": "https://twitter.com/springjuergen",
"picture": "http://www.springio.net/wp-content/
uploads/2014/11/juergen_hoeller-220x220.jpeg"
}
}
19. MongoDB Product Catalog Design Pattern
{
“courseId”: “a843fc”,
“description”: “Neo4j is in use in thousands of deployments around the world.Through this…”,
“courseSyllabus”: “<html><body><h1>About the Course</h1><p>Before you get started…”,
“icon”: “http://neo4j.com/wp-content/themes/neo4jweb/assets/images/neo4j-logo-2015.png",
“name”: “Neo4j in Production”,
“instructors”: [
{
“name”: “Bob Loblaw”,
“bio”: “A master of Neo4j deployments, Bob has overseen hundreds of successful…”,
…
}
],
“categories”: [
{
“categoryId”: “c82lid”,
“name”: “DevOps”,
…
}
]
}
http://docs.mongodb.org/ecosystem/use-cases/product-catalog/
24. Neo4j + MongoDB
• Routing
Use case
http://neo4j.com/blog/polyglot-persistence-mongodb-wanderu-case-study/
http://neo4j.com/case-studies/wanderu-across-america/
25. Neo4j + MongoDB
What insights can we draw from connected documents?
• Content recommendation
http://www.lyonwj.com/2015/05/28/content-recommendation-from-links-shared-on-twitter/
Use case
26. Neo4j + MongoDB
• Healthcare analytics
http://neo4j.com/case-studies/zephyr-health/
Use case