Multitenant implementation
See original GitHub issueI’m looking at migrating my event sourced / multitenant application to Eventuous. I’ve read through the docs and just want to check if the following is feasible before I dive in:
Each tenant has their own EventStore and database for projections/query models. There are also a few shared projections which are stored in a shared database - this projection would receive events from all tenants and is used for things like listing the tenants etc
My idea is this:
-
Resolve the tenant information on each request (connection strings, etc)
-
Change
builder.Services.AddSingleton(streamNameMap);
tobuilder.Services.AddScoped(streamNameMap);
. Not sure if the CommandService should be / is already scoped to the request.
In order for projections to work, can the ‘global sequence number’ or event number be globally unique/sequential- like using ticks or some other incrementing mechanism?
Regards
Brett
Issue Analytics
- State:
- Created 6 months ago
- Comments:20 (13 by maintainers)
Top GitHub Comments
Ok, the 0.15.0-beta.4 contains the new API. The old API is usable, but marked obsolete. Let me know if it actually help with multi-tenancy, I expect it does.
Let me take a look. I got sidetracked then bogged down in another issue.