Re: pg_attribute, pg_class, pg_depend grow huge in count and sizewith multiple tenants. - Mailing list pgsql-performance

From Rory Campbell-Lange
Subject Re: pg_attribute, pg_class, pg_depend grow huge in count and sizewith multiple tenants.
Date
Msg-id 20200507210846.GA17040@campbell-lange.net
Whole thread Raw
In response to Re: pg_attribute, pg_class, pg_depend grow huge in count and sizewith multiple tenants.  (Avinash Kumar <avinash.vallarapu@gmail.com>)
Responses Re: pg_attribute, pg_class, pg_depend grow huge in count and sizewith multiple tenants.  (Avinash Kumar <avinash.vallarapu@gmail.com>)
List pgsql-performance
On 07/05/20, Avinash Kumar (avinash.vallarapu@gmail.com) wrote:
> >> Our application serves multiple tenants. Each tenant has the schema
> >> with a few hundreds of tables and few functions.
> >> We have 2000 clients so we have to create 2000 schemas in a single
> >> database.

> > That is one option but I wouldn't say you must.  If you cannot get
> > individual tables to be multi-tenant you are probably better off having one
> > database per client on a shared cluster - at least given the size of the
> > schema and number of clients.
> >
> I am working on a similar problem.
> 1 database per each client may be a killer when you have a connection
> pooler that creates a pool for a unique combination of (user,database).

One of our clusters has well over 500 databases fronted by pg_bouncer.

We get excellent connection "flattening" using pg_bouncer with
per-database connection spikes dealt with through a reserve pool.

The nice thing about separate databases is that it is easy to scale
horizontally.

Rory



pgsql-performance by date:

Previous
From: Avinash Kumar
Date:
Subject: Re: pg_attribute, pg_class, pg_depend grow huge in count and sizewith multiple tenants.
Next
From: Avinash Kumar
Date:
Subject: Re: pg_attribute, pg_class, pg_depend grow huge in count and sizewith multiple tenants.