Neo4j + MongoDB. Neo4j Doc Manager for Mongo Connector - GraphConnect SF 2015

28
Neo4j + MongoDB GraphConnect SF 2015 Neo4j Doc Manager for Mongo Connector

Transcript of Neo4j + MongoDB. Neo4j Doc Manager for Mongo Connector - GraphConnect SF 2015

Neo4j + MongoDB

GraphConnect SF 2015

Neo4j Doc Manager for Mongo Connector

About

Developer Relations Engineer @[email protected]

@lyonwjlyonwj.com

William Lyon

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.

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.

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.

Course Catalog Use-case

• Product catalog• High volume reads• Indexed queries

Course Catalog Browse & Search

Course Catalog Browse and Search

Course Catalog

Course Catalog

MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc.

Polyglot Persistence

http://www.jamesserra.com/archive/2015/07/what-is-polyglot-persistence/

Functionality Database type

Shopping Cart Rapid session reads / writes

Key-value store

Orders / Product Catalog

Frequent reads Document

Customer social graph

Recommendation Graph

MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc.

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

Neo4j Doc ManagerAutomatically sync documents from MongoDB to Neo4j

MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc.

Neo4j Doc ManagerConverts BSON documents into property graph model

• Documents converted to property graph• Based on structure of the document

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" }}

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" }}

DEMO…

DEMO

MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc.

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/

Examine a specific course

All course categories taken by a student

Recommended courses

Appendix / Resources

Neo4j + MongoDB

• Routing

Use case

http://neo4j.com/blog/polyglot-persistence-mongodb-wanderu-case-study/

http://neo4j.com/case-studies/wanderu-across-america/

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

Neo4j + MongoDB

• Healthcare analytics

http://neo4j.com/case-studies/zephyr-health/

Use case

Neo4j Doc Manager

Docker test environment• Neo4j, MongoDB, neo4j-doc-manager• Docker compose• https://github.com/JoergM/neomongo

Neo4j Doc Manager

Feedback welcome!• Alpha version

https://github.com/neo4j-contrib/neo4j_doc_manager