10. Graph on(in) GrailsNeo4j is (as of now) the only graph databasethat fits nicely in a Grails application.
11. Data is connected
12. Why Graph DB?Insufficient RDBMS performance in hierarchicalstructures. The graph database storage shineswhen storing richly-connected data. Querying isperformed through traversals, which canperform millions of traversal steps per second. Atraversal step resembles a join in a RDBMS.
13. SQL addonsSome DBs has even special DSL:SELECT empno, ename, job, mgr, hiredate, LEVELFROM empWHERE LEVEL <= 2START WITH mgr IS NULLCONNECT BY PRIOR empno = mgr
14. Where Graph DB• Network Management• Master Data Management• Social• Finance• Spatial – Map Routing• Bio
15. Why Neo4J?• true ACID transactions• high availability• scales to billions of nodes and relationships• high speed querying through traversals• well documented• Java• licenses
16. Why neo4j - details• Disk ready – Native graph storage engine with custom (SSD- ready) binary on-disk format• Transactional – JTA/JTS, XA, 2PC, Tx Recovery, deadlock detection …• Scalable – Billions of nodes on single JVM
17. Access & Implementation Types1. EmbeddedGraphDatabase: just to local JVM2. RestGraphDatabase: rest-binding3. HighAvaibleGraphDatabase: uses Zookeeper
18. When Grails shinesRuby platform isn’t a case, Java is too expensive,Scala is too smart.Startups & prototypesModel-driven architecture where GORM isfundament.
19. Groovy & Grails Architecture Controller View GSP Service Domain Plug-in Gant GORM Site Mesh Spring Hibernate DB Java EE Groovy JVM
22. Plugin features• Neo4j -> Groovy/Java• GORM dynamic finders, criteria and named queries• Session-managed transactions• Bean Validation• Neo4js traversal• Embedded, REST and HA
23. Jump into Neo4J name:staff type:weaponname:SplinterfullName:Hamato Yoshitype: rat type: interact type:knows name:Shredder fullName:Oroku Saki
26. Properties name:staff type:weaponname:SplinterfullName:Hamato Yoshitype: rat type: interact type:knows
27. Mapping Reference Node SubreferenceDomain Class/Type SubreferenceNode Domain Class Instance Instance Domain Class Properties Instance Properties Assocoation
28. Compatibility with GORM ✔ ✗Simple persistence methods HQL queriesDynamic finders Dirty checking methodsCriteria queries Composite primary keysNamed queries Any direct interaction with the Hibernate APIInheritance Custom Hibernate user typesEmbedded typesQuery by exampleMany-to-many associations (these can bemodelled with a mapping class)