SlideShare uma empresa Scribd logo
1 de 37
Rapid development with Neo4J
         under Grails
About Myself
•   Located in Riga/Latvia
•   Technical Architect in Accenture
•   Experience since 10 years
•   C#/Java/Groovy/Scala/Erlang
no:sql
Market has significantly different challenges in
dealing with data that the traditional RDBMS
solutions could not cope with.
Issues
•   size data sets
•   data relations are connected
•   distributed processing
•   Data Model -> semi-structured approach
brings to diversity of solutions


                       Data Model




        Distribution                Disk Data
           Model                    Structure
types

 Document store
        Graph
  Key-value store
Multivalue databases
 Object database
       Tabular
     Tuple store
hard to integrate in industrialized
            companies
Grails Support
Name               Type
RIAK               Eventually‐consistent key‐value   +
REDIS              Key-value cache in RAM            +
MemcacheDB         Ordered key-value stores          +-
Apache CouchDB     Document store                    +
MongoDB            Document store                    +
Apache Hadoop      Tabular/Big Table                 +
Apache Cassandra   Eventually‐consistent key‐value   +
Neo4J              Graph                             +
Graph DB implemetations
                      Language
DEX                   C++
FlockDB               Scala
InfiniteGraph         Java
HyperGraphDB          Java
Neo4J                 Java
OpenLink Virtuoso     C++, C#, Java, SPARQL
OrientDB              Java
Sones GraphDB         C#
Graph on(in) Grails
Neo4j is (as of now) the only graph database
that fits nicely in a Grails application.
Data is connected
Why Graph DB?
Insufficient RDBMS performance in hierarchical
structures. The graph database storage shines
when storing richly-connected data. Querying is
performed through traversals, which can
perform millions of traversal steps per second. A
traversal step resembles a join in a RDBMS.
SQL addons
Some DBs has even special DSL:
SELECT empno,
   ename,
   job,
   mgr,
   hiredate,
   LEVEL
FROM emp
WHERE LEVEL <= 2
START WITH mgr IS NULL
CONNECT BY PRIOR empno = mgr
Where Graph DB
•   Network Management
•   Master Data Management
•   Social
•   Finance
•   Spatial
    – Map Routing
• Bio
Why Neo4J?
•   true ACID transactions
•   high availability
•   scales to billions of nodes and relationships
•   high speed querying through traversals
•   well documented
•   Java
•   licenses
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
Access & Implementation Types

1. EmbeddedGraphDatabase: just to local JVM
2. RestGraphDatabase: rest-binding
3. HighAvaibleGraphDatabase: uses Zookeeper
When Grails shines
Ruby platform isn’t a case, Java is too expensive,
Scala is too smart.

Startups & prototypes

Model-driven architecture where GORM is
fundament.
Groovy & Grails Architecture
                   Controller

   View GSP        Service        Domain

                    Plug-in




                                              Gant
                                   GORM

   Site Mesh        Spring        Hibernate

                                     DB

         Java EE                Groovy

                     JVM
GORM
Abstraction on abstractions, wraps:
  – Hibernate
  – JPA
  – Gemfire, Redis, Riak
  – MongoDB, JCR
  – Neo4J
Integration testing via TCK
Neo4j plug-in
Plugin features
• Neo4j -> Groovy/Java
• GORM dynamic finders, criteria and named
  queries
• Session-managed transactions
• Bean Validation
• Neo4j's traversal
• Embedded, REST and HA
Jump into Neo4J
                                     name:staff
                                     type:weapon
name:Splinter
fullName:Hamato Yoshi
type: rat


                                       type: interact




                        type:knows

                                     name:Shredder
                                     fullName:Oroku Saki
Nodes
Relationships
Properties
                                              name:staff
                                              type:weapon
name:Splinter
fullName:Hamato Yoshi
type: rat


                                                type: interact




                        type:knows
Mapping
                      Reference Node

                                  Subreference
Domain Class/Type
                                                 SubreferenceNode

  Domain Class        Instance
    Instance
  Domain Class
   Properties


                      Instance
                     Properties

   Assocoation
Compatibility with GORM
                     ✔                                          ✗
Simple persistence methods                HQL queries
Dynamic finders                           Dirty checking methods
Criteria queries                          Composite primary keys
Named queries                             Any direct interaction with the Hibernate API
Inheritance                               Custom Hibernate user types
Embedded types
Query by example
Many-to-many associations (these can be
modelled with a mapping class)
Getting Started


grails install-plugin neo4j
grails uninstall-plugin hibernate
Create Domain


