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

A super fast introduction to Spark and glance at BEAM
A super fast introduction to Spark and glance at BEAMA super fast introduction to Spark and glance at BEAM
A super fast introduction to Spark and glance at BEAMHolden Karau
 
(SDD407) Amazon DynamoDB: Data Modeling and Scaling Best Practices | AWS re:I...
(SDD407) Amazon DynamoDB: Data Modeling and Scaling Best Practices | AWS re:I...(SDD407) Amazon DynamoDB: Data Modeling and Scaling Best Practices | AWS re:I...
(SDD407) Amazon DynamoDB: Data Modeling and Scaling Best Practices | AWS re:I...Amazon Web Services
 
Works with persistent graphs using OrientDB
Works with persistent graphs using OrientDB Works with persistent graphs using OrientDB
Works with persistent graphs using OrientDB graphdevroom
 
Big Data Processing using Apache Spark and Clojure
Big Data Processing using Apache Spark and ClojureBig Data Processing using Apache Spark and Clojure
Big Data Processing using Apache Spark and ClojureDr. Christian Betz
 
Cypher and apache spark multiple graphs and more in open cypher
Cypher and apache spark  multiple graphs and more in  open cypherCypher and apache spark  multiple graphs and more in  open cypher
Cypher and apache spark multiple graphs and more in open cypherNeo4j
 
Code for Startup MVP (Ruby on Rails) Session 2
Code for Startup MVP (Ruby on Rails) Session 2Code for Startup MVP (Ruby on Rails) Session 2
Code for Startup MVP (Ruby on Rails) Session 2Henry S
 
Real-Time Analytics with Solr: Presented by Yonik Seeley, Cloudera
Real-Time Analytics with Solr: Presented by Yonik Seeley, ClouderaReal-Time Analytics with Solr: Presented by Yonik Seeley, Cloudera
Real-Time Analytics with Solr: Presented by Yonik Seeley, ClouderaLucidworks
 
