12. Polyglot Persistence
• Different types of data in different ways
• Take advantage of strengths of different databases
http://martinfowler.com/bliki/PolyglotPersistence.html
13. 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
http://www.jamesserra.com/archive/2015/07/what-is-polyglot-persistence/
24. Tool #1: Neo4j Doc Manager
• Automatically sync documents from MongoDB to Neo4j
• Convert BSON documents into graph model
• Initial version available
• Feedback welcome!
http://neo4j.com/developer/mongodb/
26. Document to property graph
{
"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"
}
}
27. {
"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
43. Neo4j Cassandra Data Import Tool
{p}, node property
{r}, relationship
{u}, unique constraint field
{i}, create index
User defined data model mappings
48. Neo4j 3.0 Stored procedures
User-defined procedures are written in Java,
deployed into the database, and called from Cypher.
http://neo4j.com/docs/java-reference/current/#procedures