abpframework / abpframework/abp
Support multi-tenant multi-database for outbox and inbox patterns for the distributed event bus
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 14.4k
- Forks
- 3.7k
- Avg merge
- 15h 32m
- Merged PRs (30d)
- 106
Description
https://github.com/abpframework/abp/pull/10008 adds inbox & outbox patterns to the distributed event bus. However, it doesn't support multi-tenancy with a tenant has a dedicated database. We don't support it since it is not feasible. To make inbox/outbox consistent, we should save the message within the same database that is related to the event publishing/handling logic. The essential problem is in the background thread that publishes/processes outbox/inbox events. If we have thousands of databases, it would be a real problem to read events from these databases and publish/process. Also, we should dynamically re-arrange background worker threads for new created or deleted tenants.
That's really complicated. For a reference, the CAP library doesn't support this scenario (https://github.com/dotnetcore/CAP/issues/699). It also doesn't support multiple db scenario (https://github.com/dotnetcore/CAP/issues/998), but ABP supports it currently, so it works good for a modular system where each module has its own db.
I am opening a backlog item. I could not find a system that scales for multi-db multi-tenant scenario, but we may implement a limited solution where it works with low number of different tenant database but can't work as performant with high number of databases ( I don't know how many is low and high yet :) ).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing PR #10008 and the linked CAP issues to understand the existing inbox/outbox behavior and known multi-database limitations. Define a bounded solution for tenant-specific databases, including how background processing handles tenant creation and deletion; the issue does not yet specify a performance threshold or implementation entry point.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend, databases, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100