在Seam中使用单实例多租户Web应用程序的经验?

时间:2021-12-08 19:57:49

Any experiences with Seam in a one-instance multi-tenant setup? Is Seam suited for that setup? How did you realise it? What were the costs involved?

在单实例多租户设置中使用Seam的任何经验? Seam适合那种设置吗?你是怎么认识到的?涉及的费用是多少?

Our situation: A Seam 2.1 SaaS web-app (POJO, no EJB). Available development budget forced us towards a simplistic one-instance per tenant design. The application is not in production yet but nearly finished.

我们的情况:Seam 2.1 SaaS Web应用程序(POJO,没有EJB)。可用的开发预算迫使我们采用简单的单租户设计实例。该应用程序尚未投入生产,但已接近完成。

I expect our customer might reconsider a one-instance multi-tenant setup if it lowers the projected hosting costs.

我希望如果降低预计的托管成本,我们的客户可能会重新考虑单实例多租户设置。

2 个解决方案

#1


We've developed a multi-tenant SaaS application with Seam. I don't think that Seam has any advantages or disadvantages for this sort of thing.

我们使用Seam开发了一个多租户SaaS应用程序。我不认为Seam对这类事情有任何优点或缺点。

The only piece of functionality that is possibly useful are Hibernate Filters (eg. have a company id on every table and set a hibernate filter for it). Means every query will have this ID automatically appended.

唯一可能有用的功能是Hibernate过滤器(例如,在每个表上都有一个公司ID,并为它设置一个休眠过滤器)。表示每个查询都会自动附加此ID。

#2


I have a class called User, and it has as it's members all of that users data. So, there's a one to many relationship from User to Task, for instance. Then my query for all of a users tasks is simply: select task from Task task, User user where user.id = #{user.id} and task member of user.taskList. I could also have used filters as another has mentioned. However, since the #{user} object is created on log in, it's available via Seams parsing of the EL string. Quite handy. So, while there is nothing in Seam to support multi-tenant, it's fairly easy to do.

我有一个名为User的类,它拥有所有用户数据的成员。因此,例如,从用户到任务有一对多的关系。然后我对所有用户任务的查询就是:从任务任务中选择任务,用户用户,其中user.id =#{user.id}和user.taskList的任务成员。我也可以像其他人提到的那样使用过滤器。但是,由于#{user}对象是在登录时创建的,因此可以通过Seams解析EL字符串来使用它。非常方便。因此,虽然Seam中没有任何东西可以支持多租户,但这很容易实现。

#1


We've developed a multi-tenant SaaS application with Seam. I don't think that Seam has any advantages or disadvantages for this sort of thing.

我们使用Seam开发了一个多租户SaaS应用程序。我不认为Seam对这类事情有任何优点或缺点。

The only piece of functionality that is possibly useful are Hibernate Filters (eg. have a company id on every table and set a hibernate filter for it). Means every query will have this ID automatically appended.

唯一可能有用的功能是Hibernate过滤器(例如,在每个表上都有一个公司ID,并为它设置一个休眠过滤器)。表示每个查询都会自动附加此ID。

#2


I have a class called User, and it has as it's members all of that users data. So, there's a one to many relationship from User to Task, for instance. Then my query for all of a users tasks is simply: select task from Task task, User user where user.id = #{user.id} and task member of user.taskList. I could also have used filters as another has mentioned. However, since the #{user} object is created on log in, it's available via Seams parsing of the EL string. Quite handy. So, while there is nothing in Seam to support multi-tenant, it's fairly easy to do.

我有一个名为User的类,它拥有所有用户数据的成员。因此,例如,从用户到任务有一对多的关系。然后我对所有用户任务的查询就是:从任务任务中选择任务,用户用户,其中user.id =#{user.id}和user.taskList的任务成员。我也可以像其他人提到的那样使用过滤器。但是,由于#{user}对象是在登录时创建的,因此可以通过Seams解析EL字符串来使用它。非常方便。因此,虽然Seam中没有任何东西可以支持多租户,但这很容易实现。