views:

907

answers:

5

I'm looking to make a website that will probably get some heavy, repetitive traffic. Is grails up to the task?

+6  A: 

The scalability of your web application won't really depend on what language/framework you choose to use, but rather how your application is built. You can build a scalable web application in Grails, just as you can build an incredibly slow application in C++. If Grails is the framework you would like to use, then use it; you can always rewrite the slow parts in Java or another fast language, if need be. (After all, that's what Twitter did with Scala.)


Disclaimer: I've never actually used Grails.

musicfreak
Twitter used Schala. http://www.artima.com/scalazine/articles/twitter_on_scala.html. Still JVM though.
GmonC
Well, I was referring more to the fact that they rewrote part of it in a faster language. In the end, the actual language doesn't matter though, as long as it's "fast enough". I don't think it would have made much of a difference for them if it had been Java.
musicfreak
I agree, that's why I said it can be in JVM because in this particular case, in the end it doesn't matter - like you said. I would edit your post just to add this small clarification (is still interesting to point out exactly what they did to avoid future misconceptions), but I dont have enough reputation.
GmonC
+5  A: 

Grails is essentially a thin layer on top of the Spring Framework, which many consider to be a very scalable framework in the enterprise world. Spring + Hibernate has become a standard in many Java shops around the globe.

If you run into performance bottlenecks in Groovy, you can always rewrite those parts in Java.

Take a look at the Success Stories for examples of sites that were written in Grails. The Testamonials are also a good place to look for examples. You will use a little more memory(heap and permgen) than a vanilla Java app, but you can tune it just like you would any other Java application.

On the low end you aren't going to find $3/month Hosting options that you could with PHP stack (for example). That said, there are some good caching solutions for Grails apps EhCache, MemCache, etc. Beyond that you can also setup an Apache layer to caches static resources or whatever you need.

Colin Harrington
+9  A: 

I agree with lael, also because it's built on java technologies there are a lot of proven clustering and 'enterprisey' tools available which allow you to easily scale across multiple application services.

The cloud tools around Grails are also becoming very good and make deploying to a cloud like EC2 very easy. I've recently been using Cloud Foundry and found it very good.

As the first poster points out however, you can write a badly performing application in any framework/language. One thing I'd recommend is getting a good understanding of Hibernate which is the underlying persistence library. If you understand how that works, it should help you avoid making any silly mistakes at the DB level. On this side of things, a tool like p6spy is great for checking what the database is up to during normal use. It should help you spot any repetitive queries.

leebutts
A: 

Grails run on the JVM. Simply put, you will not find a more scalable, solid and robust runtime platform than the JVM, anywhere. That's Grails's big advantage over, say, PHP or RoR.

skaffman
+1  A: 

Don't mean to pile on here. You've already got some great answers but I just want to add on thing that I was reminded of recently. Scalability depends not only on the software you write (regardless of language/framework) but also on the deployment environment. A very well written application deployed on an undersized or poorly configured server will not scale at all. If you do use Grails or any other Java based framework, the default settings on your container (Tomcat, JBoss, etc.) will probably not be what you need.

Just something to keep in mind, Dave

Dave Klein