0

I'm developing a SAAS Application using a hybrid sharded DB model with EF Core / SQL Server (to be hosted on Azure).

Is it best practice for every entity owned by the tenant to have a shard key (TenantId) or just the root entities.

For instance, a Customer can have multiple Addresses. Is it best practice for both the Customer and the Address have a TenantId or should just the Customer have a TenantId as the Address belongs to the Customer anyway?

My assumption was that every entity should have a shard key to facilitate tenant data migration (split/merge) from one shard to another but I've come across conflicting opinions on this.

NOTE: all entities have Guid Ids.

Any assistance would be appreciated.

Mat

Mat Guthrie
  • 543
  • 1
  • 6
  • 13

0 Answers0