Grails:一个数据库和多个应用程序 [英] Grails: One Database and more than one application

查看:94
本文介绍了Grails:一个数据库和多个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用基于Grails GORM的应用程序。一个Web服务和一个网站都在不同的端口上运行,并共享通用数据库和表。

我所做的是为这两个应用程序创建的域类具有相同的字段和域名类别。例如注册表用户名密码字段。一个可以通过Web服务注册,也可以从网站注册。

我目前的应用程序工作正常......但这是一个可行的解决方案..?

I am having Grails GORM based application.One web service and one website both are running on different port and sharing common database and tables.
What i have done is created domain class for both application which are having same fields and domain class name.For example Registration table having userName and password fields.One can register through web service and also from website.
My current applications is working fine...but is it a feasible solution..?

谢谢,

病毒

Thanks,
Viral

推荐答案

您可能会遇到种族/锁定状况,但我已经多次看到这种情况。我唯一的建议是你不维护单独的域类。将常见域类放入插件中,并在两个应用程序中安装该插件。

You could run into race/locking conditions but I've seen this done on many occasions. My only suggestion is that you not maintain separate domain classes. Put common domain classes in a plugin and install said plugin in both applications.

我见过的另一种模仿您的方法的常见方法是部署面向客户的应用程序,管理员/厘米。两者都与同一个数据库交谈,他们只是运行在不同的tomcat实例中。

Another common approach I've seen that mimics your approach is deploying a customer facing app separate from the admin/cms. Both talk to the same database, they're just running in different tomcat instances.

这篇关于Grails:一个数据库和多个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