Skip to main content

Multi Tenant Solution

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2009-03-06

I have a working web service written in Java 6 using JPA and very little EJB.
The application today does not support multi tenant. Today we support it by creating multiple glassfish domain which is not scalable and hard to setup, upgrade and monitor.

I'm looking for a way to turn our service into multi tenant web service. As far as I understand this relate to our database design, JPA usage, authentication, caching and maybe more.

I would like to use single database with shared schema and discriminator column in multi tenant tables (not all tables are multi tenant). As far as I understand it is not possible to use discriminator column JPA provider yet. Both EclipseLink and Hibernate support it but not via JPA.

I will start with simple user-to-tenant mapping of having each user map to a single tenant. This means I will have to have a security module that use my user database table to perform authentication and will later use the authenticated user to choose the current tenant ID.

Glassfish 4 is plan to have multi tenant support built-in. What can I do today to best use the built-in abilities in the near future?
What other things I've miss about multi tenant infrastructure?

Thank you,