All, Basically read a lot of material last night and made some progress. This is basically a multi tenant application with isolation at the database level. The entities and the DAO's will always remain same and behave in the same manner for all clients/tenants.
I was able to successfully store multiple database configurations in yml file, load them up and store in a Hash map, with key as tenant id and value as the datasource. The obstacle still remains is to how to pass the correct datasource or session factory to the DAO ( i am getting the tenant id in the resource and a pre request filter ). Thanks On Thursday, 9 February 2017 12:04:17 UTC+5:30, Vaibhav Dhawan wrote: > > Hi All, > > I am building up a SaaS application in which the database call goes > through a set of Dropwizard services. The database structure is such that > each client wants to have a separate database located on different servers > altogether. However each of them will have same table structure, schema > names etc. > > The dropwizard services use hibernate to connect to the database. Assuming > i define all these database configurations in .yml file, is there a way i > can dynamically pick up the datasource on basis of the input coming in the > request (i will get a client id in my request). > > If not, i will have to deploy/start multiple set of dropwizard services > and expect the ui layer to do the dynamic routing part. However with this > approach the management of these services will be cumbersome. > > Help is appreciated. > > Thanks > -- You received this message because you are subscribed to the Google Groups "dropwizard-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
