I started working with Grails about three years ago. In that time, I have delivered seven different greenfield pure Grails applications for the wine, automotive and travel industries ( and inherited one fashion webapp ).
Working on our latest project, Secret Escapes, I realized that there were a few common business requirements that kept coming up in these projects but are not really taken into account in the ‘Get Started With Grails’ type books. Many of these rely on external services and integrations, which can be tricky and require the use of third party plugins.
In this post, I hope to summarize 8 business requirements that keep coming up in my experience building commercial Grails applications and some of the tools I’ve experimented with for these. Hopefully this will help you plan your next big app.
These usually fall into the ‘Site Maintenance / Admin / Refinement’ categories rather than the ‘Application Development’ categories, but are essential for business, marketing, and moving the site forward.
1. Search Engine Optimization / SEM
There seems to be a lot of SEO / SEM snake oil salespeople out there. For some of projects I worked on, it became a big deal in the application to be able to add keywords, descriptions and customize UrlMappings on the fly.
Sadly, there doesn’t seem to be a Grails SEO plugin since every SEO company you talk to seems to suggest a different way of doing things. From our projects, I found that doing some of the following helps:
- Have a base SEO interface that is extended by your domain classes, this interface should have meta tags like Keywords, title, description, etc. that increase your page visibility.
- Bake SEO right into your layouts. Set titles and meta tags wherever it is needed.
- Have a filter that does 301 permanent redirects for URLs that are obsolete or can be resolved but don’t contain unique link information.
- Have a custom tag library used to generate your links. Append additional SEO information to your links and make them unique via 301 redirects or canonical Urls.
- Don’t forget about social networks. Facebook, for example, uses the opengraph namespace and won’t show nice previews when your links are being shared. So make sure your SEO tag libraries have their little og:title tags littered around your site.
2. Email Deliverability
When starting to write your email application, it is very easy to simply install the mail plugin and pretend all your emails will magically bypass spam filters. Unfortunately, the sendMail method can only get you so far.
Once you start amassing users on your site, you will inevitable seek better ways to both manage and track the mailings that you send out and make sure that your users are getting these emails. For that, you need an email deliverability service that will white list your outbound emails and maybe track them in subscriber lists.
For the volumes used in our site, we unfortunately had to use the terribly cumbersome Experian Cheetahmail service. But there are others out there like SendGrid, MailChimp and the recently announced Amazon Simple Email Service.
3. Site Copy A/B Testing
Sometimes it makes sense to see how changing copy on your site may affect the way your users react to it. Having a good A/B testing mechanism in place will help you change some of the tiny details and tweaks that ultimately affect how many people actually use your site.
Sadly, there is no grails plugin to do the level of A/B testing afforded by 7 minutes A/B in the rails world. However, there are a few web services that are useful for this.
Google offers their own A/B testing suite called website optimizer. The change to your grails code involves simply adding a new javascript to be loaded by your Grails layouts.
My new favorite, however, are tools like Optimizely ( forgotten about this one, thanks Dan Lynn ) and Visual Website Optimizer, which offers a nice GUI for performing split A/B testing.
4. User Activity / Goal / Conversion Tracking
Goal Tracking
Before starting to work on these public facing websites, my approach to adding analytics tracking was simply to slap Google Analytics on a website and think I was done.
However, working with business and marketing folk made me realize that the level of tracking needed for these pages is a little more involved. When we built a microsite for Reebok, for example, every page view, click and interaction was recorded and I assume carefully analyzed by some robot who never slept.
Practically, this means setting up goals and ecommerce conversion tracking on your site with Google Analytics. One of the thing I found useful is to have both a tag library that would output an entire script tag with the tracking code and one that would simply display the javascript code.
Then, you can add this conversion tracking code easily on your site via <my:tracking event=”bought”/> tags or add them to buttons and links when they are clicked. I.e, <g:link mapping=”shoelaces” onclick=”${ my.tracking( event: ‘bought’ ) }”/>
User Activity Tracking
Additionally, sometimes you want to track the user’s activity on your website. See the flow they take before making a decision or which pages they visit. There is a grails plugin called ClickStream that will follow a user’s clicking pattern and record this. You can also implement a custom toolset that fits your particular tracking needs via Grails filters, which is the approach we took.
5. Server Status / Uptime
How Many Users are currently on my site?
If you use Google Analytics to track your visitors, you know that it only updates every 24 hours. My new favorite website for tracking how many users are looking at my site is chartbeat – which shows you the number of users in your site in real-time. This makes it easier to decide whether to restart your server or fix an emergency.
Website Monitoring
This one is easy. You want your electric collar to shock you whenever an error brings down your site. This usually involves setting up a quick integration script with sites like Pingdom or Site24x7.
6. PCI DSS Compliance
When developing a website that accepts payment, I know I levitate towards the payment solution that gives me the most control. This usually means integrating with an API such as the ones provided by Authorize.net and handle credit card processing on my site via a SSH connection.
However, this solution ( provided by plugins like PayPalPro ) usually run counter regulations put in place by credit card companies. According to this BrainTree explanation, getting a fully in-house payment solution sorted takes from 6-18 months.
This often means that the technical solution that gives the most flexibility and versatility also gets in the way of the business requirements. Most merchants offer a hosted solution to get around your website handling credit cards, but it often means surrendering some control of your payment process to these large sites. Beware the PCI compliance.
7. Data Migration – getting your production data up…
Database Migration
When it comes to migrating data, there are two parts to keeping track of : database schema and database content.
Most grails plugins will help you keep track of database schema structure. In the past, we used the Liquibase plugin to XML changesets of our system changes. You run a few grails scripts, these generate a file of the changes you have made to the database and you keep a copy of these in your database. We have recently started using the Database Migration plugin and it is quite good despite its infancy and often irrational behaviour.
More troubling, however, is often the process needed to migrate data from a staging or production environment to a live environment. While there are some plugins like dbstuff that promise to enable you to move data from one environment to another, we’ve often found ourselves doing direct mysqldump of tables to update data from staging to production.
This gets more complicated when you have data and ids that don’t match up in your two databases, or if you need to export this data to third party systems like a newsletter subscriber list. Fortunately, groovy is very good at generating and parsing csv files, and we usually use this mechanism to go from business person -> staging -> production.
Content Migration
One of the bigger problems we always had with go live has been the process of moving content not stored in the database. If everyone is adding content to a database, how do we make sure that the set of data being uploaded to production is up-to-date?
With earlier projects, we would set up a staging machine and have our CMS write to a static directory that we would map using plugins like grails static resources and sync to production via mechanisms like Rsync.
More recently, we had a lot of success using the Amazon S3 Storage mechanism combined with CloudFront. Our CMS uploads our images directly into S3, and this ensures that all our images are available and served directly via our content delivery network. We use the jets3t library for Java and are very happy with it ( Aws plugin hasn’t been written yet ).
Other requirements.
Of course, depending on which business you are in, there are often more requirements that go outside of the typical create a crud screen in grails, add security, ship model. Some other ones I have come across are site speed, social network integration, multi-tenancy and usability testing.
Are there any other tools or business requirements that you often found overlooked by Grails developers? Are there any amazing tools you would like to recommend? Please comment below.
P.S. We’re hiring Grails / Java Developers in London if you are interested in working in these kind of problems at Secret Escapes.
Awesome write up!!
Pingback: Tweets that mention 7 Business Requirements Often Forgotten By Grails Developers | Tomás Lin’s Programming Brain Dump -- Topsy.com
Pingback: 7 Business Requirements Often Forgotten By Grails Developers
Very interesting Tom!! Congratulations for the article! I’ve learnt lots of things reading it.
Thanks Tom – great info here!
Pingback: 5 Gründe warum Grails einfach groovy ist - Dijit
Hi Tomas,
imho all true for developers in general. 🙂
I don’t think forgetting about these requirements is characteristic for *grails* developers.
What is it that makes us different ?
this is probable. I haven’t been any other type of developer to generalize to other languages and frameworks.
Lucky you ! 😉
I for one had wrong expectations from the title of the post. I was expecting something special to grails people.
Maybe you post would receive more traffic without the Grails keyword in the title. It surely is worth a read for a web developers.
cheers
Andreas
Excellent writeup!
I’m working on publishing an Authorize.net CIM plugin for Grails that is PCI compliant. This should address #6 if you want to use Authorize.net
That sounds awesome – but Authorize.net is US and US business only. They don’t like Europeans. But would definitively be a great solution once I get deported. Braintree also offers a nice PCI-DSS Api for the US.
Thanks Tom for this post. I do SEO/SEM jobs and I learned some new points from your post. Makes my work a lot faster and easier.
Brad Fallon
Great write up!
Excellent Tomas.
#5
I didn’t know about chartbeat. I’m looking its website now and looks great.
Do you use its API to gather data and show inside your application?
[]s,
Not for the app we have right now, although that is a good idea. Might be fun to add a few grails app taglibs around this and ship it as a plugin.
Very good post Tomas. Thanks
If possible please comment on the following as I believe these hold true for all grails apps
1. Have any multitenant apps in production using the multitenancy plugin. If you can you share your thoughts – I am having a hard time getting it to work properly.
2. What sort of id/url scheme did you opt for your domain objects
3. Did you ever use fine grained security with your apps and your general tips on this.
Thanks for the same
Bala Thiruppanambakkam
1) nope – but you should ask this in the grails mailing list.
2) depends on your application and SEO needs. Normally your would have a SEO string generated from your domain object name.
3) our applications usually never required this. But the Spring Security and Shiro plugins all offer very good support for this at the permission level. You map permissions to a role and assign these roles to users.
Hi Tomas,
Good post – but on the monitoring front you should be encouraging proactive monitoring rather than reactive “the site is down” behaviour!
On that front, I’ve just posted a blog entry on using jAlarms with Opsview for Grails alerts and plan to share some of my experience on in-depth Grails app monitoring (either at the London GGUG or more blog posts).
Cheers,
Robin
Very true, look forward to hearing what you have to say. The site monitoring really helps us track down issues that might not be in our control ( i.e. ISP being raided by the FBI, etc ).
Hi Tomas,
The start of my series on monitoring Grails apps has now been published:
Cheers,
Robin
Hi Tomas,
I am in Toronto too. I have finished 3 pure Grails web site by my own. Your post has covered all what I have thought. I am really looking for some good SEO plugins for Grails.
Great info on Grails in production, thanks!
Very good post Tomas. Thank you!
I did a huge writeup on SEO compliance mainly for my own purposes but realized others would appreciate all the little tips and tricks and issues i found when going having to implement it. I’m the #5 resource on Google for grails SEO… http://nosegrind.net/post/showpost/39/SEO+Compliance+in+Grails
Was surfing the web and came across this again and wanted to update the link. The site has changed so this link has as well. The new link is http://www.nosegrind.net/?p=85