Tenant

  • Any customer that you sign up to use your SaaS environment is one of the tenants of your system.
  • The sum total of all the customers using your SaaS environment are the tenants.
  • Each tenant pays for access to the SaaS application by paying a subscription fee.
  • Tenants are distinct from users.
  • Multiple users from a single organization, company, or group form a single tenant.
  • ref: https://learn.microsoft.com/en-us/azure/architecture/guide/multitenant/overview

Considerations

  • What exactly is tenant for you? A customer, user or a group of user (like team)
    • For example, a music streaming service might support both individual users and families.
  • What commercial pricing models will your solution offer, and how will your pricing models affect your multitenancy requirements?
  • Do any of your tenants have unusual or special requirements?
    • For example, biggest customer need higher performance/stronger guarantees than others

Multi-tenant models

  • Have an identity service which then can be used in requests to identify you
  • For each customer, we can have:
    • separate services or single service?
    • separate databases or single database with tenantId as filter?
  • Implications:
    • Security: Be careful not to access data from one tenant when you return response to another
    • Cost: Shared is more cost effective
    • Performance: Shared is less performant
    • Reliability: Shared can cause single point of failure for all tenants

tenancy-models

What is Azure elastic pool? https://learn.microsoft.com/en-us/azure/azure-sql/database/elastic-pool-overview?view=azuresql