Re: Multi tenancy : schema vs databases

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Re: Multi tenancy : schema vs databases
Дата
Msg-id CAMkU=1yPHhGn+cq4C-t8ax9DL62AHwUMWT=mBZN4zYQFy-AirA@mail.gmail.com
обсуждение исходный текст
Ответ на Multi tenancy : schema vs databases  (Rakesh Kumar <rakeshkumar464@outlook.com>)
Ответы Re: Multi tenancy : schema vs databases  (Rakesh Kumar <rakeshkumar464@outlook.com>)
Re: Multi tenancy : schema vs databases  (John R Pierce <pierce@hogranch.com>)
Список pgsql-general
On Thu, Sep 29, 2016 at 12:18 PM, 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.

The points to be considered are:

1 - which is more light weight from resources point of view.

Multiple databases used to be more resource intensive, but that was mostly fixed in 9.3.  Now I don't believe there is all that much difference while running (databases are much more heavy to create in the first place).

As others have said, different databases makes connection pooling less efficient, which could be very important to you, or could be irrelevant.
 
2 - which is easier for backup/restore

That depends on how you want to backup restore.  If you use log archiving, it will make no difference.  If you use sql dumps, then do you want to make it easier or harder to backup and restore all clients together, or all of them separately?  Are you restoring because your whole system failed, or because one client did something wrong and needs just their data rolled back?
 
3 - Which is better from security p.o.v

Any implementation can be done wrong in a way that causes security problems.  Do your clients authenticate directly to the database, or to the app server?

Cheers,

Jeff

В списке pgsql-general по дате отправления:

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: postgres failed to start from services manager on windows 2008 r2
Следующее
От: Rakesh Kumar
Дата:
Сообщение: Re: Multi tenancy : schema vs databases