grails create-domain-class Hero
Examples

hero.save()

Hero.findByWeightGreaterThan( 100 )
Hero.findAllByFullNameNotNull()

hero.weapons.each {
   …
}
Combining Neo4j And Hibernate

static mapWith = "neo4j”


def hibernateHero = Hero.get(1)
hibernateHero.neo4j.save()
def neo4jHero = Person.neo4j.get(1)
Advanced Configuration
grails-app/conf/DataSource.groovy

       grails {
         neo4j {
            type = "embedded"
            location = "/var/neo4j"
            params = []
         }
       }
Via REST
type = "rest”

grails {
  neo4j {
     type = "rest"
     location = "http://localhost:7474/db/data/"
  }
}
High Availabile
type = "ha”

grails {
  neo4j {
     type = "ha"
     location = "/var/neo4j"
     params = [ // see http://docs.neo4j.org/chunked/stable/ha-configuration.html
         'ha.server_id': 1,
         'ha.coordinators': 'localhost:2181,localhost:2182,localhost:2183'
     ]
  }
}
References
no:sql
   http://nosql-database.org/
neo4j
   http://neo4j.org
grails-neo4j plug-in
  http://jira.grails.org/browse/GPNEO4J
  http://springsource.github.com/grails-data-
  mapping/neo4j/manual/guide/index.html
Questions




Q are guaranteed in life – answers aren’t.

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Spring Framework 5.0による Reactive Web Application #JavaDayTokyo
Spring Framework 5.0による Reactive Web Application #JavaDayTokyoSpring Framework 5.0による Reactive Web Application #JavaDayTokyo
Spring Framework 5.0による Reactive Web Application #JavaDayTokyo
 
Spring Framework 5: History and Reactive features
Spring Framework 5: History and Reactive featuresSpring Framework 5: History and Reactive features
Spring Framework 5: History and Reactive features
 
Mastering Grails 3 Plugins - GR8Conf US 2016
Mastering Grails 3 Plugins - GR8Conf US 2016Mastering Grails 3 Plugins - GR8Conf US 2016
Mastering Grails 3 Plugins - GR8Conf US 2016
 
Creating applications with Grails, Angular JS and Spring Security - GR8Conf U...
Creating applications with Grails, Angular JS and Spring Security - GR8Conf U...Creating applications with Grails, Angular JS and Spring Security - GR8Conf U...
Creating applications with Grails, Angular JS and Spring Security - GR8Conf U...
 
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
 
Adopt openjdk and how it impacts you in 2020
Adopt openjdk and how it impacts you in 2020Adopt openjdk and how it impacts you in 2020
Adopt openjdk and how it impacts you in 2020
 
Creating applications with Grails, Angular JS and Spring Security - GR8Conf E...
Creating applications with Grails, Angular JS and Spring Security - GR8Conf E...Creating applications with Grails, Angular JS and Spring Security - GR8Conf E...
Creating applications with Grails, Angular JS and Spring Security - GR8Conf E...
 
Filter your tweets using Azure Logic Apps & Content Moderation
Filter your tweets using Azure Logic Apps & Content ModerationFilter your tweets using Azure Logic Apps & Content Moderation
Filter your tweets using Azure Logic Apps & Content Moderation
 
Azure DevOps for the Data Professional
Azure DevOps for the Data ProfessionalAzure DevOps for the Data Professional
Azure DevOps for the Data Professional
 
Javantura v4 - Support SpringBoot application development lifecycle using Ora...
Javantura v4 - Support SpringBoot application development lifecycle using Ora...Javantura v4 - Support SpringBoot application development lifecycle using Ora...
Javantura v4 - Support SpringBoot application development lifecycle using Ora...
 
Overview of modern software ecosystem for big data analysis
Overview of modern software ecosystem for big data analysisOverview of modern software ecosystem for big data analysis
Overview of modern software ecosystem for big data analysis
 
Matheus Marsiglio - Isomorphic React + Redux App
Matheus Marsiglio - Isomorphic React + Redux AppMatheus Marsiglio - Isomorphic React + Redux App
Matheus Marsiglio - Isomorphic React + Redux App
 
ASP.NET Core
ASP.NET CoreASP.NET Core
ASP.NET Core
 
GraphQL Bangkok Meetup 6.0
GraphQL Bangkok Meetup 6.0GraphQL Bangkok Meetup 6.0
GraphQL Bangkok Meetup 6.0
 
