• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Best way to implement Multi-tenancy

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
any comments?
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Start at the beggining.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are any number of ways to do it; which one is best in your situation depends on the circumstances about which we know nothing. Maybe you can ask a more specific question.
 
Bharat Kasodariya
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, I have developed ERP app in Vaadin+Hibernate. Now I want to put multitenancy support without major change in existing code.
Like for the authentication support people can use spring security kind of framework.So is there any api which I can plugin in to the app?
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bharat Kasodariya wrote:Actually, I have developed ERP app in Vaadin+Hibernate. Now I want to put multitenancy support without major change in existing code.
Like for the authentication support people can use spring security kind of framework.So is there any api which I can plugin in to the app?



Multitenancy is a feature of an application -- meaning it is at the application layer. Applications need to be designed, and then implemented / ported to be that way. You can't just take an application, configure a security feature and be done,

You *do* need to make sure that users are authenticated (as you mentioned)... but... You also need to make sure that these authenticated users don't see each other's data. You need to make sure that the users requests don't step on each other requests. And finally, you need to be able to monitor (and maintain) the response time SLAs.


As an analogy, it is like trying to convert a mansion into a hotel. You can't do it just by adding a security guard and a check-in desk.

Henry
 
Bharat Kasodariya
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Henrik,

I agreed its application layer related change. I just asked because I thought may be some one might have seen such type of api.
If it is available then can get some new thought but if it is not then we have to add by our own implementation.

you might have heard about Athena framework which really has this feature.
http://www.athenasource.org/java/multitenancy-tutorial.php?part=1
http://www.athenasource.org/java/videoguide/TutorialJavaEmpDir.htm
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bharat Kasodariya wrote:
you might have heard about Athena framework which really has this feature.


From their docs:

Athena Framework is a full fledged enterprise object-relational mapping (ORM) framework



So the question really is, do you use any ORM frameworks in your application? If yes, is it Athena?

Athena can only handle multi-tenancy at the ORM level. You just cant use Athena or any such framework randomly in your application and expect it to handle multi-tenancy. Your application will also have to be designed to handle multi-tenancy at various other levels in the application. So like Henry said, there's no magic API or solution to do that. Each layer of your application has to be designed to handle multi-tenancy.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By the way, it's always good to be forthright about having asked the same question in some other forum https://community.jboss.org/message/746386#746386. That way, volunteers in either forum can decide whether its worth spending time on a possibly answered question.
 
Bharat Kasodariya
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks All.
I needed it at data level for viewing data as per user. I have used hibernate as an ORM. I tried it by using global filter feature of hibernate. It seems ok with it.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bharat Kasodariya wrote:I have used hibernate as an ORM.



These articles and a webinar might help then:

http://in.relation.to/Bloggers/MultitenancyInHibernate
https://community.jboss.org/wiki/Multi-tenancyDesign
http://vimeo.com/20296211
 
Bharat Kasodariya
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jaikiran
 
Bharat Kasodariya
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
implemented it by using hibernate filter.
reply
    Bookmark Topic Watch Topic
  • New Topic