BT

Graeme Rocher on Grails 2.0 and Polyglot Persistence
Recorded at:

Interview with Graeme Rocher by Srini Penchikala on Jan 03, 2012 |
12:24

Bio Graeme Rocher is the Head of Grails Development for SpringSource. He is the co-founder of the Grails web application framework and is a member of the JSR-241 Expert Group which standardizes the Groovy language. Graeme authored the book "Definitive Guide to Grails". Graeme joined SpringSource in late 2008 upon the acquisition of G2One Inc.

JavaOne is all about exploring Java and related technology. From special exhibitions to demos and partner offerings to community networking opportunities, you'll find an endless source of inspiration as you explore JavaOne 2011. JavaOne offers the best Java-focused content, training and networking.

   

1. Hi everyone my name is Srini Penchikala and in this interview we will be speaking with Graeme Rocher. Hi Graeme, can you introduce yourself and tell us what you are currently working on?

Yes, sure, my name is Graeme Rocher, and I work at Spring Source, the division of VMware. I currently lead the Grails project where we are working towards releasing version 2.0 of Grails at the moment.

   

2. What’s coming up in the Grails 2.0 release, what are the new features?

Well, what isn’t coming up? That’s the question. It’s pretty feature packed, we’ve got redesigned interactive mode and console UI output, HTML5 scaffolding, we’ve got GORM really evolving into something more complete, with the touch criteria, where queries migration support multiple data sources support with XA transactions, and not to mention the whole unit testing by mixins. So it is a really fully packed release, on the web side we’ve got new static resource handling, really it’s a whole presentation.

   

3. Yes, sounds like a significant release. Also, at the product and strategy level, there is Spring Roo available for the development frameworks to make it easy. And also Spring Source recently acquired WaveMaker product that’s a UI related framework, and then there is Grails which is also another MVC framework using Groovy language. So how do you see all these three products that have some overlap kind of work together and do you see any changes coming up from a strategy standpoint in the future?

No I think there are different tools, Spring Roo is a build time tool which really helps bootstrap Spring projects, normal Java Spring projects, and get folks who are using those technologies really productive. Whilst Grails on the other hand is more targeted to Groovy developers, it’s based on the Groovy language, it’s a full stack web framework, where it has a runtime component as well, WaveMaker on the other hand is targeted at a different audience of developers. It’s more targeted at the drag and drop UI kind of type developers who are creating business applications very easily, in that sense it’s really a different audience, so we targeted each tool at a distinct audience, and I think that strategy is working well.

   

4. One of your talks at this year’s JavaOne Conference is about polyglot persistence in the cloud. That sounds very interesting topic-wise. Can you tell us what’s the current state of polyglot persistence as a paradigm?

Yes sure so I think as application developers having to deal with increasing scale, there are various challenges in terms of fitting different types of data into relational databases which you know relational databases have many strengths, and they are not going away. They’re fantastic for most use cases, but there are certain use cases which actually fit a different persistence paradigm. The obvious ones are the social graph which fits really well within a graph database, but also any kind of flexible data for example analytics and so on where you need to store a varying number of attributes in a fixed table column structure that doesn’t work too well because the data is flexible one row might have four columns, the next one might have seven columns, and that’s a kind of model where something like Mongo comes into, where you can have flexible data customized the right policies, so you can get really fast writes. So you know there are different solutions solving different kinds of problems, and it’s an interesting space.

   

5. So what should architects or developers who really want to start using a NoSQL data solution, what should they look out for? Because this space is still evolving; it’s kind of new so are there any best practices or gotchas that they should be watching out for?

Absolutely I think you shouldn’t be thinking this is a replacement for my relational database necessarily. You should be thinking at what problems you are facing now and whether those problems could be solved better with an alternative data store. If you have flexible data requirements, where your data is distinct for each row then maybe you want to look at something like Mongo. Or if you need a quick fast navigation across the relationship graph of relationships then maybe something like Neo4j could help you. Or if you need to be sorting and doing a lot of set operation and logic then you need something like Redis can really help because you can store objects in sets and form set operations and calculations extremely faster with Redis much more suited to doing that than a relational database. But you need to understand your particular problem domain, and see if one of these solutions is going to help you out there.

   

