|
Hi group, im about to get a job as a grails developer is a small project, and im just six month experience but there is an escenario that is not totaly clear for me is about frontend and backend plus api restfull, what is the best prcatice to have ordered this.
thanks |
|
Hi Chichibek,
I'm not sure what your question is about - can you clarify? Essentially Grails is very suitable for both frontend, and a restful backend to feed that frontend. Cheers, Antony On 16 July 2012 21:11, chichibek bros <[hidden email]> wrote: > Hi group, im about to get a job as a grails developer is a small project, > and im just six month experience but there is an escenario that is not > totaly clear for me is about frontend and backend plus api restfull, what is > the best prcatice to have ordered this. > > thanks -- ________________________________ ꜽ . antony jones . http://www.enzy.org --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
Thanks Antony, my question is if i want keep separated frontend actions from backend actions and API actions. What is the best practice to get this.
2012/7/16 Antony Jones <[hidden email]> Hi Chichibek, |
|
Hi,
on my current project, we setup the following:
Not sure this is the best practice, but at least this gives a central plugin for common code (like model and helpers/utils) I still need to configure cache properly, because you'll run pretty fast into invalid state/dirty model objects issues.
So I'm also open to advice if there is a better way to handle separated frontend/backend projects. Eric On Mon, Jul 16, 2012 at 11:18 PM, chichibek bros <[hidden email]> wrote: Thanks Antony, my question is if i want keep separated frontend actions from backend actions and API actions. What is the best practice to get this. |
|
In reply to this post by chichibek bros
How Abou thee different grails apps? Thats how we are doing here... lucas On Jul 16, 2012 6:19 PM, "chichibek bros" <[hidden email]> wrote:
Thanks Antony, my question is if i want keep separated frontend actions from backend actions and API actions. What is the best practice to get this. |
|
In reply to this post by chichibek bros
I wrote a blog post about how to do this awhile back. It's a little dated, but should still be valid:
http://www.bobbywarner.com/2011/06/21/grails-setup Hope that helps! Bobby |
|
In reply to this post by lucastex
backend expose the API using REST? Then why not create a Javascript app using JavaScriptMVC framework?
I think at the beginning, there is no need to separate the app. If you really want to separate the front-end and backend, simply put the business logics into services and define the API carefully.
In the controllers, call Services to get/edit/add the data, then display the views. On Mon, Jul 16, 2012 at 5:26 PM, Lucas F. A. Teixeira <[hidden email]> wrote:
|
|
In reply to this post by bobbywarner
Should be careful with Hibernate Secondary cache problem.
On Mon, Jul 16, 2012 at 5:32 PM, bobbywarner <[hidden email]> wrote: I wrote a blog post about how to do this awhile back. It's a little dated, |
|
thanks for your answer, this a very common question among friends we are a small group learning grails, here there are several solutions but what do you thing is the best.
2012/7/16 Gavin Yue <[hidden email]> Should be careful with Hibernate Secondary cache problem. |
|
Gavin Yue wrote: Should be careful with Hibernate Secondary cache problem. I would be interested in references on how to properly setup hibernate with multiple application relying on the same data model :D Eric On Mon, Jul 16, 2012 at 11:39 PM, chichibek bros <[hidden email]> wrote: thanks for your answer, this a very common question among friends we are a small group learning grails, here there are several solutions but what do you thing is the best. |
|
In reply to this post by chichibek bros
If you want to scale in the future, the simple way is clustering. But when you use clustering, the problem will arise in several places, like session sharing, hibernate secondary cache and/or quartz.
Burt has a ppt here :
http://burtbeckwith.com/blog/files/238/Clustering.A.Grails.Application.For.Scalability.And.Availability.pdf
Hibernate cache do increase the performance, but also cause the problem in distributed environment. If you use ehcache, here is one tutorial http://www.informit.com/guides/content.aspx?g=java&seqNum=628
If you want to use memcache, use this plugin: http://grails.org/plugin/memcached/ And the good part is that you could amazon elasticache services which is memcache.
My suggestion would be put all the data-related operations in the Services and expose them through REST. So this becomes One App, call it ServiceApp. All other APPs, like WebApp, MobileApp and/or TouchUIApp, access the data only through the ServiceAPP using REST.
If you want to scale, simply cluster ServiceAPP. The easiest way should be Amazon BeanStalk + ElastiCache.
On Mon, Jul 16, 2012 at 5:39 PM, chichibek bros <[hidden email]> wrote: thanks for your answer, this a very common question among friends we are a small group learning grails, here there are several solutions but what do you thing is the best. |
|
thanks Gavin Yue, so the best way is one project for each access i mean a project for web, a project for mobile, and a project for the shared api
2012/7/16 Gavin Yue <[hidden email]> If you want to scale in the future, the simple way is clustering. But when you use clustering, the problem will arise in several places, like session sharing, hibernate secondary cache and/or quartz. |
|
In reply to this post by xmly
Architecturally, I agree. A core service-app exposing functionality vai REST scales well. Cuts wayyy down (can eliminate even) any need to do session clustering.
Is Grails really the best choice for that kind of app (an app doing only REST servicing)? Maybe something like spring-core with a JAX-RS implementation might have less cruft? I have not done *any* REST work in Grails yet, so the above really is a question (not an opinion). I did a REST project with Spring and JAX-RS (Jersey) and found it pretty good. - Gary On Jul 16, 2012, at 2:57 PM, Gavin Yue wrote: > If you want to scale in the future, the simple way is clustering. But when you use clustering, the problem will arise in several places, like session sharing, hibernate secondary cache and/or quartz. > Burt has a ppt here : http://burtbeckwith.com/blog/files/238/Clustering.A.Grails.Application.For.Scalability.And.Availability.pdf > > Hibernate cache do increase the performance, but also cause the problem in distributed environment. > If you use ehcache, here is one tutorial http://www.informit.com/guides/content.aspx?g=java&seqNum=628 > > If you want to use memcache, use this plugin: http://grails.org/plugin/memcached/ And the good part is that you could amazon elasticache services which is memcache. > > My suggestion would be put all the data-related operations in the Services and expose them through REST. So this becomes One App, call it ServiceApp. > All other APPs, like WebApp, MobileApp and/or TouchUIApp, access the data only through the ServiceAPP using REST. > > If you want to scale, simply cluster ServiceAPP. The easiest way should be Amazon BeanStalk + ElastiCache. > > > > > > On Mon, Jul 16, 2012 at 5:39 PM, chichibek bros <[hidden email]> wrote: > thanks for your answer, this a very common question among friends we are a small group learning grails, here there are several solutions but what do you thing is the best. > > > 2012/7/16 Gavin Yue <[hidden email]> > Should be careful with Hibernate Secondary cache problem. > > On Mon, Jul 16, 2012 at 5:32 PM, bobbywarner <[hidden email]> wrote: > I wrote a blog post about how to do this awhile back. It's a little dated, > but should still be valid: > > http://www.bobbywarner.com/2011/06/21/grails-setup > > > Hope that helps! > Bobby > > -- > View this message in context: http://grails.1312388.n4.nabble.com/Frontend-backend-best-solution-in-grails-tp4631604p4631615.html > Sent from the Grails - user mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
| Powered by Nabble | Edit this page |
