Home Grails Multi-Tenancy with Multiple Databases
Reply: 1

Grails Multi-Tenancy with Multiple Databases

renz Published in 2015-09-03 07:27:34Z

I can't seem to find any updated resource/guide, plugin or example about Grails Multitenancy with Multiple Databases (one per tenant). I'm currently stuck with https://grails.org/plugin/multi-tenant-single-db and the outdated https://grails.org/plugin/multi-tenant-core.

How to perform database switching that depends on the logged-in user?

Community Reply to 2017-05-23 11:48:43Z

Grails abstracts out a lot of Hibernate stuff so there is an impedance mismatch between Gorm and Hibernate. One such problem is loading of multiple datasources based on tenant. If you go tenant per DB strategy, be prepared for a hard battle. Apart from complexity involved, there is a long way going forward as DB maintenance is quite costly in this strategy. Most modern applications use Single DB Single Schema approach and I've also used this approach in my plugin. Currently this plugin resolves tenant using Spring Security. The reason for this approach was the application I was working on which was a SaaS app to be served from a single domain. If you have to serve from multiple domains, there is minor modification required in this plugin.

Regarding migration to grails3,it was released in March 2015 and over the period of one year, it has gone through various improvements and bug fixes. It is stable enough to rely on and moreover it has almost all necessary plugins already ported. If you are building a new application, you must go the grails3 way. If you have an existing application, you can consider migrating to grails3.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.356289 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO