• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Grails lucenecacherdfperformance
 

Grails lucenecacherdfperformance

on

  • 1,304 views

 

Statistics

Views

Total Views
1,304
Views on SlideShare
1,299
Embed Views
5

Actions

Likes
0
Downloads
9
Comments
2

2 Embeds 5

http://www.linkedin.com 3
https://www.linkedin.com 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

12 of 2 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Good presentation Mike! I already implemented some of this into one of our doggier apps, and it definitely helps alot!
    Are you sure you want to
    Your message goes here
    Processing…
  • I like this presentation, performance is key in Grails right now.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Grails lucenecacherdfperformance Grails lucenecacherdfperformance Presentation Transcript

    • BLAZING FAST PERFORMANCE with Spring Cache, Lucene, GPars, RDF and Grails
    • WHAT’S A TRIPLE? subjectpredicate object
    • WHAT’S A TRIPLE? subject “Imatinib”predicate type object Pharmaceutical Drug
    • LINKING OPEN DRUG DATA http://esw.w3.org/HCLSIG/LODD
    • WHAT’S A TRIPLE?http://www4.wiwiss.fu-berlin.de/drugbank/page/drugs/DB00619 subject predicate object DB00619 label “Imatinib” DB00619 type drugbank:drugs DB00619 brandName “Gleevec” DB00619 drugbank:target targets:17
    • WHAT’S A TRIPLE?http://www4.wiwiss.fu-berlin.de/drugbank/page/targets/17 subject predicate object DB00619 drugbank:target targets/17 targets/17 type drugbank:drugs “Proto-oncogene tyrosine- targets/17 label protein kinase ABL1” targets/17 geneName “ABL1”
    • RELATIONSHIPS ABL1Imatinib target Legend associatedGene Gene possibleDrug Disease Compound Predicate Leukemia
    • PERFORMANCE Type-ahead search
    • select id, labelfrom targetswhere label like ‘%${queryValue}%’
    • select id, labelfrom targetswhere label like ‘%${queryValue}%’SELECT ?uri ?label WHERE { ?uri rdfs:label ?label . ?uri rdf:type drugbank:targets . FILTER regex(?label, Q${queryValue}E, i)"}
    • select id, labelfrom targetswhere label like ‘%${queryValue}%’SELECT ?uri ?label WHERE { ?uri rdfs:label ?label . ?uri rdf:type drugbank:targets . FILTER regex(?label, Q${queryValue}E, i)"} 40 million records
    • Index the data (up front performance hit)Search (really really really really fast)BuildConfig.groovy: runtime org.apache.lucene:lucene-core:3.0.1 -OR-grails install-plugin searchable
    • DE-DUPE
    • Lucene ExtensionIndex the (RDF) dataSearch (really really really really fast)
    • Understands Triples (or structured data) subject predicate object DB00619 label “Imatinib”SirenTupleQuery tupleQuery = new SirenTupleQuery()tupleQuery.add(createCellQuery(‘label’, SirenTupleConstraintPosition.PREDICATE), SirenTupleClause.Occur.MUST)tupleQuery.add(createCellQuery(‘imatinib’, SirenTupleConstraintPosition.OBJECT), SirenTupleClause.Occur.MUST)
    • GRAILS SPRING CACHE• grails install-plugin springcache• Add @Cacheable (and or @CacheFlush) annotation to services / controllers@Cacheable(somecachename)def slow(String name) { log.info "resolving $name" Thread.sleep(2000) return "took a long time to resolve ${name}"}
    • GPARS• BuildConfig.groovy: runtime org.codehaus.gpars:gpars:0.10 runtime org.coconut.forkjoin.jsr166y:jsr166y:070108• http://www.gpars.org/guide/index.html• Note:hibernate session is not available on GPars threads; you need to get one yourself (use DomainClass.withTransaction)• Data Parallelism• Map-Reduce, Fork-Join, and many more...
    • GPARSvoid resolve(scoreDocs){ scoreDocs.each {scoreDoc -> //do something in single thread }}void resolveWithPool(scoreDocs){ GParsPool.withPool { scoreDocs.eachParallel {scoreDoc -> //do something in parallel } }}
    • OTHER HANDY TOOLS• Grails Melody (Java Melody) (monitoring)• Perf4j (logging performance)• Solr (lucene search server)• Grails Console Plugin (web based console)