SlideShare a Scribd company logo
1 of 19
Debugging Grails Database
     Performance
Tom Dunstan / @tomdcc


                                           tom@energizedwork.com


                                                                      #ggx




LICENSEDUNDERCREATIVECOMMONSBYENERGIZEDWORKLIMITED   |HMSPRESIDENT,VICTORIAEMBANKMENT,LONDON,EC40HJ|WWW.ENERGIZEDWORK.COM   2
✪ GORM

•   One of the best parts of Grails
•   Easy data access
•   No DAOs etc required
•   Can access data from anywhere
✪ GORM

•   Can access data from anywhere
•   This can be dangerous
•   Many data access patterns can coexist
•   Difficult to work out what is generating a
    particular query
✪ GORM

• Getting data out of collections can have
  unintended consequences
✪ WHERE CAN WE ACCESS DATA?

•   Filters
•   URL Mapping Constraints
•   Controllers
•   Services
•   Modules
•   Named Queries
•   Helper classes
•   Views
•   Tag Libraries
✪ WHERE CAN WE ACCESS DATA?

• It may not be apparent exactly when
  data is being fetched
✪ SPAGHETTI

• Long lived projects can evolve
  multiple ways of doing things
DEMO 1
✪ SORTING IT OUT

• Logging SQL doesn’t tie generated SQL to
  specific parts of the codebase
✪ SORTING IT OUT

• Existing profiler plugin can automatically log
  controller, service and view entry / exits
• Not bad, but doesn’t tie SQL queries to those
  places
• Stuff in e.g. taglibs isn’t made explicit
• Stuff in layout vs main view isn’t made explicit
✪ THE TARGET

• MVC Mini Profiler
• Developed for Stack Overflow
• Keeps performance on your mind
✪ THE TARGET
DEMO 2
✪ CURRENT STATUS

•   Version 0.1
•   Just pushed to Github
•   Plugin waiting for approval 
•   Not all features of MVC Mini Profiler
✪ FUTURE

• Implement missing MVC Mini Profiler features
   – SQL Storage
   – Detect Duplicate SQL queries
✪ FUTURE

• Grails profiler plugin needs some work for 2.0+
• Not tested on 2.0+
✪ FUTURE

• Split out separate Java library to share
  functionality with other frameworks
• Show nested GSP names
• Show Tag Library calls
• EXPLAIN functionality built in
   – Debug query performance from within app
   – Supported by PostgreSQL, MySQL, others?
• Support non-SQL data stores
✪ QUESTIONS




        https://github.com/tomdcc/grails-miniprofiler

                                             Tom Dunstan / @tomdcc
                                            tom@energizedwork.com




 LICENSEDUNDERCREATIVECOMMONSBYENERGIZEDWORKLIMITED   |HMSPRESIDENT,VICTORIAEMBANKMENT,LONDON,EC40HJ|WWW.ENERGIZEDWORK.COM   19

More Related Content

What's hot

Dnc2015 azure-microservizi-vforusso
Dnc2015 azure-microservizi-vforussoDnc2015 azure-microservizi-vforusso
Dnc2015 azure-microservizi-vforusso
DotNetCampus
 
Icinga Camp San Francisco 2017 - Icinga Director - Managing your configuration
Icinga Camp San Francisco 2017 - Icinga Director - Managing your configurationIcinga Camp San Francisco 2017 - Icinga Director - Managing your configuration
Icinga Camp San Francisco 2017 - Icinga Director - Managing your configuration
Icinga
 
Micro-frontends – is it a new normal?
Micro-frontends – is it a new normal?Micro-frontends – is it a new normal?
Micro-frontends – is it a new normal?
Lohika_Odessa_TechTalks
 

What's hot (20)

Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019
 
Building and Releasing a Golang CLI Tool
Building and Releasing a Golang CLI ToolBuilding and Releasing a Golang CLI Tool
Building and Releasing a Golang CLI Tool
 
Dnc2015 azure-microservizi-vforusso
Dnc2015 azure-microservizi-vforussoDnc2015 azure-microservizi-vforusso
Dnc2015 azure-microservizi-vforusso
 
markedj: The best of markdown processor on JVM
markedj: The best of markdown processor on JVMmarkedj: The best of markdown processor on JVM
markedj: The best of markdown processor on JVM
 
Tips For Maintaining OSS Projects
Tips For Maintaining OSS ProjectsTips For Maintaining OSS Projects
Tips For Maintaining OSS Projects
 
Migrating NYSenate.gov
Migrating NYSenate.govMigrating NYSenate.gov
Migrating NYSenate.gov
 
Blazing fast sites using Blaze, Hybrid CMS NYC
Blazing fast sites using Blaze, Hybrid CMS NYCBlazing fast sites using Blaze, Hybrid CMS NYC
Blazing fast sites using Blaze, Hybrid CMS NYC
 
Automate your development environment with Jira and Saltstack
Automate your development environment with Jira and SaltstackAutomate your development environment with Jira and Saltstack
Automate your development environment with Jira and Saltstack
 
