Closed fernyettheplant closed 11 months ago
@fernyettheplant
What you are describing here is still just 4 separate tenants, naming them this way does not make them part of the same tenant. I believe what you want is database per tenant.
EventStore-Tenant01 Projection-Tenant01 EventStore-Tenant02 Projection-Tenant02
With database per tenant you would do:
Tenant01 (with containers EventStore and Projection) Tenant02 (with containers EventStore and Projection)
However to achieve your goal by extending CosmosTemplate and overriding getContainerNameOverride like below, adding "containerName + ".
Closing due to inactivity.
Is your feature request related to a problem? Please describe.
I'm working at the moment to enable multi-tenancy capabilities to a Java Project with CosmosDB and we were planning to go tenant per container. Our project requires that a single tenant is owner of multiple containers but i have not found yet any example on how to enable it for such nor the capabilities to append the tenant instead of just having a single container per tenant
However, we need to be able to do something like this:
Describe the solution you'd like
I was checking the changes introduced in https://github.com/Azure/azure-sdk-for-java/pull/33400 and one improvement that would solve this problem is to allow the method
overrideContainerName
inCosmosFactory
to pass the original container name so it can be manipulated where the tenant id can be appended.An example of the usage would be like this:
Describe alternatives you've considered
I was thinking on implement something similar from the ground up using the Azure CosmosDB SDK to allow this but honestly Spring Data solves this issue relatively easy,
Additional context
The only issue that i see with this proposition is that it would introduce breaking changes
Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report