@saduqz
Apartments like a perfect example of a multi-tenant architecture
Single-Tenant Multi-Tenant
Software as a Service
Total costs are shared by multiple tenants sharing the application
A schema can be seen as a directory in an operating system, each directory (schema) with it's own set of files (tables and objects). This allows the same table name and objects to be used in different schemas without conflict. For an accurate description on schemas, see PostgreSQL’s official documentation on schemas.
1. Isolated Approach: Separate Databases. Each tenant has its own database.
2. Semi-Isolated Approach: Shared Database, Separate Schemas. One database for all tenants, but one schema per tenant.
3. Shared Approach: Shared Database, Shared Schema. All tenants share the same database and schema. There is a main tenant-table, where all other tables have a foreign key pointing to.