SlideShare a Scribd company logo
1 of 27
Download to read offline
Grails and Neo4j

Stefan Armbruster

      gr8conf
CPH, 2011 May 19th
About myself
●
    located in Munich/Germany
●
    freelancer since 10 years
●
    cofounder of Netjay
●
    Java +10 years, Groovy ~5 years, Grails 3+ years
●
    author of some Grails plugins
●
    cofounder of the usergroup in Munich
●
    passionate volunteer firefighter
●
    twitter: darthvader42
●
    http://blog.armbruster-it.de
What's wrong with SQL?

What's about the hype of NoSQL?
4 trends
much larger data sets:
●


    ●
        IDC comparison: 2010 to 2007 is 40 : 1
data gets more connected
●



semi-structured data
●



horizontal scalability – distributed architecture
●
One size fits all?
exploring the nosql-landscape
Key-Value:                                     Bigtable:
➢
    RIAK *                                     ➢
                                                   Hadoop / Hbase *
➢
    Redis *                                    ➢
                                                   SimpleDB
➢
    Membase                                    ➢
                                                   Cassandra **
Document:
Document                                       Graph:
➢
    CouchDB *                                  ➢
                                                   InfiniteGraph
➢
    Mongo *                                    ➢
                                                   Neo4j *

    *: GORM compliant implementation, **: Grails support without GORM
nosql is not the silver bullet
neo4j basic building blocks

                  1) nodes

              2) relationships

3) properties on both, nodes and relationship

                  that's it!
neo4j
querying neo4j
simple way: navigate the relationships
●



more powerful: use a traverser with callbacks for
●


    ●
        decide where to end
    ●
        decide if node should be part of the result
SQL querying vs traversing

SQL challenge: SQL statement that retrieves friends
 up to n'th grade. Anyone?


Neo4j: using a traverser:
  Node node = // retrieve the starting poing

  def myFriendsAndFriends = node.traverse(
     BREADTH_FIRST,
     { it.depth()<3 } as StopEvaluator,
     { true } as RetrunableEvaluator,
     DynamicRelationshipType.withName('friend'),
     Direction.OUTGOING
  ).allNodes
query performance

some benchmark     data:
    – each Person has 50 friends in avg

       Database          # persons        query time
       Relational        1.000            2000 ms
       Neo4j             1.000            2 ms
       Neo4j             1.000.000        2 ms