6. Like you mentioned earlier, Grails 2.0 supports most of these NoSQL data stores which can also be deployed to the cloud. Can you discuss what are the different options that are available for deploying Grails applications into the cloud?

Sure, so obviously from VMware there is Cloud Foundry which is an exciting technology from our prospective because it’s an open Platform as a Service, in that you can run it anywhere from your local laptop or work machine to your own private infrastructure, or on cloudfoundry.com, and we are anticipating other vendors will be running Cloud Foundry instances. So it’s the first that we feel ready open PaaS that lock you into any particular vendor, but you know there is lots of innovation happening outside VMware in the cloud space and Grails runs very well on things like Amazon EC2, Heroku, Could Bees etc. So yes it’s an exciting time for Grails developers.

   

7. With all these new technologies comes the need for a good tool support for developers. Can you briefly discuss what are the tools available for developing as well as deploying Grails especially into the cloud architecture?

Yes, the tools supported on Grails are maturing nicely over the last year or so, year or two, within Spring Source we are developing the Eclipse support for Grails, which is pretty complete and STS which is the developing environment will support Grails 2, STS 2.8, and then of course IntelliJ are doing a fantastic job for defining a very complete Grails tooling as well, so it’s a much more mature market place at the moment for tooling than it was a few years ago.

   

8. What do you see as emerging trends in general with the cloud application development, and also with Grails applications in particular?

We see a shift towards more stateless web services onto applications parsing JSON or XML style requests and that really being the role of your Grails application with client side JavaScript dealing with parsing and consuming these services that seems to be a significant trend, I think there will always be a place for the regular page by page navigation tile traditional web applications, there’s definitely an on-going trend towards more JavaScript heavy applications, and obviously we’ll be looking at how we can make those work nicely with Grails.

   

9. You mentioned Grails 2.0 features earlier in the interview. Can you share with us any new features that are going to be coming out in Grails 3.0 and beyond?

Yes, so with Grails adoption really continuing to grow and pick up and the applications people developing are maturing at the same time, we’re finding people developing Grails applications are increasingly looking to develop larger and larger applications that need to have different requirements in terms of modularity so we’ll be focusing on modularity a lot in Grails 3 and how we can do multi project builds, how you can structure your application in a modular way, how you can split your application into distinct modules. We already have some support for that in our plugin system that we will be focusing on improving that a lot. We will also be looking at as I said a shift towards REST web services. We already have really good REST support but we’re really looking at improving that in terms of querying and publishing RESTful web services and continuing to improve that area of Grails which is already very good.

   

10. Quick question about Grails 2.0 feature which is asynchronous programming model. You mentioned that in the session. Can you explain a little bit on how it works and how it will help the communication model in developing applications?

Sure, so we have built Grails async support on top of the Servlet 3.0 async spec, which basically allows you to deal with a request in an asynchronous manner so decoupling the connection from the request. We have made sure that in terms of integrated nicely into Grails so that when you for example create an asynchronous request and then dispatch it later on, we do the appropriate binding of the Hibernate session and all the integration that is needed to bind to that asynchronous thread within the application so you’ll never have to worry about how am I going to get Hibernate lazy initialization exception because I have a separate async thread running with this request context. We’ve also made possible to do async view rendering, async writing of binary data and so forth all within the context of a Grails application.

   

11. Sounds like a good lightweight alternative to the regular asynchronous programming model. Thanks for your time Graeme, last question for you is what are your favorite IT and non IT books?

My favorite IT and non IT books? My favorite non IT book I guess is a pretty common choice which is "The Hitchhiker’s Guide to the Galaxy" series. I can’t help laughing at those. They are always entertaining. My favorite IT books are "Java Concurrency in Practice", "Grails in Action" it’s not a book I wrote but it’s very entertaining I recommend that book and of course my book "The Definitive Guide to Grails" I like that one as well of course.

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT