Introduction to multi tenant applications¶
What are multi tenant apps?¶
Multi tenant applications allow you to serve multiple customers with one install of the application. Each customer has their data completely isolated in such an architecture. Each customer is called a tenant.
Most modern Software as a Service applications are multi tenant. Whether it is Salesforce, Freshbooks, Zoho or Wordpress, most modern cloud based applications are delivered with a multi-tenant architecture.
The structure of this book¶
In this book we will take a single tenant application and re-architect it to be a multi tenant application. We will use a slightly modified Django polls app as our base.
There are multiple approaches for multi tenancy. We will look at the four most common ones.
The various approached to multi tenancy¶
- Shared database with shared schema
- Shared database with isolated schema
- Isolated database with a shared app server
- Completely isolated tenants using Docker
Completely isolated tenants using Docker¶
A new set of docker containers are launched for each tenant. Every tenant’s data is in a separate database (which may or may not be running in container). A set of containers identifies the tenant.
In the next four chapters, we will look at each architecture in turn. Let’s get started.