[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探
[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探
[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探台灣資料科學年會
 
Php data structures – beyond spl (online version)
Php data structures – beyond spl (online version)Php data structures – beyond spl (online version)
Php data structures – beyond spl (online version)Mark Baker
 
Data science at the command line
Data science at the command lineData science at the command line
Data science at the command lineSharat Chikkerur
 
RubyKaigi2015 making robots-with-mruby
RubyKaigi2015 making robots-with-mrubyRubyKaigi2015 making robots-with-mruby
RubyKaigi2015 making robots-with-mrubyyamanekko
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know Norberto Leite
 
JavaScript in 2016 (Codemotion Rome)
JavaScript in 2016 (Codemotion Rome)JavaScript in 2016 (Codemotion Rome)
JavaScript in 2016 (Codemotion Rome)Eduard Tomàs
 
GR8Conf 2009: Practical Groovy DSL by Guillaume Laforge
GR8Conf 2009: Practical Groovy DSL by Guillaume LaforgeGR8Conf 2009: Practical Groovy DSL by Guillaume Laforge
GR8Conf 2009: Practical Groovy DSL by Guillaume LaforgeGR8Conf
 
An introduction to scala
An introduction to scalaAn introduction to scala
An introduction to scalaXing
 

What's hot (19)

A super fast introduction to Spark and glance at BEAM
A super fast introduction to Spark and glance at BEAMA super fast introduction to Spark and glance at BEAM
A super fast introduction to Spark and glance at BEAM
 
(SDD407) Amazon DynamoDB: Data Modeling and Scaling Best Practices | AWS re:I...
(SDD407) Amazon DynamoDB: Data Modeling and Scaling Best Practices | AWS re:I...(SDD407) Amazon DynamoDB: Data Modeling and Scaling Best Practices | AWS re:I...
(SDD407) Amazon DynamoDB: Data Modeling and Scaling Best Practices | AWS re:I...
 
Works with persistent graphs using OrientDB
Works with persistent graphs using OrientDB Works with persistent graphs using OrientDB
Works with persistent graphs using OrientDB
 
Big Data Processing using Apache Spark and Clojure
Big Data Processing using Apache Spark and ClojureBig Data Processing using Apache Spark and Clojure
Big Data Processing using Apache Spark and Clojure
 
Cypher and apache spark multiple graphs and more in open cypher
Cypher and apache spark  multiple graphs and more in  open cypherCypher and apache spark  multiple graphs and more in  open cypher
Cypher and apache spark multiple graphs and more in open cypher
 
Code for Startup MVP (Ruby on Rails) Session 2
Code for Startup MVP (Ruby on Rails) Session 2Code for Startup MVP (Ruby on Rails) Session 2
Code for Startup MVP (Ruby on Rails) Session 2
 
Full Text Search In PostgreSQL
Full Text Search In PostgreSQLFull Text Search In PostgreSQL
Full Text Search In PostgreSQL
 
Real-Time Analytics with Solr: Presented by Yonik Seeley, Cloudera
Real-Time Analytics with Solr: Presented by Yonik Seeley, ClouderaReal-Time Analytics with Solr: Presented by Yonik Seeley, Cloudera
Real-Time Analytics with Solr: Presented by Yonik Seeley, Cloudera
 
[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探
[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探
[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探
 
Php data structures – beyond spl (online version)
Php data structures – beyond spl (online version)Php data structures – beyond spl (online version)
Php data structures – beyond spl (online version)
 
Theads services
Theads servicesTheads services
Theads services
 
Slickdemo
SlickdemoSlickdemo
Slickdemo
 
Data science at the command line
Data science at the command lineData science at the command line
Data science at the command line
 
MongoDB 3.0
MongoDB 3.0 MongoDB 3.0
MongoDB 3.0
 
RubyKaigi2015 making robots-with-mruby
RubyKaigi2015 making robots-with-mrubyRubyKaigi2015 making robots-with-mruby
RubyKaigi2015 making robots-with-mruby
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know
 
JavaScript in 2016 (Codemotion Rome)
JavaScript in 2016 (Codemotion Rome)JavaScript in 2016 (Codemotion Rome)
JavaScript in 2016 (Codemotion Rome)
 
GR8Conf 2009: Practical Groovy DSL by Guillaume Laforge
GR8Conf 2009: Practical Groovy DSL by Guillaume LaforgeGR8Conf 2009: Practical Groovy DSL by Guillaume Laforge
GR8Conf 2009: Practical Groovy DSL by Guillaume Laforge
 
An introduction to scala
An introduction to scalaAn introduction to scala
An introduction to scala
 

Similar to Grails and Neo4j

Neo4 + Grails
Neo4 + GrailsNeo4 + Grails
Neo4 + Grailsstasimus
 
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 DatabasesNicholas Crouch
 
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 2013Modern Data Stack France
 
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 HadoopCloudera, Inc.
 
Cloudera Impala presentation
Cloudera Impala presentationCloudera Impala presentation
Cloudera Impala presentationmarkgrover
 
HPTS 2011: The NoSQL Ecosystem
HPTS 2011: The NoSQL EcosystemHPTS 2011: The NoSQL Ecosystem
HPTS 2011: The NoSQL EcosystemAdam Marcus
 
The NoSQL Ecosystem
The NoSQL Ecosystem The NoSQL Ecosystem
The NoSQL Ecosystem yarapavan
 
Cassandra Talk: Austin JUG
Cassandra Talk: Austin JUGCassandra Talk: Austin JUG
Cassandra Talk: Austin JUGStu Hood
 
On Rails with Apache Cassandra
On Rails with Apache CassandraOn Rails with Apache Cassandra
On Rails with Apache CassandraStu Hood
 
Facebook architecture
Facebook architectureFacebook architecture
Facebook architecturedrewz lin
 
Facebook architecture
Facebook architectureFacebook architecture
Facebook architecturemysqlops
 
Qcon 090408233824-phpapp01
Qcon 090408233824-phpapp01Qcon 090408233824-phpapp01
Qcon 090408233824-phpapp01jgregory1234
 
Facebook的架构
Facebook的架构Facebook的架构
Facebook的架构yiditushe
 
Getting started with Graph Databases & Neo4j
Getting started with Graph Databases & Neo4jGetting started with Graph Databases & Neo4j
Getting started with Graph Databases & Neo4jSuroor Wijdan
 
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 DatabaseFITC
 

Similar to Grails and Neo4j (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 architecture
Facebook architectureFacebook architecture
Facebook architecture
 
Qcon 090408233824-phpapp01
Qcon 090408233824-phpapp01Qcon 090408233824-phpapp01
Qcon 090408233824-phpapp01
 
Facebook的架构
Facebook的架构Facebook的架构
Facebook的架构
 
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
 

Recently uploaded

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Recently uploaded (20)

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

Grails and Neo4j

  • 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