Creating applications with Grails, Angular JS and Spring Security - G3 Summit...
Creating applications with Grails, Angular JS and Spring Security - G3 Summit...Creating applications with Grails, Angular JS and Spring Security - G3 Summit...
Creating applications with Grails, Angular JS and Spring Security - G3 Summit...
 
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
 
Mastering Grails 3 Plugins - GR8Conf EU 2016
Mastering Grails 3 Plugins - GR8Conf EU 2016Mastering Grails 3 Plugins - GR8Conf EU 2016
Mastering Grails 3 Plugins - GR8Conf EU 2016
 
REST API に疲れたあなたへ贈る GraphQL 入門
REST API に疲れたあなたへ贈る GraphQL 入門REST API に疲れたあなたへ贈る GraphQL 入門
REST API に疲れたあなたへ贈る GraphQL 入門
 
NoSQL on the move
NoSQL on the moveNoSQL on the move
NoSQL on the move
 
System design and architecture GgraphQL Public
System design and architecture GgraphQL PublicSystem design and architecture GgraphQL Public
System design and architecture GgraphQL Public
 

Destaque

Introduction into JavaFX
Introduction into JavaFXIntroduction into JavaFX
Introduction into JavaFX
Eugene Bogaart
 

Destaque (9)

JavaFx
JavaFxJavaFx
JavaFx
 
Introduction into JavaFX
Introduction into JavaFXIntroduction into JavaFX
Introduction into JavaFX
 
Getting your Grails on
Getting your Grails onGetting your Grails on
Getting your Grails on
 
Play framework
Play frameworkPlay framework
Play framework
 
Effective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjectsEffective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjects
 
JavaFX Uni Parthenope
JavaFX Uni ParthenopeJavaFX Uni Parthenope
JavaFX Uni Parthenope
 
Message Driven Architecture in Grails
Message Driven Architecture in GrailsMessage Driven Architecture in Grails
Message Driven Architecture in Grails
 
OpenJFX on Android and Devices
OpenJFX on Android and DevicesOpenJFX on Android and Devices
OpenJFX on Android and Devices
 
Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7
 

Semelhante a Neo4J and Grails

GR8Conf 2011: Neo4j Plugin
GR8Conf 2011: Neo4j PluginGR8Conf 2011: Neo4j Plugin
GR8Conf 2011: Neo4j Plugin
GR8Conf
 
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
 
Hadoop Summit - Hausenblas 20 March
Hadoop Summit - Hausenblas 20 MarchHadoop Summit - Hausenblas 20 March
Hadoop Summit - Hausenblas 20 March
MapR Technologies
 
Understanding the Value and Architecture of Apache Drill
Understanding the Value and Architecture of Apache DrillUnderstanding the Value and Architecture of Apache Drill
Understanding the Value and Architecture of Apache Drill
DataWorks Summit
 

Semelhante a Neo4J and Grails (20)

GR8Conf 2011: Neo4j Plugin
GR8Conf 2011: Neo4j PluginGR8Conf 2011: Neo4j Plugin
GR8Conf 2011: Neo4j Plugin
 
Grails and Neo4j
Grails and Neo4jGrails and Neo4j
Grails and Neo4j
 
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
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 
High-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and JavaHigh-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and Java
 
Java and Mongo
Java and MongoJava and Mongo
Java and Mongo
 
Groovy and Grails
Groovy and GrailsGroovy and Grails
Groovy and Grails
 
Mongodb lab
Mongodb labMongodb lab
Mongodb lab
 
Grails 101
Grails 101Grails 101
Grails 101
 
Taming NoSQL with Spring Data
Taming NoSQL with Spring DataTaming NoSQL with Spring Data
Taming NoSQL with Spring Data
 
Groovy - Grails as a modern scripting language for Web applications
Groovy - Grails as a modern scripting language for Web applicationsGroovy - Grails as a modern scripting language for Web applications
Groovy - Grails as a modern scripting language for Web applications
 
Hadoop Summit - Hausenblas 20 March
Hadoop Summit - Hausenblas 20 MarchHadoop Summit - Hausenblas 20 March
Hadoop Summit - Hausenblas 20 March
 
Understanding the Value and Architecture of Apache Drill
Understanding the Value and Architecture of Apache DrillUnderstanding the Value and Architecture of Apache Drill
Understanding the Value and Architecture of Apache Drill
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_data
 
No SQL : Which way to go? Presented at DDDMelbourne 2015
No SQL : Which way to go?  Presented at DDDMelbourne 2015No SQL : Which way to go?  Presented at DDDMelbourne 2015
No SQL : Which way to go? Presented at DDDMelbourne 2015
 
