Multi Tenant APP with Play framework 1.2.4

254 views
Skip to first unread message

Gp P

unread,
Jun 20, 2012, 10:27:40 PM6/20/12
to play-fr...@googlegroups.com
Hi Players ,

I am building a multi tetatnt app with playframework , but has run into some major hurdles 

  1. How add multi tenant Database support
    1. Hibernate Filters : Add customer ID to model and use Hyber nate filters -> http://www.lunatech-research.com/archives/2011/03/04/play-framework-writing-multitenancy-application-hibernate-filters
      1. Pro : if you model has customer identifier that its easy
      2. Cons : Need to add identifier 
    2. Separate DB for each client : Dont know if possible in play , read somewhere there was functionality to support but vanished play 1.2.4, please suggest
    3. Separate Schema same database : Can play support it , from what I have heard requires Hibernate 4, please suggest
  2. How separate template for each client, boils down to specify template and tag path for view rendering 
    1.  RenderTemplate in Controller 
    2. How to specify tag path for specific clent , I not referring to custom java tags like fast tag but normal tags in tags folder, please suggest

Please advice me on above issues , It will help me to make multi tenant app

Thanks ,
Gp
 

--
B the Change

Gp P

unread,
Jun 21, 2012, 10:37:28 PM6/21/12
to play-fr...@googlegroups.com
Hi Guys ,

Any solution to below or I am/Devs with multi tenant needs are better of with more matured frameworks like Spring ?

Thanks ,
Gp
--
B the Change

notalifeform

unread,
Jun 22, 2012, 2:55:04 AM6/22/12
to play-fr...@googlegroups.com
Hi,

We're doing multi-tenant stuff, here's my 2 cents


On Thursday, June 21, 2012 4:27:40 AM UTC+2, Gp wrote:
Hi Players ,

I am building a multi tetatnt app with playframework , but has run into some major hurdles 

  1. How add multi tenant Database support
    1. Hibernate Filters : Add customer ID to model and use Hyber nate filters -> http://www.lunatech-research.com/archives/2011/03/04/play-framework-writing-multitenancy-application-hibernate-filters
      1. Pro : if you model has customer identifier that its easy
      2. Cons : Need to add identifier
we also added an identifier, but are not using hibernate filters; the reason is that we sometimes need to do stuff that covers multiple tenants (trading stuff) - I'm afraid that it will make our code hard to read, since it will behave differently based on the fact if the filter-object was set or not. It does mean  though that we have to take extra care to read the "right" data.

      1.  
    1. Separate DB for each client : Dont know if possible in play , read somewhere there was functionality to support but vanished play 1.2.4, please suggest
there has been a play 1.1 multidb module, but was never properly ported to 1.2 - so it is currently not support. afaik the multi-db support was put in the trunk, but didn't make it to the play 1.2.4 release - see 
    1. Separate Schema same database : Can play support it , from what I have heard requires Hibernate 4, please suggest
from what I heard play 1.3 will have hibernate4. Play 1.3 is supposed to be released quite quick after 1.2.5 (July?) 
  1. How separate template for each client, boils down to specify template and tag path for view rendering 
    1.  RenderTemplate in Controller 
we created a custom template-loader that takes care of loading the right templates (with fallback)
    1. How to specify tag path for specific clent , I not referring to custom java tags like fast tag but normal tags in tags folder, please suggest
hm.. we didn't look into this one - we only use global tags..
 

HTH


Robert
Reply all
Reply to author
Forward
0 new messages