Skip to content
Boris Zaikin edited this page Feb 15, 2018 · 4 revisions

Architecture Scaling/Multi-tenancy types:

  • Horizontal Scaling (Multiple databases) - Each tenant contain his own database/shard
  • Vertical Scaling - One database could contain several tenants

Current example has N-Tire architecture:

  • Presentation layer (Web Api),
  • Service Layer (contains all business logic),
  • Data access layer, based on UnitOfWork and Repository patterns, as ORM was select Entity Framework Core.

The key component of tenant separation is **ContextFactory **it contains logic to parse the tenant id from HTTP header, retrieve tenant database name (using DataBaseManager), replace database name in connection string and finally create database context (EF context)

The diagram below demonstrate this architecture.

Complete article can be found Here

Clone this wiki locally