SlideShare a Scribd company logo
Groovy & Grails - From Scratch to Production
Grails – from scratch to
production

How we build successful application
Tal Maayani
November 2013
Agenda
•
•
•
•
•
•

About the lecturer
Choosing the technology: Grails vs…
Common pitfalls
Development methodologies
Continuous Integration
Q&A
Choose the right technology
• Project type: self service web application with a rich back office
• Project roadmap: workflow, many integrations with external
vendors, analytic, payments

• Timeline: start development within a short period, full power development
within 3 months, production within 6 months

• Budget
• Available in-house skillset
 Requires fast web development framework like Spring
,Play, Rails, Grails, Django
Comparing between alternatives
Feature

Grails

Rails

Language

Groovy - JVM based

Ruby - Interpreter based

Approach

Domain oriented

Database oriented

Thread support

Native

Poor

Hardware requirements

Requires more memory, and
strong CPU

mediocre memory and CPU

Learning Curve

Fast for a java developers

operates in Database model

Maturity

Less Mature (Founded at 2008)

More mature (Founded at 2004)

Scalability

Offer good scalability

Lack scalability

Libraries

Offers all java based libraries

No java libraries

longer than Grails since Rails
Why we chose Grails?
• Build on known technologies that we already used
• Spring, Hibernate, Tomcat, Quartz

• Fast development
• Scaffolding , Smart reloading, Hundreds of plugins (~1000), groovy

• MVC web application
• Domain, GSP, Controller
Common Grails pitfalls
• Writes java in groovy
experts

•
•
•
•
•

 Use outsource grails

Difficult debugging (comparing to java)

 More logging

Maintaining data model

 Liquibase

Groovy dynamic nature

 Test everything

Some plugins are unstable

 Smart use of plugins

Highly hardware demands

 Use strong machines
Groovy Ecosystem
Spoke

Gradle

Grails

Junit

Build framework

RAD Platform

Gpars

Gaelyc

Muti-threading

Toolkit for GAE

EasyB

Codenarc

GContract

Griffon

Static code
Analysis

Design by contract

BDD

Swing UI

And many more …
Development process
Highlights

• Holistic thinking:
• production deployment, performance, testing, interfaces

• Lean development
• Development of only what is required

• Test on production like environment
• System test as soon as possible
• Learn from mistakes
Grails Plugins

Recommendations
• Do not blind use plugins
•
•
•
•

Plugins dependencies and footprint considerations
Performance consideration (startup overhead)
Write your own set of plugins (configuration, health check, authentication, taglibs)
Maintain up to date plugin

• JS wrapper plugins (Jquery, bootstrap) –
• Not always up to date and maintained
•  sometimes it is preferable to copy the js library instead of using the plugin
Plugins that we used
•
•
•
•
•
•
•
•

In house development
Spring web flow – state machine for managing flows
aws – enable use of amazon via grails service
Cache, zipped resources
Less-css
Spring security
Quartz
Yammer metrics
AWS Configuration Loader Plugin
• Enable the use of external configuration file for per environment
settings
• Server name, performance tuning, etc.

• Receive configuration file
• Local file – for development
• S3 URL – when running on amazon. Use access and secret keys.

• How it works?
• Copy the external configuration file locally and merge config.groovy
Liquibase Plugin
• Use when
• You are using relational DB on production
• Have a frequent schema changes

• Major functionality
• Keep record of every db schema change, use DSL to record these
changes

• Enforce object model & DB match (using MD5)
• Allows to have business logic (in groovy) to support migrations
Liquibase Plugin – cont.
• Drawbacks (for 1.3.6 and below)
• Maintenance
• Do not use per environment configuration in datasource.groovy

• Extension
• Allow running any sql script in change set
For example: Quartz schema
Health Check
• Get report for instance health
• Access to various data sources (MySQL, Mongo, Oracle)
• Access to other components

• Triggered from monitoring system
• Report generated ad hoc

• Implemented in grails plugin
• Building block per access point
Working with Amazon
EC2 vs. Elastic Beanstalk

Capability

EC2

Beanstalk

Configuration
Management

Flexible, can run scripts on
instance build, deployments.
Can use CM like chef or puppet

Use prebuild AM with given
configuration. Can use limited Yml
script for customization

Monitoring, Load
Balancing, Auto
scaling

Need to configure

Automatically defined

Application
management

-

Manage logs, environment
configuration, versions, externalize
configuration properties

Stopping
environment

Environment can be stopped

Environment cannot be stopped

Deployment

Custom script

AWS API call
Continuous Integration
Using Amazon

 Dev. commits
 Build server run unit tests
 Build server deploy war to dev integration environment

 Build server deploy war to amazon QA environment
Build server triggered Selenium to run subsystem test against QA
War is ready (PSP)
KPI Measurements
• Define a set of goals that measures success
• Total # of users, abandonment rate, conversion rate

• Define measurements tools
• Systematically and periodically measure
• Learn from the results

More Related Content

What's hot (18)

PDF
Drupal contributor HOWTO
Andriy Yun
 
PDF
Gradle build automation tool
Ioan Eugen Stan
 
PDF
Spring GraphQL
VMware Tanzu
 