accessing the database
Choosing an implementation of GraphDatabase:

   ●
       EmbeddedGraphDatabase: just local to JVM

   ●
       RestGraphDatabase (https://github.com/jexp/neo4j-java-rest-binding)

   ●
       HighAvailableGraphDatabase: uses Zookeeper
neo4j - Licensing

3 editions:


community:    GPL or $
advanced:     AGPL or $
enterprise:   AGPL or $
history of nosql & neo4j for Grails
end 2009: first version of neo4j plugin
during 2010: GORM for nosql
     – 'inconsequential' -> 'spring-data-mapping'
end 2010: 'spring-data-graph'
     – aspectj based injection of JPA like methods
     – focussed at Roo an POWAs
     – "not the right approach for Grails" (IMHO)
May 2011: Neo4j for Grails using spring-data-
 mapping
GORM: spring-data-mapping
provides abstraction layer
●



TCK
●



various implementations:
●


      ●
          hibernate, jpa
      ●
          gemfire, redis, riak
      ●
          mongo, jcr
      ●
          neo4j <- the new child on the block
dependencies
interfaces/abstract base classes in GORM
●   Datastore:
        ●   create sessions
        ●   manage connection to low-level storage
●   MappingContext:
        ●   holds metainformation about mapping domain classes to the underlying
             datastore (type conversion, list of EntityPersisters,...)
●   EntityPersister:
        ●   does the dirty work: interact with low level datastore
●   Session:
        ●   similar HibernateSession
●   Query:
        ●   knows how to query the datastore by criteria (criterion, projections,...)
mapping domain model to nodespace

                                                reference node
   domain class
                                 subreference

                                                      subreference node
   domain class           instance
     instance



  domain instance
                    properties
     property



    association
praying to the demo god....
currently working in neo4j plugin
passing >90% of GORM TCK (hurray!)
●



accessing embedded, REST and [HA datasources]
●



property type conversion
●



access to native API
●



<DomainClass>.traverseStatic, <instance>.traverse
●
currently not working in neo4j plugin

nasty bug: some trouble if a domain class
●


 references itself -> StackOverflowException
Transactions
●



Optimistic Locking
●



Query performance not as good as could be
●



Indexing
●
roadmap
●
    Write docs & publish
●
    Handle relationship to self (Neo4j 1.4?)
●
    Support for arbitrary attributes
●
    Support for indexing (and its usage in criteria queries)
●
    Embed some controller/servlet to visually navigate
     the nodespace (SVG?)
●
    Support for migrations?
●
    ... your suggestions?
Q&A
References
general overview of nosql:
     – http://www.nosql-databases.org/
http://www.neo4j.org
neo4j grails plugin:
     – source: https://github.com/sarmbruster/spring-data-mapping
     – issues: http://jira.grails.org/browse/GPNEO4J
https://github.com/jexp/neo4j-java-rest-binding
site running grails w/ neo4j: http://www.fanorakel.de
my blog: http://blog.armbruster-it.de,
twitter: darthvader42

More Related Content

What's hot

Accra MongoDB User Group
Accra MongoDB User GroupAccra MongoDB User Group
Accra MongoDB User Group
MongoDB
 

What's hot (20)

Top 10 frameworks of node js
Top 10 frameworks of node jsTop 10 frameworks of node js
Top 10 frameworks of node js
 
Mongo db transcript
Mongo db transcriptMongo db transcript
Mongo db transcript
 
Node js crash course session 5
Node js crash course   session 5Node js crash course   session 5
Node js crash course session 5
 
Drupal performance and scalability
Drupal performance and scalabilityDrupal performance and scalability
Drupal performance and scalability
 
Pre rendering media sites with nuxt.js & netlify
Pre rendering media sites with nuxt.js & netlifyPre rendering media sites with nuxt.js & netlify
Pre rendering media sites with nuxt.js & netlify
 
Accra MongoDB User Group
Accra MongoDB User GroupAccra MongoDB User Group
Accra MongoDB User Group
 
Hidden gems in Apache Jackrabbit and BloomReach Forge
Hidden gems in Apache Jackrabbit and BloomReach ForgeHidden gems in Apache Jackrabbit and BloomReach Forge
Hidden gems in Apache Jackrabbit and BloomReach Forge
 
MongoDB basics & Introduction
MongoDB basics & IntroductionMongoDB basics & Introduction
MongoDB basics & Introduction
 
Getting started with the Lupus Nuxt.js Drupal Stack
Getting started with the Lupus Nuxt.js Drupal StackGetting started with the Lupus Nuxt.js Drupal Stack
Getting started with the Lupus Nuxt.js Drupal Stack
 
Drupal performance
Drupal performanceDrupal performance
Drupal performance
 
MongoDB
MongoDBMongoDB
MongoDB
 
Decoupling Drupal mit dem Lupus Nuxt.js Drupal Stack
Decoupling Drupal mit dem Lupus Nuxt.js Drupal StackDecoupling Drupal mit dem Lupus Nuxt.js Drupal Stack
Decoupling Drupal mit dem Lupus Nuxt.js Drupal Stack
 
Optimize drupal using mongo db
Optimize drupal using mongo dbOptimize drupal using mongo db
Optimize drupal using mongo db
 
Mojo Facets – so, you have data and browser?
Mojo Facets – so, you have data and browser?Mojo Facets – so, you have data and browser?
Mojo Facets – so, you have data and browser?
 
Mongo db workshop # 02
Mongo db workshop # 02Mongo db workshop # 02
Mongo db workshop # 02
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
 
MongoDB Command Line Tools
MongoDB Command Line ToolsMongoDB Command Line Tools
MongoDB Command Line Tools
 
MongoDB and Node.js
MongoDB and Node.jsMongoDB and Node.js
MongoDB and Node.js
 
Mateusz Gruszczynski - Performance tests in Gatling (Quality Questions Confer...
Mateusz Gruszczynski - Performance tests in Gatling (Quality Questions Confer...Mateusz Gruszczynski - Performance tests in Gatling (Quality Questions Confer...
Mateusz Gruszczynski - Performance tests in Gatling (Quality Questions Confer...
 
A faster web
A faster webA faster web
A faster web
 

Viewers also liked (7)

GR8Conf 2011: Groovy Maven Builds
GR8Conf 2011: Groovy Maven BuildsGR8Conf 2011: Groovy Maven Builds
GR8Conf 2011: Groovy Maven Builds
 
GR8Conf 2009: Opening Keynote by Søren Berg Glasius and Guillaume Laforge
GR8Conf 2009: Opening Keynote by Søren Berg Glasius and Guillaume LaforgeGR8Conf 2009: Opening Keynote by Søren Berg Glasius and Guillaume Laforge
GR8Conf 2009: Opening Keynote by Søren Berg Glasius and Guillaume Laforge
 
Ethan Chazin 2011 Praxis Retreat
Ethan Chazin 2011 Praxis RetreatEthan Chazin 2011 Praxis Retreat
Ethan Chazin 2011 Praxis Retreat
 
GR8Conf 2009: Griffon by Jim Shingler
GR8Conf 2009: Griffon by Jim ShinglerGR8Conf 2009: Griffon by Jim Shingler
GR8Conf 2009: Griffon by Jim Shingler
 
GR8Conf 2011: Groovy 1.8 update
GR8Conf 2011: Groovy 1.8 updateGR8Conf 2011: Groovy 1.8 update
GR8Conf 2011: Groovy 1.8 update
 
GR8Conf 2011: Grails Infinispanplugin, Tom Fuller
GR8Conf 2011: Grails Infinispanplugin, Tom FullerGR8Conf 2011: Grails Infinispanplugin, Tom Fuller
GR8Conf 2011: Grails Infinispanplugin, Tom Fuller
 
GR8Conf 2011: Canoo RIA Suite
GR8Conf 2011: Canoo RIA SuiteGR8Conf 2011: Canoo RIA Suite
GR8Conf 2011: Canoo RIA Suite
 

Similar to GR8Conf 2011: Neo4j Plugin

Neo4 + Grails
Neo4 + GrailsNeo4 + Grails
Neo4 + Grails
stasimus
 
Marcel Kornacker: Impala tech talk Tue Feb 26th 2013
Marcel Kornacker: Impala tech talk Tue Feb 26th 2013Marcel Kornacker: Impala tech talk Tue Feb 26th 2013
Marcel Kornacker: Impala tech talk Tue Feb 26th 2013
Modern Data Stack France
 
Facebook architecture
Facebook architectureFacebook architecture
Facebook architecture
drewz lin
 
Facebook的架构
Facebook的架构Facebook的架构
Facebook的架构
yiditushe
 
Qcon 090408233824-phpapp01
Qcon 090408233824-phpapp01Qcon 090408233824-phpapp01
Qcon 090408233824-phpapp01
jgregory1234
 

Similar to GR8Conf 2011: Neo4j Plugin (20)

Neo4J and Grails
Neo4J and GrailsNeo4J and Grails
Neo4J and Grails
 
Neo4 + Grails
Neo4 + GrailsNeo4 + Grails
Neo4 + Grails
 
A quick review of Python and Graph Databases
A quick review of Python and Graph DatabasesA quick review of Python and Graph Databases
A quick review of Python and Graph Databases
 
Marcel Kornacker: Impala tech talk Tue Feb 26th 2013
Marcel Kornacker: Impala tech talk Tue Feb 26th 2013Marcel Kornacker: Impala tech talk Tue Feb 26th 2013
Marcel Kornacker: Impala tech talk Tue Feb 26th 2013
 
Cloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera Impala: A Modern SQL Engine for Apache HadoopCloudera Impala: A Modern SQL Engine for Apache Hadoop
Cloudera Impala: A Modern SQL Engine for Apache Hadoop
 
Cloudera Impala presentation
Cloudera Impala presentationCloudera Impala presentation
Cloudera Impala presentation
 
HPTS 2011: The NoSQL Ecosystem
HPTS 2011: The NoSQL EcosystemHPTS 2011: The NoSQL Ecosystem
HPTS 2011: The NoSQL Ecosystem
 
The NoSQL Ecosystem
The NoSQL Ecosystem The NoSQL Ecosystem
The NoSQL Ecosystem
 
2014 hadoop wrocław jug
2014 hadoop   wrocław jug2014 hadoop   wrocław jug
2014 hadoop wrocław jug
 
Cassandra Talk: Austin JUG
Cassandra Talk: Austin JUGCassandra Talk: Austin JUG
Cassandra Talk: Austin JUG
 
On Rails with Apache Cassandra
On Rails with Apache CassandraOn Rails with Apache Cassandra
On Rails with Apache Cassandra
 
New paradigms
New paradigmsNew paradigms
New paradigms
 
Facebook architecture
Facebook architectureFacebook architecture
Facebook architecture
 
Facebook的架构
Facebook的架构Facebook的架构
Facebook的架构
 
Facebook architecture
Facebook architectureFacebook architecture
Facebook architecture
 
Qcon 090408233824-phpapp01
Qcon 090408233824-phpapp01Qcon 090408233824-phpapp01
Qcon 090408233824-phpapp01
 
Getting started with Graph Databases & Neo4j
Getting started with Graph Databases & Neo4jGetting started with Graph Databases & Neo4j
Getting started with Graph Databases & Neo4j
 
MongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL DatabaseMongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL Database
 
Introduction to Hadoop Administration
Introduction to Hadoop AdministrationIntroduction to Hadoop Administration
Introduction to Hadoop Administration
 
Introduction to Hadoop Administration
Introduction to Hadoop AdministrationIntroduction to Hadoop Administration
Introduction to Hadoop Administration
 

More from GR8Conf

More from GR8Conf (20)

DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
 
Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle
 
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerMum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developer
 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with Groovy
 
Scraping with Geb
Scraping with GebScraping with Geb
Scraping with Geb
 
How to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidHow to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and Android
 
Ratpack On the Docks
Ratpack On the DocksRatpack On the Docks
Ratpack On the Docks
 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean Code
 
Cut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsCut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature plugins
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applications
 
Ratpack and Grails 3
 Ratpack and Grails 3 Ratpack and Grails 3
Ratpack and Grails 3
 
Grails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGrails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloud
 
Functional testing your Grails app with GEB
Functional testing your Grails app with GEBFunctional testing your Grails app with GEB
Functional testing your Grails app with GEB
 
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCDeploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPC
 
The Grails introduction workshop
The Grails introduction workshopThe Grails introduction workshop
The Grails introduction workshop
 
Idiomatic spock
Idiomatic spockIdiomatic spock
Idiomatic spock
 
The Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedThe Groovy Ecosystem Revisited
The Groovy Ecosystem Revisited
 
Groovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGroovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examples
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and Groovy
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual Machine
 

Recently uploaded

Recently uploaded (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

GR8Conf 2011: Neo4j Plugin

  • 1. Grails and Neo4j Stefan Armbruster gr8conf CPH, 2011 May 19th
  • 2. About myself ● located in Munich/Germany ● freelancer since 10 years ● cofounder of Netjay ● Java +10 years, Groovy ~5 years, Grails 3+ years ● author of some Grails plugins ● cofounder of the usergroup in Munich ● passionate volunteer firefighter ● twitter: darthvader42 ● http://blog.armbruster-it.de
  • 3. What's wrong with SQL? What's about the hype of NoSQL?
  • 4.
  • 5.
  • 6. 4 trends much larger data sets: ● ● IDC comparison: 2010 to 2007 is 40 : 1 data gets more connected ● semi-structured data ● horizontal scalability – distributed architecture ●
  • 8. exploring the nosql-landscape Key-Value: Bigtable: ➢ RIAK * ➢ Hadoop / Hbase * ➢ Redis * ➢ SimpleDB ➢ Membase ➢ Cassandra ** Document: Document Graph: ➢ CouchDB * ➢ InfiniteGraph ➢ Mongo * ➢ Neo4j * *: GORM compliant implementation, **: Grails support without GORM
  • 9. nosql is not the silver bullet
  • 10. neo4j basic building blocks 1) nodes 2) relationships 3) properties on both, nodes and relationship that's it!
  • 11. neo4j
  • 12. querying neo4j simple way: navigate the relationships ● more powerful: use a traverser with callbacks for ● ● decide where to end ● decide if node should be part of the result
  • 13. SQL querying vs traversing SQL challenge: SQL statement that retrieves friends up to n'th grade. Anyone? Neo4j: using a traverser: Node node = // retrieve the starting poing def myFriendsAndFriends = node.traverse( BREADTH_FIRST, { it.depth()<3 } as StopEvaluator, { true } as RetrunableEvaluator, DynamicRelationshipType.withName('friend'), Direction.OUTGOING ).allNodes
  • 14. query performance some benchmark data: – each Person has 50 friends in avg Database # persons query time Relational 1.000 2000 ms Neo4j 1.000 2 ms Neo4j 1.000.000 2 ms
  • 15. accessing the database Choosing an implementation of GraphDatabase: ● EmbeddedGraphDatabase: just local to JVM ● RestGraphDatabase (https://github.com/jexp/neo4j-java-rest-binding) ● HighAvailableGraphDatabase: uses Zookeeper
  • 16. neo4j - Licensing 3 editions: community: GPL or $ advanced: AGPL or $ enterprise: AGPL or $
  • 17. history of nosql & neo4j for Grails end 2009: first version of neo4j plugin during 2010: GORM for nosql – 'inconsequential' -> 'spring-data-mapping' end 2010: 'spring-data-graph' – aspectj based injection of JPA like methods – focussed at Roo an POWAs – "not the right approach for Grails" (IMHO) May 2011: Neo4j for Grails using spring-data- mapping
  • 18. GORM: spring-data-mapping provides abstraction layer ● TCK ● various implementations: ● ● hibernate, jpa ● gemfire, redis, riak ● mongo, jcr ● neo4j <- the new child on the block
  • 20. interfaces/abstract base classes in GORM ● Datastore: ● create sessions ● manage connection to low-level storage ● MappingContext: ● holds metainformation about mapping domain classes to the underlying datastore (type conversion, list of EntityPersisters,...) ● EntityPersister: ● does the dirty work: interact with low level datastore ● Session: ● similar HibernateSession ● Query: ● knows how to query the datastore by criteria (criterion, projections,...)
  • 21. mapping domain model to nodespace reference node domain class subreference subreference node domain class instance instance domain instance properties property association
  • 22. praying to the demo god....
  • 23. currently working in neo4j plugin passing >90% of GORM TCK (hurray!) ● accessing embedded, REST and [HA datasources] ● property type conversion ● access to native API ● <DomainClass>.traverseStatic, <instance>.traverse ●
  • 24. currently not working in neo4j plugin nasty bug: some trouble if a domain class ● references itself -> StackOverflowException Transactions ● Optimistic Locking ● Query performance not as good as could be ● Indexing ●
  • 25. roadmap ● Write docs & publish ● Handle relationship to self (Neo4j 1.4?) ● Support for arbitrary attributes ● Support for indexing (and its usage in criteria queries) ● Embed some controller/servlet to visually navigate the nodespace (SVG?) ● Support for migrations? ● ... your suggestions?
  • 26. Q&A
  • 27. References general overview of nosql: – http://www.nosql-databases.org/ http://www.neo4j.org neo4j grails plugin: – source: https://github.com/sarmbruster/spring-data-mapping – issues: http://jira.grails.org/browse/GPNEO4J https://github.com/jexp/neo4j-java-rest-binding site running grails w/ neo4j: http://www.fanorakel.de my blog: http://blog.armbruster-it.de, twitter: darthvader42