Icinga Camp San Diego 2016 - Icinga Director
Icinga Camp San Diego 2016 - Icinga DirectorIcinga Camp San Diego 2016 - Icinga Director
Icinga Camp San Diego 2016 - Icinga Director
 
IcingaCamp Stockholm - Icinga Web2
IcingaCamp Stockholm - Icinga Web2IcingaCamp Stockholm - Icinga Web2
IcingaCamp Stockholm - Icinga Web2
 
Icinga Camp San Francisco 2017 - Icinga Director - Managing your configuration
Icinga Camp San Francisco 2017 - Icinga Director - Managing your configurationIcinga Camp San Francisco 2017 - Icinga Director - Managing your configuration
Icinga Camp San Francisco 2017 - Icinga Director - Managing your configuration
 
Icinga Camp Belgrade - Icinga Web 2
Icinga Camp Belgrade - Icinga Web 2Icinga Camp Belgrade - Icinga Web 2
Icinga Camp Belgrade - Icinga Web 2
 
How we use Python at Bitbucket
How we use Python at BitbucketHow we use Python at Bitbucket
How we use Python at Bitbucket
 
How to avoid microservice pitfalls
How to avoid microservice pitfallsHow to avoid microservice pitfalls
How to avoid microservice pitfalls
 
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
 
Introduction to OpenFaas
Introduction to OpenFaasIntroduction to OpenFaas
Introduction to OpenFaas
 
ONAP on Vagrant for ONAPers
ONAP on Vagrant for ONAPersONAP on Vagrant for ONAPers
ONAP on Vagrant for ONAPers
 
Micro-frontends – is it a new normal?
Micro-frontends – is it a new normal?Micro-frontends – is it a new normal?
Micro-frontends – is it a new normal?
 
Icinga Camp Bangalore - Icinga and Icinga Director
Icinga Camp Bangalore - Icinga and Icinga Director Icinga Camp Bangalore - Icinga and Icinga Director
Icinga Camp Bangalore - Icinga and Icinga Director
 
Node.js BFFs: our way to better/micro frontends
Node.js BFFs: our way to better/micro frontendsNode.js BFFs: our way to better/micro frontends
Node.js BFFs: our way to better/micro frontends
 

Similar to Debugging Grails Database Performance

Similar to Debugging Grails Database Performance (20)

John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudy
 
dbt Python models - GoDataFest by Guillermo Sanchez
dbt Python models - GoDataFest by Guillermo Sanchezdbt Python models - GoDataFest by Guillermo Sanchez
dbt Python models - GoDataFest by Guillermo Sanchez
 
Stackato v2
Stackato v2Stackato v2
Stackato v2
 
Docker in Production: How RightScale Delivers Cloud Applications
Docker in Production: How RightScale Delivers Cloud ApplicationsDocker in Production: How RightScale Delivers Cloud Applications
Docker in Production: How RightScale Delivers Cloud Applications
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
 
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
 
Stackato v5
Stackato v5Stackato v5
Stackato v5
 
Untangling spring week10
Untangling spring week10Untangling spring week10
Untangling spring week10
 
Icinga Web 2 is more
Icinga Web 2 is moreIcinga Web 2 is more
Icinga Web 2 is more
 
Stardog 1.1: Easier, Smarter, Faster RDF Database
Stardog 1.1: Easier, Smarter, Faster RDF DatabaseStardog 1.1: Easier, Smarter, Faster RDF Database
Stardog 1.1: Easier, Smarter, Faster RDF Database
 
Stardog 1.1: An Easier, Smarter, Faster RDF Database
Stardog 1.1: An Easier, Smarter, Faster RDF DatabaseStardog 1.1: An Easier, Smarter, Faster RDF Database
Stardog 1.1: An Easier, Smarter, Faster RDF Database
 
Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0
 
Discovering Vulnerabilities For Fun and Profit
Discovering Vulnerabilities For Fun and ProfitDiscovering Vulnerabilities For Fun and Profit
Discovering Vulnerabilities For Fun and Profit
 
Dropwizard and Groovy
Dropwizard and GroovyDropwizard and Groovy
Dropwizard and Groovy
 
Digdag Updates 2020 July
Digdag Updates 2020 JulyDigdag Updates 2020 July
Digdag Updates 2020 July
 
Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...
Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...
Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...
 
Building Top-Notch Androids SDKs
Building Top-Notch Androids SDKsBuilding Top-Notch Androids SDKs
Building Top-Notch Androids SDKs
 
Test driven development - Zombie proof your code
Test driven development - Zombie proof your codeTest driven development - Zombie proof your code
Test driven development - Zombie proof your code
 
Old code doesn't stink
Old code doesn't stinkOld code doesn't stink
Old code doesn't stink
 
Web Crawling & Crawler
Web Crawling & CrawlerWeb Crawling & Crawler
Web Crawling & Crawler
 

More from Energized Work

Experience report on agile tools for management teams
Experience report on agile tools for management teamsExperience report on agile tools for management teams
Experience report on agile tools for management teams
Energized Work
 
Business model innovation by experimentation
Business model innovation by experimentationBusiness model innovation by experimentation
Business model innovation by experimentation
Energized Work
 
