Repository navigation
Replies: 1 comment 1 reply
|
The proposed solution might work for smaller datasets but if you're migrating lots of streams this might not be the ideal approach. Something like this: storeOptions.Events.MergeTenants("SourceTenantId", "DestinationTenantId");The resulting WHERE clause for any query to either tenant would be: WHERE tenant_id IN ('SourceTenantId', 'DestinationTenantId') |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I work for a company FooBar. FooBar has 3 departments
Department1Department2Department3They all have to create
Foo.Foois a SingleStreamAggregation that is multitenanted. It has the usual events:FooCreatedDomainEventFooUpdatedDomainEventFoo....All is good, departments can't view each other's
Foodata, but there's still the possibility for certain cross tenant business logic.Now the higherups have decided they need to get rid of
Department1. They want to fuseDepartment1withDepartment3.This means that all
Foodata needs to be transferred toDepartment3with the history of events being intact.I would like to suggest the following:
Perhaps even provide a bulk action method?
This method will take the events and stream records of streamid
fooToMigrate.Id, migrate it to the new tenant and based on projection type maybe even rebuild theFoodocument projection offooToMigrate.Id.There's ofcourse still the issue of the event being used in other projections and what to do with those.
Imho I think it's a business decision to make sure these projections are also migrated to the correct tenant.
It would also be nice to link this to an event for example a
FooMigratedDomainEvent: IMigrationTrigger, this way we can also add it as an event to the stream itself.I would like to start a discussion regarding the possible issues and solutions to this. I think it's a relevant enough feature that may occur in real life.
The following is a hacky DO ON YOUR OWN RISK work around on migrating streams to another tenant. Only for
TenancyStyle.ConjoinedYOU HAVE BEEN WARNED!
All reactions