Skip to content

Could namastack be used in multi-tenancy scenarios with multiple datasources? #278

Description

@jjank

Hi there!

thanks for creating namastack - it looks very promising and we are strongly considering it for an upcoming project!

The project however has to handle multitenancy with both a tenant-id in the entities and multiple datasources. We cannot change this unfortunately. Also we have to use JPA (Hibernate to be specific) because there's company-internal libraries that give us some abstraction (basically an implementation of AbstractRoutingDatasource)

There are 2 questions that unfold from there regarding namastack:

  1. Regarding the tenant-id attribute: Considering this hibernate forum answer it could be possbile to set up a custom orm.xml and configure/modify the entities in namastack-jpa such that an additional column annotated with @TenantId is respected.
  2. This seems more difficult: Could we extend/configure namastack such that the scheduled processing of outbox records would (for lack of a better word) "span" across all available datasources? From my understanding we'd need a collection of N OutboxProcessingScheduler instances that are assigned to the N available Datasources. Or is that something that a custom implementation of OutboxRecordRepository could/should do?

Thanks for your thoughts!

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestquestionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions