Closed SimonCropp closed 7 years ago
Yeah, it makes sense. It is not NH-specific.
I've reviewed the current code and it has an issue with outbox cleaner. The cleaner is run outside of message context so it is going to be executed on the "shared" database which does not have the outbox. Boom 💥
Current version of SqlPersistence does not allow for customized catalogs per message but I think the smallest thing we can do is allow to override the catalog for outbox storage. This was we can:
The result will be that the sagas and user data will live in tentant's catalogs while outbox, timeouts and subscriptions will be shared. The limitation here is that this approach cannot span database servers but I think this is fair. If somebody needs more than one SQL Server instance she/he can surely afford having an endpoint-per-database-instance.
@Particular/sqlpersistence-maintainers thoughts?
@SzymonPobiega i can find no flaws in your plan
Reviewed the SqlPersistence code once again and it seems like "just adding option to specify catalog" is not going to work as not every DB engine has the concept of catalog and, even if they do, it can mean different things: https://stackoverflow.com/questions/7942520/relationship-between-catalog-schema-user-and-database-instance
I think this has to wait till we solve this problem with SqlPersistence.
@SzymonPobiega is it possible then that only some dbs will support it, e.g. sql server? should we discuss among maintainers what to do about it?
@weralabaj yeah. But not sure if this is maintainer type of discussion or plat-dev one. I mean, supporting multiple catalogs.
@SzymonPobiega I propose we discuss it as maintainers first, to come up with a good description, and then if we think it's necessary present the problem as a decision to make in plat dev. Thoughts?
@weralabaj Sounds good.
We synced today about the multi-catalog support for SQL Persistence, I'll open a new issue in Plat Dev as we'd need some breaking changes.
I think this issue can be closed, because there's no way to update the sample without this feature.
@SimonCropp @SzymonPobiega OK?
Lgtm
Feedback for 'Multi-tenant endpoints' https://docs.particular.net/samples/outbox/multi-tenant/
Location in GitHub: https://github.com/Particular/docs.particular.net/blob/master/samples/outbox/multi-tenant/sample.md
ping @Particular/nhibernate-persistence-maintainers @Particular/sqlpersistence-maintainers @Particular/sqlserver-transport-maintainers
should this be converted to the sql persistence?