Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create MassTransit background services for database-per-tenant multi-tenant applications. #81

Open
mgernand opened this issue Jan 2, 2023 · 1 comment
Assignees

Comments

@mgernand
Copy link
Contributor

mgernand commented Jan 2, 2023

MassTransit offers built in background services: InboxCleanupService and BusOutboxDeliveryService.

When using a single database, every message to be sent using the outbox is stored in the database using the same transaction the application uses. This way the messages are not delivered to the broker when an error occurrs, or the transaction is rolled-back manually.

This works fine when using a single database, even with multi-tenancy enabled using a discriminator column in every table.

💣 Enter multi-tenancy with a database-per-tenant. 💣

Different tenants will use different transactions and different databases; or even whole different database systems/servers.

The built-in cleanup and outbox delivery background services can not be used in this use case. We need background services that clean and publish messages for every known tenant, because those services need to access different databases or even different database systems/servers.

The services need to access a tenant database (abstracting this used a provider servcice). The tenant information received must contain everything needed to iterate every tenant (maybe make it horizotally scalable) and eecute the login of the existing background services InboxCleanupService and BusOutboxDeliveryService.

@mgernand mgernand changed the title Create MassTransit background services for dataper-per-tenant multi-tenant applications. Create MassTransit background services for database-per-tenant multi-tenant applications. Jan 17, 2023
@mgernand mgernand self-assigned this Apr 25, 2023
@mgernand
Copy link
Contributor Author

This issue will not be implemented in the open source project. If one needs to use this too, please contact us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant