SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Rapid development with Neo4J
         under Grails
About Myself
•   Stanislav Shevchenko
•   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.

Weitere ähnliche Inhalte

Was ist angesagt?

The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論scalaconfjp
 
Writing DSL's in Scala
Writing DSL's in ScalaWriting DSL's in Scala
Writing DSL's in ScalaAbhijit Sharma
 
Using Scala for building DSLs
Using Scala for building DSLsUsing Scala for building DSLs
Using Scala for building DSLsIndicThreads
 
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)mircodotta
 
Scala : language of the future
Scala : language of the futureScala : language of the future
Scala : language of the futureAnsviaLab
 
The Why and How of Scala at Twitter
The Why and How of Scala at TwitterThe Why and How of Scala at Twitter
The Why and How of Scala at TwitterAlex Payne
 
Java Serialization Facts and Fallacies
Java Serialization Facts and FallaciesJava Serialization Facts and Fallacies
Java Serialization Facts and FallaciesRoman Elizarov
 
Scala Days San Francisco
Scala Days San FranciscoScala Days San Francisco
Scala Days San FranciscoMartin Odersky
 
From Ruby to Scala
From Ruby to ScalaFrom Ruby to Scala
From Ruby to Scalatod esking
 
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介scalaconfjp
 
flatMap Oslo presentation slides
flatMap Oslo presentation slidesflatMap Oslo presentation slides
flatMap Oslo presentation slidesMartin Odersky
 
Advanced Production Debugging
Advanced Production DebuggingAdvanced Production Debugging
Advanced Production DebuggingTakipi
 
What To Leave Implicit
What To Leave ImplicitWhat To Leave Implicit
What To Leave ImplicitMartin Odersky
 
Java 8 and Beyond, a Scala Story
Java 8 and Beyond, a Scala StoryJava 8 and Beyond, a Scala Story
Java 8 and Beyond, a Scala StoryTomer Gabel
 
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...scalaconfjp
 
The Evolution of Scala
The Evolution of ScalaThe Evolution of Scala
The Evolution of ScalaMartin Odersky
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to ScalaRahul Jain
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataRoger Xia
 

Was ist angesagt? (20)

The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論
 
Scalax
ScalaxScalax
Scalax
 
Writing DSL's in Scala
Writing DSL's in ScalaWriting DSL's in Scala
Writing DSL's in Scala
 
Using Scala for building DSLs
Using Scala for building DSLsUsing Scala for building DSLs
Using Scala for building DSLs
 
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
 
Scala : language of the future
Scala : language of the futureScala : language of the future
Scala : language of the future
 
The Why and How of Scala at Twitter
The Why and How of Scala at TwitterThe Why and How of Scala at Twitter
The Why and How of Scala at Twitter
 
Java Serialization Facts and Fallacies
Java Serialization Facts and FallaciesJava Serialization Facts and Fallacies
Java Serialization Facts and Fallacies
 
Scala Days San Francisco
Scala Days San FranciscoScala Days San Francisco
Scala Days San Francisco
 
From Ruby to Scala
From Ruby to ScalaFrom Ruby to Scala
From Ruby to Scala
 
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
 
flatMap Oslo presentation slides
flatMap Oslo presentation slidesflatMap Oslo presentation slides
flatMap Oslo presentation slides
 
Advanced Production Debugging
Advanced Production DebuggingAdvanced Production Debugging
Advanced Production Debugging
 
What To Leave Implicit
What To Leave ImplicitWhat To Leave Implicit
What To Leave Implicit
 
Java 8 and Beyond, a Scala Story
Java 8 and Beyond, a Scala StoryJava 8 and Beyond, a Scala Story
Java 8 and Beyond, a Scala Story
 
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...
 
The Evolution of Scala
The Evolution of ScalaThe Evolution of Scala
The Evolution of Scala
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_data
 
Preparing for Scala 3
Preparing for Scala 3Preparing for Scala 3
Preparing for Scala 3
 

Ähnlich wie Neo4 + Grails

GR8Conf 2011: Neo4j Plugin
GR8Conf 2011: Neo4j PluginGR8Conf 2011: Neo4j Plugin
GR8Conf 2011: Neo4j PluginGR8Conf
 
Facebook architecture
Facebook architectureFacebook architecture
Facebook architecturedrewz lin
 
Facebook的架构
Facebook的架构Facebook的架构
Facebook的架构yiditushe
 
Facebook architecture
Facebook architectureFacebook architecture
Facebook architecturemysqlops
 
Qcon 090408233824-phpapp01
Qcon 090408233824-phpapp01Qcon 090408233824-phpapp01
Qcon 090408233824-phpapp01jgregory1234
 
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)Chris Richardson
 
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 Javasunnygleason
 
Groovy and Grails
Groovy and GrailsGroovy and Grails
Groovy and GrailsGiltTech
 
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 applicationsIndicThreads
 
Accelerating NoSQL
Accelerating NoSQLAccelerating NoSQL
Accelerating NoSQLsunnygleason
 
Hadoop Summit - Hausenblas 20 March
Hadoop Summit - Hausenblas 20 MarchHadoop Summit - Hausenblas 20 March
Hadoop Summit - Hausenblas 20 MarchMapR 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 DrillDataWorks Summit
 
Navigating NoSQL in cloudy skies
Navigating NoSQL in cloudy skiesNavigating NoSQL in cloudy skies
Navigating NoSQL in cloudy skiesshnkr_rmchndrn
 
Common MongoDB Use Cases
Common MongoDB Use CasesCommon MongoDB Use Cases
Common MongoDB Use CasesDATAVERSITY
 

Ähnlich wie Neo4 + 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
 
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
 
Grails 101
Grails 101Grails 101
Grails 101
 
Accelerating NoSQL
Accelerating NoSQLAccelerating NoSQL
Accelerating NoSQL
 
Taming NoSQL with Spring Data
Taming NoSQL with Spring DataTaming NoSQL with Spring Data
Taming NoSQL with Spring Data
 
Bhavesh ro r
Bhavesh ro rBhavesh ro r
Bhavesh ro r
 
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
 
Navigating NoSQL in cloudy skies
Navigating NoSQL in cloudy skiesNavigating NoSQL in cloudy skies
Navigating NoSQL in cloudy skies
 
Common MongoDB Use Cases
Common MongoDB Use CasesCommon MongoDB Use Cases
Common MongoDB Use Cases
 

Kürzlich hochgeladen

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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 FresherRemote DBA Services
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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 Takeoffsammart93
 
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...Miguel Araújo
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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...Martijn de Jong
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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 WorkerThousandEyes
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Kürzlich hochgeladen (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
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...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Neo4 + Grails

  • 1. Rapid development with Neo4J under Grails
  • 2. About Myself • Stanislav Shevchenko • 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.