PDF
Gradle enabled android project
Shaka Huang
 
PDF
Devoxx : being productive with JHipster
Julien Dubois
 
PPT
Google Web Toolkit
Michael Angelo Rivera
 
PPTX
Lightning Web Components by Abdul Gafoor
Jayesh Tejwani
 
PDF
How to keep maintainability of long life Scala applications
takezoe
 
PPTX
GraphQL Introduction
bobo52310
 
PPTX
ng4 webpack and yarn in JHipster
Sendil Kumar
 
PPTX
Better java with design
Narayann Swaami
 
PPTX
Сергей Моренец: "Gradle. Write once, build everywhere"
Provectus
 
PDF
Easy Microservices with JHipster - Devoxx BE 2017
Deepu K Sasidharan
 
PDF
Scala laboratory. Globus. iteration #1
Vasil Remeniuk
 
PDF
Continuous delivery@LesFurets - DC Continuous delivery meetup
Raphaël Brugier
 
PDF
Migrating from Grails 2 to Grails 3
Michael Plöd
 
PDF
Headless Drupal: A modern approach to (micro)services and APIs
sparkfabrik
 
PDF
Android - Gradle build optimisation 3d83f31339d239abcc55f869e5f30348?s=47
Bartosz Kosarzycki
 
Drupal contributor HOWTO
Andriy Yun
 
Gradle build automation tool
Ioan Eugen Stan
 
Spring GraphQL
VMware Tanzu
 
Gradle enabled android project
Shaka Huang
 
Devoxx : being productive with JHipster
Julien Dubois
 
Google Web Toolkit
Michael Angelo Rivera
 
Lightning Web Components by Abdul Gafoor
Jayesh Tejwani
 
How to keep maintainability of long life Scala applications
takezoe
 
GraphQL Introduction
bobo52310
 
ng4 webpack and yarn in JHipster
Sendil Kumar
 
Better java with design
Narayann Swaami
 
Сергей Моренец: "Gradle. Write once, build everywhere"
Provectus
 
Easy Microservices with JHipster - Devoxx BE 2017
Deepu K Sasidharan
 
Scala laboratory. Globus. iteration #1
Vasil Remeniuk
 
Continuous delivery@LesFurets - DC Continuous delivery meetup
Raphaël Brugier
 
Migrating from Grails 2 to Grails 3
Michael Plöd
 
Headless Drupal: A modern approach to (micro)services and APIs
sparkfabrik
 
Android - Gradle build optimisation 3d83f31339d239abcc55f869e5f30348?s=47
Bartosz Kosarzycki
 

Similar to Groovy & Grails - From Scratch to Production (20)

PPTX
Introduction to Grails 2013
Gavin Hogan
 
KEY
Grails at DMC Digital
tomaslin
 
KEY
Introduction To Grails
Eric Berry
 
PPTX
Consistent Rapid Web Dev And Deployment To Cloud
pmankale
 
PDF
Grails At Linked
LinkedIn
 
PDF
Grails at Linkedin
Guillaume Laforge
 
PDF
Cut your Grails application to pieces - build feature plugins
GR8Conf
 
ODP
Cloud computing - an insight into "how does it really work ?"
Tikal Knowledge
 
PDF
Grails 101
David Jacobs
 
PDF
Build your next application in weeks and not months with Groovy and Grails
People10 Technosoft Private Limited
 
PDF
Future of Grails
Daniel Woods
 
PDF
Grails 3.0 Preview
graemerocher
 
PPTX
One-stop solution for Grails web app development
OnGraph Technologies Pvt. Ltd.
 
PDF
Iboss Web Brochure
ibosstech
 
PPT
Use Cases of #Grails in #WebApplications
Xebia IT Architects
 
KEY
Greasing The Wheels
Aman Kohli
 
PPT
Fast web development using groovy on grails
Anshuman Biswal
 
PDF
Ymens - Bouncing off clouds - Rapid Development for Cloud Ready Applications...
Vlad Mihnea
 
PDF
GR8Conf 2011: Adopting Grails
GR8Conf
 
PDF
Adopting Grails - GR8Conf Europe
KlausBaumecker
 
Introduction to Grails 2013
Gavin Hogan
 
Grails at DMC Digital
tomaslin
 
Introduction To Grails
Eric Berry
 
Consistent Rapid Web Dev And Deployment To Cloud
pmankale
 
Grails At Linked
LinkedIn
 
Grails at Linkedin
Guillaume Laforge
 
Cut your Grails application to pieces - build feature plugins
GR8Conf
 
Cloud computing - an insight into "how does it really work ?"
Tikal Knowledge
 
Grails 101
David Jacobs
 
Build your next application in weeks and not months with Groovy and Grails
People10 Technosoft Private Limited
 
Future of Grails
Daniel Woods
 
Grails 3.0 Preview
graemerocher
 
One-stop solution for Grails web app development
OnGraph Technologies Pvt. Ltd.
 
Iboss Web Brochure
ibosstech
 
Use Cases of #Grails in #WebApplications
Xebia IT Architects
 
Greasing The Wheels
Aman Kohli
 
