Multi-database support #271
Replies: 4 comments 1 reply
-
I would like to help. I will download the code and check how could be implemented and give a proposal. |
Beta Was this translation helpful? Give feedback.
-
I like this idea, I think we could support this using the factory that you have mentioned, we could allow a tenant ID for example to pull a specific database. I think the main decision we'd have to make is how this support would work. There are two options I think we can either supporting multiple databases under the same cosmos DB account (with the same connection string). Then we can just provide a discriminator to use containers from one database vs another. The other option for more isolated multi-tenant applications would be multiple accounts support, which would be much harder. I also think this begs the question around the design of a multi tenant application. For example it might be better in that case to deploy a backend instance of the app per tenant. Then have some upstream service figure out which backed to call. There are many options to this second point. I feel it might be a little out of scope for the library. Multiple databases under the same cosmos DB account however I think would be a nice addition. I think the point in where we could branch to filter databases given a tenant key would be around here. We could almost have a |
Beta Was this translation helpful? Give feedback.
-
Hi @IEvangelist, I think your suggestion of allowing options to be passed along with the Also thanks for your time in creating this SDK for the community. It really makes implementing basic CRUD for cosmos super easy. |
Beta Was this translation helpful? Give feedback.
-
any update on this ? |
Beta Was this translation helpful? Give feedback.
-
Derived from #19:
Currently the library only supports a single database. To add multiple database support, we should first discuss all the implications, potential pitfalls, the best approach, the desired consumer patterns, and design an API that is simple.
Considerations:
IRepositoryFactory
be used?RepositoryOptions.DatabaseId
options?Beta Was this translation helpful? Give feedback.
All reactions