Re: Multi tenancy : schema vs databases - Mailing list pgsql-general

From Venkata B Nagothi
Subject Re: Multi tenancy : schema vs databases
Date
Msg-id CAEyp7J-ZqiMvVukQUytdYx_d=2Nh6ST9RS+SzZ0nVSzqHYozew@mail.gmail.com
Whole thread Raw
In response to Multi tenancy : schema vs databases  (Rakesh Kumar <rakeshkumar464@outlook.com>)
Responses Re: Multi tenancy : schema vs databases
Re: Multi tenancy : schema vs databases
List pgsql-general

On Fri, Sep 30, 2016 at 5:18 AM, Rakesh Kumar <rakeshkumar464@outlook.com> wrote:

Hi

I would like to know which technique is better for supporting multi-tenancy=
 applications, going upto hundreds or even thousands of tenants.

1 - One database with difference schemas (one schema per tenant)
or
2 - One database per tenant.

Did you mean one database with-in a postgresql cluster ?
 
The points to be considered are:

1 - which is more light weight from resources point of view.
2 - which is easier for backup/restore
3 - Which is better from security p.o.v

A schema per tenant would probably be a good idea to go with. Since, you are saying there could be thousands of tenants, going for single-database-per-tenant could possibly end up in a very bad and complex database design.

One point to consider would be that, how different could be the backup/restore, security or any other database policies for different tenants.


Regards,

Venkata B N
Database Consultant / Architect   

pgsql-general by date:

Previous
From: Vinicius Segalin
Date:
Subject: Re: Query generator
Next
From: David Rowley
Date:
Subject: Re: Parallel query only when EXPLAIN ANALYZEd