NoSQL, which way to go?
NoSQL, which way to go?NoSQL, which way to go?
NoSQL, which way to go?
 
PhillyDB Talk - Beyond Batch
PhillyDB Talk - Beyond BatchPhillyDB Talk - Beyond Batch
PhillyDB Talk - Beyond Batch
 

Mais de Dmitry Buzdin

Developing Useful APIs
Developing Useful APIsDeveloping Useful APIs
Developing Useful APIs
Dmitry Buzdin
 
Архитектура Ленты на Одноклассниках
Архитектура Ленты на ОдноклассникахАрхитектура Ленты на Одноклассниках
Архитектура Ленты на Одноклассниках
Dmitry Buzdin
 
Riding Redis @ask.fm
Riding Redis @ask.fmRiding Redis @ask.fm
Riding Redis @ask.fm
Dmitry Buzdin
 
Rubylight JUG Contest Results Part II
Rubylight JUG Contest Results Part IIRubylight JUG Contest Results Part II
Rubylight JUG Contest Results Part II
Dmitry Buzdin
 
Rubylight Pattern-Matching Solutions
Rubylight Pattern-Matching SolutionsRubylight Pattern-Matching Solutions
Rubylight Pattern-Matching Solutions
Dmitry Buzdin
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
Dmitry Buzdin
 
Poor Man's Functional Programming
Poor Man's Functional ProgrammingPoor Man's Functional Programming
Poor Man's Functional Programming
Dmitry Buzdin
 
Rubylight programming contest
Rubylight programming contestRubylight programming contest
Rubylight programming contest
Dmitry Buzdin
 
Continuous Delivery
Continuous Delivery Continuous Delivery
Continuous Delivery
Dmitry Buzdin
 
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
Dmitry Buzdin
 
Thread Dump Analysis
Thread Dump AnalysisThread Dump Analysis
Thread Dump Analysis
Dmitry Buzdin
 

Mais de Dmitry Buzdin (20)

How Payment Cards Really Work?
How Payment Cards Really Work?How Payment Cards Really Work?
How Payment Cards Really Work?
 
Как построить свой фреймворк для автотестов?
Как построить свой фреймворк для автотестов?Как построить свой фреймворк для автотестов?
Как построить свой фреймворк для автотестов?
 
How to grow your own Microservice?
How to grow your own Microservice?How to grow your own Microservice?
How to grow your own Microservice?
 
How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?
 
Delivery Pipeline for Windows Machines
Delivery Pipeline for Windows MachinesDelivery Pipeline for Windows Machines
Delivery Pipeline for Windows Machines
 
Big Data Processing Using Hadoop Infrastructure
Big Data Processing Using Hadoop InfrastructureBig Data Processing Using Hadoop Infrastructure
Big Data Processing Using Hadoop Infrastructure
 
JOOQ and Flyway
JOOQ and FlywayJOOQ and Flyway
JOOQ and Flyway
 
Developing Useful APIs
Developing Useful APIsDeveloping Useful APIs
Developing Useful APIs
 
Whats New in Java 8
Whats New in Java 8Whats New in Java 8
Whats New in Java 8
 
Архитектура Ленты на Одноклассниках
Архитектура Ленты на ОдноклассникахАрхитектура Ленты на Одноклассниках
Архитектура Ленты на Одноклассниках
 
Dart Workshop
Dart WorkshopDart Workshop
Dart Workshop
 
Riding Redis @ask.fm
Riding Redis @ask.fmRiding Redis @ask.fm
Riding Redis @ask.fm
 
Rubylight JUG Contest Results Part II
Rubylight JUG Contest Results Part IIRubylight JUG Contest Results Part II
Rubylight JUG Contest Results Part II
 
Rubylight Pattern-Matching Solutions
Rubylight Pattern-Matching SolutionsRubylight Pattern-Matching Solutions
Rubylight Pattern-Matching Solutions
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
Poor Man's Functional Programming
Poor Man's Functional ProgrammingPoor Man's Functional Programming
Poor Man's Functional Programming
 
Rubylight programming contest
Rubylight programming contestRubylight programming contest
Rubylight programming contest
 
Continuous Delivery
Continuous Delivery Continuous Delivery
Continuous Delivery
 
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
 
Thread Dump Analysis
Thread Dump AnalysisThread Dump Analysis
Thread Dump Analysis
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
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
 

