Particular / docs.particular.net

All content for ParticularDocs
https://docs.particular.net
Other
103 stars 301 forks source link

Feedback: 'Multi-tenant endpoints' #2941

Closed SimonCropp closed 7 years ago

SimonCropp commented 7 years ago

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?

SzymonPobiega commented 7 years ago

Yeah, it makes sense. It is not NH-specific.

SzymonPobiega commented 7 years ago

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?

SimonCropp commented 7 years ago

@SzymonPobiega i can find no flaws in your plan

SzymonPobiega commented 7 years ago

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.

weralabaj commented 7 years ago

@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?

SzymonPobiega commented 7 years ago

@weralabaj yeah. But not sure if this is maintainer type of discussion or plat-dev one. I mean, supporting multiple catalogs.

weralabaj commented 7 years ago

@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?

SzymonPobiega commented 7 years ago

@weralabaj Sounds good.

weralabaj commented 7 years ago

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?

SimonCropp commented 7 years ago

Lgtm