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

Multi-Tenancy through "TenantId" column in document tables #750

Closed
jeremydmiller opened this Issue May 6, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@jeremydmiller
Contributor

jeremydmiller commented May 6, 2017

Splitting off from #435. A tenancy strategy where all tenants are stored in the same tables, but we use some kind of "tenant id" column to segregate data. You could always just do this yourself as long as you remember to always query by the right tenant id, but it'd be a lot easier if Marten just supported this pattern.

I think this one is straight forward enough that it'll be the first strategy and create the template for acceptance tests.

General Tasks:

  • New tenancy strategy (see #435) for this approach
  • New TenantIdColumn that gets added to the document table when the flag is set
  • Addition to the upsert function logic
  • Verify that you cannot update a document that isn't part of your tenant
  • Need to apply tenant id in upserts
  • Add tenant id to the DocumentMetadata
  • Compiled Queries will have to have some kind of special logic
  • FindJson methods (!)
  • Patching API respects tenancy -- should just be a test at this point
  • Add an index to the tenant id field // cc @mdissel
  • Test bulk inserts -- should already be working, but still needs a test
  • Batch queries

Default where fragment logic on DocumentMapping when it's multi-tenanted

  • Not soft deleted, not hierarchical
  • Soft deleted, not hierarchical
  • Not soft deleted, base type of hierarchy
  • Not soft deleted, leaf type in hierarchy

Filter() logic on DocumentMapping when it's multi-tenanted

  • Not soft deleted, not hierarchical
  • Soft deleted, not hierarchical
  • Not soft deleted, base type of hierarchy
  • Not soft deleted, leaf type in hierarchy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment