Chapter 1: Introduction

What is Multi-Tenancy?

Understanding the fundamental concept of multi-tenancy - how cloud providers serve multiple customers on shared infrastructure.

What is Multi-Tenancy?

Multi-tenancy is one of the defining characteristics of cloud computing. Let's understand what it means and why it's so important.

Definition

Multi-tenancy is a software architecture where a single instance of software serves multiple customers (tenants). Each tenant's data is isolated and invisible to other tenants.

The Apartment Building Analogy

Think of multi-tenancy like an apartment building:

┌─────────────────────────────────────┐
│        CLOUD APARTMENT BUILDING     │
├─────────┬─────────┬─────────────────┤
│ Apt 301 │ Apt 302 │ Apt 303         │  ← Tenants
│ Tenant A│ Tenant B│ Tenant C        │
├─────────┼─────────┼─────────────────┤
│ Apt 201 │ Apt 202 │ Apt 203         │
│ Tenant D│ Tenant E│ Tenant F        │
├─────────┴─────────┴─────────────────┤
│  Shared: Elevator, Lobby, Plumbing  │  ← Infrastructure
│  Roof, Foundation, Electricity      │
└─────────────────────────────────────┘
  • Each tenant has their own private space
  • Infrastructure is shared (more efficient)
  • Building management ensures isolation
  • Costs are split among tenants

Single-Tenant vs Multi-Tenant

Single-Tenant Architecture

Each customer gets dedicated infrastructure:

Customer A              Customer B              Customer C
┌─────────────┐        ┌─────────────┐        ┌─────────────┐
│   App       │        │   App       │        │   App       │
│   Database  │        │   Database  │        │   Database  │
│   Server    │        │   Server    │        │   Server    │
└─────────────┘        └─────────────┘        └─────────────┘
   Server 1               Server 2               Server 3

Pros:

  • Complete isolation
  • Custom configurations
  • Predictable performance

Cons:

  • Expensive (dedicated resources)
  • Inefficient resource utilization
  • Complex to manage at scale

Multi-Tenant Architecture

Multiple customers share infrastructure:

┌─────────────────────────────────────────────┐
│              Shared Application              │
├─────────┬─────────┬─────────────────────────┤
│Tenant A │Tenant B │Tenant C                  │
│  Data   │  Data   │  Data                    │  (Isolated)
├─────────┴─────────┴─────────────────────────┤
│              Shared Database                 │
├─────────────────────────────────────────────┤
│              Shared Server                   │
└─────────────────────────────────────────────┘

Pros:

  • Cost-efficient (shared resources)
  • Easier to maintain and update
  • Scales better
  • Better resource utilization

Cons:

  • "Noisy neighbor" potential
  • Security complexity
  • Compliance challenges

Tenant Definition

A "tenant" can be:

  • A company: Acme Corp, TechStartup Inc
  • A team: Engineering team, Marketing team
  • A project: Project Alpha, Project Beta
  • A user: Individual developers

The tenant boundary is defined by the service provider.

Multi-Tenancy Spectrum

Multi-tenancy exists on a spectrum from fully shared to fully isolated:

Fully Shared                          Fully Isolated
     │                                      │
     ▼                                      ▼
┌────────────────────────────────────────────┐
│ Shared │ Shared │ Shared │ Dedic. │ Dedic. │
│  App   │   DB   │  Infra │   VM   │  HW    │
│        │        │        │        │        │
│  SaaS  │  PaaS  │  IaaS  │ Private│  Colo  │
└────────────────────────────────────────────┘
   Most                            Least
   Efficient                       Efficient

Real-World Examples

SaaS Multi-Tenancy (High Sharing)

Gmail, Salesforce, Slack

  • Same application for all users
  • Data separated by account/organization
  • Shared compute, storage, network

IaaS Multi-Tenancy (Lower Sharing)

AWS EC2, Google Compute, Azure VMs

  • Shared physical servers (hypervisors)
  • Dedicated virtual machines per tenant
  • Shared network infrastructure

Hybrid Approaches

Kubernetes Namespaces

  • Shared cluster infrastructure
  • Isolated namespaces per tenant
  • Configurable resource quotas

Why Do Providers Use Multi-Tenancy?

1. Economics

Traditional Model:
100 customers × $10,000/server = $1,000,000 infrastructure cost

Multi-Tenant Model:
100 customers ÷ 10 per server × $10,000/server = $100,000 infrastructure cost

2. Operational Efficiency

  • One codebase to maintain
  • One system to monitor
  • Updates benefit all tenants
  • Centralized security

3. Resource Utilization

Most workloads don't use 100% of allocated resources:

Without Multi-Tenancy:
┌─────────────────────┐
│ Server (100% cost)  │
│ ████░░░░░░ (40% used)│
└─────────────────────┘

With Multi-Tenancy:
┌─────────────────────┐
│ Server (shared cost)│
│ █████████░ (90% used)│
└─────────────────────┘

Tenant Isolation Requirements

For multi-tenancy to work, the system must guarantee:

  1. Data Isolation - Tenant A cannot see Tenant B's data
  2. Performance Isolation - Tenant A's load shouldn't affect Tenant B
  3. Security Isolation - Compromising Tenant A shouldn't expose Tenant B
  4. Configuration Isolation - Tenants can customize without affecting others

The Trust Model

Multi-tenancy requires trust in the provider:

┌─────────────────────────────────────────┐
│                Provider                  │
│  ┌─────────┐                            │
│  │ Tenant A│ ──── Trusts Provider ────┐ │
│  └─────────┘                          │ │
│  ┌─────────┐                          │ │
│  │ Tenant B│ ──── Trusts Provider ────┤ │
│  └─────────┘                          │ │
│  ┌─────────┐                          │ │
│  │ Tenant C│ ──── Trusts Provider ────┘ │
│  └─────────┘                            │
│                                         │
│  Provider ensures tenants don't see     │
│  each other's data                      │
└─────────────────────────────────────────┘

What's Next?

Now that you understand what multi-tenancy is, let's dive into the different isolation models in the next chapter.