MTBF / MTTR - Energized Work TekTalk, Mar 2012
MTBF / MTTR - Energized Work TekTalk, Mar 2012MTBF / MTTR - Energized Work TekTalk, Mar 2012
MTBF / MTTR - Energized Work TekTalk, Mar 2012
Energized Work
 
Energized Work: Software that means business
Energized Work: Software that means businessEnergized Work: Software that means business
Energized Work: Software that means business
Energized Work
 
Leaning - Energized Work Presentation
Leaning - Energized Work PresentationLeaning - Energized Work Presentation
Leaning - Energized Work Presentation
Energized Work
 

More from Energized Work (11)

Agile Practitioners Feedback to improve teams
Agile Practitioners Feedback to improve teamsAgile Practitioners Feedback to improve teams
Agile Practitioners Feedback to improve teams
 
Surviving SOA
Surviving SOASurviving SOA
Surviving SOA
 
Experience report on agile tools for management teams
Experience report on agile tools for management teamsExperience report on agile tools for management teams
Experience report on agile tools for management teams
 
Innovation Governance
Innovation GovernanceInnovation Governance
Innovation Governance
 
Business model innovation by experimentation
Business model innovation by experimentationBusiness model innovation by experimentation
Business model innovation by experimentation
 
Governance - Friend or Foe?
Governance - Friend or Foe?Governance - Friend or Foe?
Governance - Friend or Foe?
 
MTBF / MTTR - Energized Work TekTalk, Mar 2012
MTBF / MTTR - Energized Work TekTalk, Mar 2012MTBF / MTTR - Energized Work TekTalk, Mar 2012
MTBF / MTTR - Energized Work TekTalk, Mar 2012
 
Energized Work: Software that means business
Energized Work: Software that means businessEnergized Work: Software that means business
Energized Work: Software that means business
 
Product Development in the Land of the Free - Energized Work Presentation
Product Development in the Land of the Free - Energized Work PresentationProduct Development in the Land of the Free - Energized Work Presentation
Product Development in the Land of the Free - Energized Work Presentation
 
Leaning - Energized Work Presentation
Leaning - Energized Work PresentationLeaning - Energized Work Presentation
Leaning - Energized Work Presentation
 
Concept to Cash - Energized Work Presentation
Concept to Cash - Energized Work PresentationConcept to Cash - Energized Work Presentation
Concept to Cash - Energized Work Presentation
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
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
 

Recently uploaded (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
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
 
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, ...
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

Debugging Grails Database Performance

  • 2. Tom Dunstan / @tomdcc tom@energizedwork.com #ggx LICENSEDUNDERCREATIVECOMMONSBYENERGIZEDWORKLIMITED |HMSPRESIDENT,VICTORIAEMBANKMENT,LONDON,EC40HJ|WWW.ENERGIZEDWORK.COM 2
  • 3. ✪ GORM • One of the best parts of Grails • Easy data access • No DAOs etc required • Can access data from anywhere
  • 4. ✪ GORM • Can access data from anywhere • This can be dangerous • Many data access patterns can coexist • Difficult to work out what is generating a particular query
  • 5. ✪ GORM • Getting data out of collections can have unintended consequences
  • 6. ✪ WHERE CAN WE ACCESS DATA? • Filters • URL Mapping Constraints • Controllers • Services • Modules • Named Queries • Helper classes • Views • Tag Libraries
  • 7. ✪ WHERE CAN WE ACCESS DATA? • It may not be apparent exactly when data is being fetched
  • 8. ✪ SPAGHETTI • Long lived projects can evolve multiple ways of doing things
  • 10. ✪ SORTING IT OUT • Logging SQL doesn’t tie generated SQL to specific parts of the codebase
  • 11. ✪ SORTING IT OUT • Existing profiler plugin can automatically log controller, service and view entry / exits • Not bad, but doesn’t tie SQL queries to those places • Stuff in e.g. taglibs isn’t made explicit • Stuff in layout vs main view isn’t made explicit
  • 12. ✪ THE TARGET • MVC Mini Profiler • Developed for Stack Overflow • Keeps performance on your mind
  • 15. ✪ CURRENT STATUS • Version 0.1 • Just pushed to Github • Plugin waiting for approval  • Not all features of MVC Mini Profiler
  • 16. ✪ FUTURE • Implement missing MVC Mini Profiler features – SQL Storage – Detect Duplicate SQL queries
  • 17. ✪ FUTURE • Grails profiler plugin needs some work for 2.0+ • Not tested on 2.0+
  • 18. ✪ FUTURE • Split out separate Java library to share functionality with other frameworks • Show nested GSP names • Show Tag Library calls • EXPLAIN functionality built in – Debug query performance from within app – Supported by PostgreSQL, MySQL, others? • Support non-SQL data stores
  • 19. ✪ QUESTIONS https://github.com/tomdcc/grails-miniprofiler Tom Dunstan / @tomdcc tom@energizedwork.com LICENSEDUNDERCREATIVECOMMONSBYENERGIZEDWORKLIMITED |HMSPRESIDENT,VICTORIAEMBANKMENT,LONDON,EC40HJ|WWW.ENERGIZEDWORK.COM 19