Neo4J and Grails

  • 1. Rapid development with Neo4J under Grails
  • 2. About Myself • Located in Riga/Latvia • Technical Architect in Accenture • Experience since 10 years • C#/Java/Groovy/Scala/Erlang
  • 3. no:sql Market has significantly different challenges in dealing with data that the traditional RDBMS solutions could not cope with.
  • 4. Issues • size data sets • data relations are connected • distributed processing • Data Model -> semi-structured approach
  • 5. brings to diversity of solutions Data Model Distribution Disk Data Model Structure
  • 6. types Document store Graph Key-value store Multivalue databases Object database Tabular Tuple store
  • 7. hard to integrate in industrialized companies
  • 8. Grails Support Name Type RIAK Eventually‐consistent key‐value + REDIS Key-value cache in RAM + MemcacheDB Ordered key-value stores +- Apache CouchDB Document store + MongoDB Document store + Apache Hadoop Tabular/Big Table + Apache Cassandra Eventually‐consistent key‐value + Neo4J Graph +
  • 9. Graph DB implemetations Language DEX C++ FlockDB Scala InfiniteGraph Java HyperGraphDB Java Neo4J Java OpenLink Virtuoso C++, C#, Java, SPARQL OrientDB Java Sones GraphDB C#
  • 10. Graph on(in) Grails Neo4j is (as of now) the only graph database that fits nicely in a Grails application.
  • 12. Why Graph DB? Insufficient RDBMS performance in hierarchical structures. The graph database storage shines when storing richly-connected data. Querying is performed through traversals, which can perform millions of traversal steps per second. A traversal step resembles a join in a RDBMS.
  • 13. SQL addons Some DBs has even special DSL: SELECT empno, ename, job, mgr, hiredate, LEVEL FROM emp WHERE LEVEL <= 2 START WITH mgr IS NULL CONNECT 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 Types 1. EmbeddedGraphDatabase: just to local JVM 2. RestGraphDatabase: rest-binding 3. HighAvaibleGraphDatabase: uses Zookeeper
  • 18. When Grails shines Ruby platform isn’t a case, Java is too expensive, Scala is too smart. Startups & prototypes Model-driven architecture where GORM is fundament.
  • 19. Groovy & Grails Architecture Controller View GSP Service Domain Plug-in Gant GORM Site Mesh Spring Hibernate DB Java EE Groovy JVM
  • 20. GORM Abstraction on abstractions, wraps: – Hibernate – JPA – Gemfire, Redis, Riak – MongoDB, JCR – Neo4J Integration testing via TCK
  • 22. Plugin features • Neo4j -> Groovy/Java • GORM dynamic finders, criteria and named queries • Session-managed transactions • Bean Validation • Neo4j's traversal • Embedded, REST and HA
  • 23. Jump into Neo4J name:staff type:weapon name:Splinter fullName:Hamato Yoshi type: rat type: interact type:knows name:Shredder fullName:Oroku Saki
  • 24. Nodes
  • 26. Properties name:staff type:weapon name:Splinter fullName:Hamato Yoshi type: rat type: interact type:knows
  • 27. Mapping Reference Node Subreference Domain Class/Type SubreferenceNode Domain Class Instance Instance Domain Class Properties Instance Properties Assocoation
  • 28. Compatibility with GORM ✔ ✗ Simple persistence methods HQL queries Dynamic finders Dirty checking methods Criteria queries Composite primary keys Named queries Any direct interaction with the Hibernate API Inheritance Custom Hibernate user types Embedded types Query by example Many-to-many associations (these can be modelled with a mapping class)
  • 29. Getting Started grails install-plugin neo4j grails uninstall-plugin hibernate
  • 32. Combining Neo4j And Hibernate static mapWith = "neo4j” def hibernateHero = Hero.get(1) hibernateHero.neo4j.save() def neo4jHero = Person.neo4j.get(1)
  • 33. Advanced Configuration grails-app/conf/DataSource.groovy grails { neo4j { type = "embedded" location = "/var/neo4j" params = [] } }
  • 34. Via REST type = "rest” grails { neo4j { type = "rest" location = "http://localhost:7474/db/data/" } }
  • 35. High Availabile type = "ha” grails { neo4j { type = "ha" location = "/var/neo4j" params = [ // see http://docs.neo4j.org/chunked/stable/ha-configuration.html 'ha.server_id': 1, 'ha.coordinators': 'localhost:2181,localhost:2182,localhost:2183' ] } }
  • 36. References no:sql http://nosql-database.org/ neo4j http://neo4j.org grails-neo4j plug-in http://jira.grails.org/browse/GPNEO4J http://springsource.github.com/grails-data- mapping/neo4j/manual/guide/index.html
  • 37. Questions Q are guaranteed in life – answers aren’t.