Fast web development using groovy on grails
Anshuman Biswal
 
Ymens - Bouncing off clouds - Rapid Development for Cloud Ready Applications...
Vlad Mihnea
 
GR8Conf 2011: Adopting Grails
GR8Conf
 
Adopting Grails - GR8Conf Europe
KlausBaumecker
 
Ad

Recently uploaded (20)

PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Learn Computer Forensics, Second Edition
AnuraShantha7
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
July Patch Tuesday
Ivanti
 
Learn Computer Forensics, Second Edition
AnuraShantha7
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Ad

Groovy & Grails - From Scratch to Production

  • 2. Grails – from scratch to production How we build successful application Tal Maayani November 2013
  • 3. Agenda • • • • • • About the lecturer Choosing the technology: Grails vs… Common pitfalls Development methodologies Continuous Integration Q&A
  • 4. Choose the right technology • Project type: self service web application with a rich back office • Project roadmap: workflow, many integrations with external vendors, analytic, payments • Timeline: start development within a short period, full power development within 3 months, production within 6 months • Budget • Available in-house skillset  Requires fast web development framework like Spring ,Play, Rails, Grails, Django
  • 5. Comparing between alternatives Feature Grails Rails Language Groovy - JVM based Ruby - Interpreter based Approach Domain oriented Database oriented Thread support Native Poor Hardware requirements Requires more memory, and strong CPU mediocre memory and CPU Learning Curve Fast for a java developers operates in Database model Maturity Less Mature (Founded at 2008) More mature (Founded at 2004) Scalability Offer good scalability Lack scalability Libraries Offers all java based libraries No java libraries longer than Grails since Rails
  • 6. Why we chose Grails? • Build on known technologies that we already used • Spring, Hibernate, Tomcat, Quartz • Fast development • Scaffolding , Smart reloading, Hundreds of plugins (~1000), groovy • MVC web application • Domain, GSP, Controller
  • 7. Common Grails pitfalls • Writes java in groovy experts • • • • •  Use outsource grails Difficult debugging (comparing to java)  More logging Maintaining data model  Liquibase Groovy dynamic nature  Test everything Some plugins are unstable  Smart use of plugins Highly hardware demands  Use strong machines
  • 8. Groovy Ecosystem Spoke Gradle Grails Junit Build framework RAD Platform Gpars Gaelyc Muti-threading Toolkit for GAE EasyB Codenarc GContract Griffon Static code Analysis Design by contract BDD Swing UI And many more …
  • 9. Development process Highlights • Holistic thinking: • production deployment, performance, testing, interfaces • Lean development • Development of only what is required • Test on production like environment • System test as soon as possible • Learn from mistakes
  • 10. Grails Plugins Recommendations • Do not blind use plugins • • • • Plugins dependencies and footprint considerations Performance consideration (startup overhead) Write your own set of plugins (configuration, health check, authentication, taglibs) Maintain up to date plugin • JS wrapper plugins (Jquery, bootstrap) – • Not always up to date and maintained •  sometimes it is preferable to copy the js library instead of using the plugin
  • 11. Plugins that we used • • • • • • • • In house development Spring web flow – state machine for managing flows aws – enable use of amazon via grails service Cache, zipped resources Less-css Spring security Quartz Yammer metrics
  • 12. AWS Configuration Loader Plugin • Enable the use of external configuration file for per environment settings • Server name, performance tuning, etc. • Receive configuration file • Local file – for development • S3 URL – when running on amazon. Use access and secret keys. • How it works? • Copy the external configuration file locally and merge config.groovy
  • 13. Liquibase Plugin • Use when • You are using relational DB on production • Have a frequent schema changes • Major functionality • Keep record of every db schema change, use DSL to record these changes • Enforce object model & DB match (using MD5) • Allows to have business logic (in groovy) to support migrations
  • 14. Liquibase Plugin – cont. • Drawbacks (for 1.3.6 and below) • Maintenance • Do not use per environment configuration in datasource.groovy • Extension • Allow running any sql script in change set For example: Quartz schema
  • 15. Health Check • Get report for instance health • Access to various data sources (MySQL, Mongo, Oracle) • Access to other components • Triggered from monitoring system • Report generated ad hoc • Implemented in grails plugin • Building block per access point
  • 16. Working with Amazon EC2 vs. Elastic Beanstalk Capability EC2 Beanstalk Configuration Management Flexible, can run scripts on instance build, deployments. Can use CM like chef or puppet Use prebuild AM with given configuration. Can use limited Yml script for customization Monitoring, Load Balancing, Auto scaling Need to configure Automatically defined Application management - Manage logs, environment configuration, versions, externalize configuration properties Stopping environment Environment can be stopped Environment cannot be stopped Deployment Custom script AWS API call
  • 17. Continuous Integration Using Amazon  Dev. commits  Build server run unit tests  Build server deploy war to dev integration environment  Build server deploy war to amazon QA environment Build server triggered Selenium to run subsystem test against QA War is ready (PSP)
  • 18. KPI Measurements • Define a set of goals that measures success • Total # of users, abandonment rate, conversion rate • Define measurements tools • Systematically and periodically measure • Learn from the results