• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Grails for scaleable social networking applications

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm looking at writing some applications for facebook. I've come up with a few things, and dozens of ideas, however I'm not sure that grails is the way to go. A recent inquiry into a web hosting company said that grails would require 1 gig of memory over the standard 256 mb (for struts based java apps) due to the additional memory requirements of grails.

As my goal is to make these applications for social networking sites, I want to make them as scaleable as possible. In my best case scenarios my apps become "fads" and can be accessed by as many as a million people a day. Have you addressed any memory requirements in this book? What about scaling?

Also, I'm not sure if I should post this in another thread (to maximize my chance of winning ), but to keep from cluttering up the forum I'll ask this here
Conversely, how do you feel about the productivity gains from using the scaffolding of grails vs something like Maven?
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jason Mayer wrote:Conversely, how do you feel about the productivity gains from using the scaffolding of grails vs something like Maven?



How are scaffolding and Maven related? As far as I know, they do two different things.
 
Jason Mayer
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just played with Maven for the first time this past weekend, so bear with me if I misspoke. It appears to me that Maven allows you to build projects and all the dependencies with very little set up allowing you to create a base 'project' and spin off variants from there. I'm not entirely sure how the scaffolding of grails would be different. Am I completely misunderstanding what scaffolding is supposed to bring to the table or should I have read page 3 of the 'Make a Struts 2 app with Maven in 5 minutes' article?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Grails Scaffolding is explained here. It is different than setting and building a project. Grails does this also, but it isn't done using scaffolding.
 
Author
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jason,

I replied to a similar query about Grails memory consumption in an earlier thread, so I will refer you there first of all:

https://coderanch.com/t/440898/Groovy/Grails-memory-usage

One approach you could take, especially if you have specific metrics that you are aiming for in terms of performance, is to build a bare bones application in Grails, test the heck out of it, and if you find performance issues either fix them or revert back to an approach you feel more comfortable with.

The benefits to this approach are that you should be able to build the application incredibly quickly in Grails and focus on the logic of the application, rather than getting bogged down in the mundane aspects of web development. You may even find that Grails performs perfectly adequately for the applications you need to build.

Now, on the developer productivity point, Gregg is correct is that Grails scaffolding is a separate from the convention based approach to compiling and packaging applications that Grails and Maven share. Scaffolding is a mechanism that generates an entire user interface given only a domain class.

The developer productivity gains that come with Grails are more from the reduction in the amount of code that you need to write to build your application. Less code == less time to build == less bugs to fix. Let me explain what I mean by developer productivity:



In less than 30 lines of code I have created a domain class to represent messages and three actions that will save a message to my database, show a list of messages and allow users to view a message by name. There is no configuration required to map the Message class to the database, there is no configuration to expose the three actions: save, list and view. They will be available on the following URLs:
  • http://localhost:8080/<app_name>/message/save
  • http://localhost:8080/<app_name>/message/list
  • http://localhost:8080/<app_name>/message/view


  • I have also not had to implemented the list and findByTitle methods on the Message class.

    Even though this example is trivially simple, consider how long it would take to implement this functionality in your current web framework, from scratch.

    Cheers,
    Jon
     
    There’s no place like 127.0.0.1. But I'll always remember this tiny ad:
    Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
    https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!