ninja
ninja copied to clipboard
can you give one Multiple datasources example
Maybe my solution can help you. It also uses HikariCP to setup connection pools for each of the database source.
https://github.com/miketeo/ninja-multidb-demo
Hey Mike, that looks really cool!
We were experimenting with the following approach: https://github.com/ninjaframework/ninja-db Do you think it would make sense to add your approach as part of ninja-db?
Jpa is missing there...
@raphaelbauer : ninja-db looks interesting. The JPA mechanism used in the current ninja framework is sufficient for common use cases. ninja-db will empower the developer to use ninja framework for more complex requirements.
I have another demo (https://github.com/miketeo/ninja-multitenantdb-demo) which demonstrates using Ninja framework to support multi-tenant databases. Should be pretty useful for those who are looking to develop SaaS platforms using Ninja.
I will look into ninja-db over the next few weeks. On the first look, I have yet to figure out where to implement database transactions in the current ninja-db architecture.
@miketeo hi Which is better, your multi-tenancy or ninja-db?
I don't think ninja-db supports multi-tenancy out-of-the-box, although you can use the same schema across multiple datasources to create a similar multi-tenancy result. But you might still need to come up with a solution to deal with the issue of dynamically adding and removing datasources from the "tenancy" list.