pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedMultitenent architecture
15+ messages / 8 participants
[nested] [flat]
* Multitenent architecture
@ 2020-06-04 15:52 Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 06:37 ` Re: Multitenent architecture Paul Förster <paul.foerster@gmail.com>
2020-06-05 06:57 ` Re: Multitenent architecture Laurenz Albe <laurenz.albe@cybertec.at>
2020-06-10 07:22 ` Re: Multitenent architecture Achilleas Mantzios <achill@matrix.gatewaynet.com>
0 siblings, 3 replies; 15+ messages in thread
From: Vasu Madhineni @ 2020-06-04 15:52 UTC (permalink / raw)
To: pgsql-general
Hi All,
We are planning a POC on multitenant architecture in Postgres, Could you
please help us with steps for multitenant using schema for each application
model.
Thank you so much all.
Regards,
Vasu
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Multitenent architecture
2020-06-04 15:52 Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
@ 2020-06-05 06:37 ` Paul Förster <paul.foerster@gmail.com>
2 siblings, 0 replies; 15+ messages in thread
From: Paul Förster @ 2020-06-05 06:37 UTC (permalink / raw)
To: Vasu Madhineni <vasumdba1515@gmail.com>; +Cc: pgsql-general
Hi Vasu,
> On 04. Jun, 2020, at 17:52, Vasu Madhineni <vasumdba1515@gmail.com> wrote:
> We are planning a POC on multitenant architecture in Postgres, Could you please help us with steps for multitenant using schema for each application model.
look up the docs for "create database" and "create schema":
https://www.postgresql.org/docs/current/sql-createdatabase.html
https://www.postgresql.org/docs/current/sql-createschema.html
PostgreSQL is by definition, what Oracle calls "multi tenant".
Cheers,
Paul
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Multitenent architecture
2020-06-04 15:52 Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
@ 2020-06-05 06:57 ` Laurenz Albe <laurenz.albe@cybertec.at>
2020-06-05 07:48 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2 siblings, 1 reply; 15+ messages in thread
From: Laurenz Albe @ 2020-06-05 06:57 UTC (permalink / raw)
To: Vasu Madhineni <vasumdba1515@gmail.com>; pgsql-general
On Thu, 2020-06-04 at 23:52 +0800, Vasu Madhineni wrote:
> We are planning a POC on multitenant architecture in Postgres, Could you please
> help us with steps for multitenant using schema for each application model.
For few tenants, you can keep identical tables in several schemas and
set "search_path" to select a tenant.
With many tenants, you are better off with one table that holds the
data for all clients. You can use Row Level Security to have each
tenant see only his or her data, and it might be a good idea to
use list partitioning on the tenant ID.
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Multitenent architecture
2020-06-04 15:52 Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 06:57 ` Re: Multitenent architecture Laurenz Albe <laurenz.albe@cybertec.at>
@ 2020-06-05 07:48 ` Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 10:09 ` Re: Multitenent architecture Rob Sargent <robjsargent@gmail.com>
2020-06-05 10:14 ` Re: Multitenent architecture Ravi Krishna <srkrishna@outlook.com>
0 siblings, 2 replies; 15+ messages in thread
From: Vasu Madhineni @ 2020-06-05 07:48 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-general
If the data size is more than 6TB, which approach better?
On Fri, Jun 5, 2020 at 2:57 PM Laurenz Albe <laurenz.albe@cybertec.at>
wrote:
> On Thu, 2020-06-04 at 23:52 +0800, Vasu Madhineni wrote:
> > We are planning a POC on multitenant architecture in Postgres, Could you
> please
> > help us with steps for multitenant using schema for each application
> model.
>
> For few tenants, you can keep identical tables in several schemas and
> set "search_path" to select a tenant.
>
> With many tenants, you are better off with one table that holds the
> data for all clients. You can use Row Level Security to have each
> tenant see only his or her data, and it might be a good idea to
> use list partitioning on the tenant ID.
>
> Yours,
> Laurenz Albe
> --
> Cybertec | https://www.cybertec-postgresql.com
>
>
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Multitenent architecture
2020-06-04 15:52 Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 06:57 ` Re: Multitenent architecture Laurenz Albe <laurenz.albe@cybertec.at>
2020-06-05 07:48 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
@ 2020-06-05 10:09 ` Rob Sargent <robjsargent@gmail.com>
2020-06-06 03:56 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
1 sibling, 1 reply; 15+ messages in thread
From: Rob Sargent @ 2020-06-05 10:09 UTC (permalink / raw)
To: Vasu Madhineni <vasumdba1515@gmail.com>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-general
> On Jun 5, 2020, at 2:54 AM, Vasu Madhineni <vasumdba1515@gmail.com> wrote:
>
>
> If the data size is more than 6TB, which approach better?
>
>> On Fri, Jun 5, 2020 at 2:57 PM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
>> On Thu, 2020-06-04 at 23:52 +0800, Vasu Madhineni wrote:
>> > We are planning a POC on multitenant architecture in Postgres, Could you please
>> > help us with steps for multitenant using schema for each application model.
>>
>> For few tenants, you can keep identical tables in several schemas and
>> set "search_path" to select a tenant.
>>
>> With many tenants, you are better off with one table that holds the
>> data for all clients. You can use Row Level Security to have each
>> tenant see only his or her data, and it might be a good idea to
>> use list partitioning on the tenant ID.
>>
>> Yours,
>> Laurenz Albe
>> --
>> Cybertec | https://www.cybertec-postgresql.com
>>
The question is How many separate data owners?=
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Multitenent architecture
2020-06-04 15:52 Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 06:57 ` Re: Multitenent architecture Laurenz Albe <laurenz.albe@cybertec.at>
2020-06-05 07:48 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 10:09 ` Re: Multitenent architecture Rob Sargent <robjsargent@gmail.com>
@ 2020-06-06 03:56 ` Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-06 04:24 ` Re: Multitenent architecture Rob Sargent <robjsargent@gmail.com>
2020-06-06 17:21 ` Re: Multitenent architecture Michel Pelletier <pelletier.michel@gmail.com>
2020-06-08 06:50 ` Re: Multitenent architecture Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 3 replies; 15+ messages in thread
From: Vasu Madhineni @ 2020-06-06 03:56 UTC (permalink / raw)
To: Rob Sargent <robjsargent@gmail.com>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-general
Hi Rob,
Our environment is medical clinical data, so each clinic as a tenant.
Approximately 500+ tenants with 6TB data.
Thank you in advance.
Regards,
Vasu Madhineni
On Fri, Jun 5, 2020 at 6:09 PM Rob Sargent <robjsargent@gmail.com> wrote:
>
>
> On Jun 5, 2020, at 2:54 AM, Vasu Madhineni <vasumdba1515@gmail.com> wrote:
>
>
> If the data size is more than 6TB, which approach better?
>
> On Fri, Jun 5, 2020 at 2:57 PM Laurenz Albe <laurenz.albe@cybertec.at>
> wrote:
>
>> On Thu, 2020-06-04 at 23:52 +0800, Vasu Madhineni wrote:
>> > We are planning a POC on multitenant architecture in Postgres, Could
>> you please
>> > help us with steps for multitenant using schema for each application
>> model.
>>
>> For few tenants, you can keep identical tables in several schemas and
>> set "search_path" to select a tenant.
>>
>> With many tenants, you are better off with one table that holds the
>> data for all clients. You can use Row Level Security to have each
>> tenant see only his or her data, and it might be a good idea to
>> use list partitioning on the tenant ID.
>>
>> Yours,
>> Laurenz Albe
>> --
>> Cybertec | https://www.cybertec-postgresql.com
>>
>> The question is How many separate data owners?
>
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Multitenent architecture
2020-06-04 15:52 Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 06:57 ` Re: Multitenent architecture Laurenz Albe <laurenz.albe@cybertec.at>
2020-06-05 07:48 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 10:09 ` Re: Multitenent architecture Rob Sargent <robjsargent@gmail.com>
2020-06-06 03:56 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
@ 2020-06-06 04:24 ` Rob Sargent <robjsargent@gmail.com>
2 siblings, 0 replies; 15+ messages in thread
From: Rob Sargent @ 2020-06-06 04:24 UTC (permalink / raw)
To: Vasu Madhineni <vasumdba1515@gmail.com>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-general
> On Jun 5, 2020, at 9:57 PM, Vasu Madhineni <vasumdba1515@gmail.com> wrote:
>
>
> Hi Rob,
>
> Our environment is medical clinical data, so each clinic as a tenant. Approximately 500+ tenants with 6TB data.
> .
How quickly are both those numbers growing? What are your cross clinic query requirements ?
Any single table dominating storage size?
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Multitenent architecture
2020-06-04 15:52 Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 06:57 ` Re: Multitenent architecture Laurenz Albe <laurenz.albe@cybertec.at>
2020-06-05 07:48 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 10:09 ` Re: Multitenent architecture Rob Sargent <robjsargent@gmail.com>
2020-06-06 03:56 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
@ 2020-06-06 17:21 ` Michel Pelletier <pelletier.michel@gmail.com>
2020-06-06 18:28 ` Re: Multitenent architecture Jonathan Strong <jonathanrstrong@gmail.com>
2020-06-08 03:13 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2 siblings, 2 replies; 15+ messages in thread
From: Michel Pelletier @ 2020-06-06 17:21 UTC (permalink / raw)
To: Vasu Madhineni <vasumdba1515@gmail.com>; +Cc: pgsql-general
On Sat, Jun 6, 2020 at 3:14 AM Vasu Madhineni <vasumdba1515@gmail.com>
wrote:
> Hi Rob,
>
> Our environment is medical clinical data, so each clinic as a tenant.
> Approximately 500+ tenants with 6TB data.
>
> Thank you in advance.
>
>
There's a good article on the AWS blog on multi tenancy with postgres:
https://aws.amazon.com/blogs/database/multi-tenant-data-isolation-with-postgresql-row-level-security...
This is similar to Laurenz's second suggestion.
-Michel
> Regards,
> Vasu Madhineni
>
> On Fri, Jun 5, 2020 at 6:09 PM Rob Sargent <robjsargent@gmail.com> wrote:
>
>>
>>
>> On Jun 5, 2020, at 2:54 AM, Vasu Madhineni <vasumdba1515@gmail.com>
>> wrote:
>>
>>
>> If the data size is more than 6TB, which approach better?
>>
>> On Fri, Jun 5, 2020 at 2:57 PM Laurenz Albe <laurenz.albe@cybertec.at>
>> wrote:
>>
>>> On Thu, 2020-06-04 at 23:52 +0800, Vasu Madhineni wrote:
>>> > We are planning a POC on multitenant architecture in Postgres, Could
>>> you please
>>> > help us with steps for multitenant using schema for each application
>>> model.
>>>
>>> For few tenants, you can keep identical tables in several schemas and
>>> set "search_path" to select a tenant.
>>>
>>> With many tenants, you are better off with one table that holds the
>>> data for all clients. You can use Row Level Security to have each
>>> tenant see only his or her data, and it might be a good idea to
>>> use list partitioning on the tenant ID.
>>>
>>> Yours,
>>> Laurenz Albe
>>> --
>>> Cybertec | https://www.cybertec-postgresql.com
>>>
>>> The question is How many separate data owners?
>>
>
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Multitenent architecture
2020-06-04 15:52 Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 06:57 ` Re: Multitenent architecture Laurenz Albe <laurenz.albe@cybertec.at>
2020-06-05 07:48 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 10:09 ` Re: Multitenent architecture Rob Sargent <robjsargent@gmail.com>
2020-06-06 03:56 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-06 17:21 ` Re: Multitenent architecture Michel Pelletier <pelletier.michel@gmail.com>
@ 2020-06-06 18:28 ` Jonathan Strong <jonathanrstrong@gmail.com>
1 sibling, 0 replies; 15+ messages in thread
From: Jonathan Strong @ 2020-06-06 18:28 UTC (permalink / raw)
To: Michel Pelletier <pelletier.michel@gmail.com>; +Cc: Vasu Madhineni <vasumdba1515@gmail.com>; pgsql-general
Hi guys - apologies for jumping into the middle of this, but it touches on
precisely one of the topics I'll have to deal with soon. We're standing up
a pharmacovigilance / drug safety platform managing ICSRs (HL7 "individual
case safety reports" that must be FDA/ICH compliant) and will be dealing
with multi-level privacy and compliance (HIPAA, GDPR, PHI, CCPA, etc.) at
levels such as Patient, Doctor, Pharmacist. This first part deals with
adverse drug events in the "post marketing" realm, i.e., drugs already
approved and in the marketplace. Our model will also expand to support
pre-marketing, i.e., clinical trials and the like.
Far easier to have one coherent data model and tackle compliance as a
multi-tenant / multi-level-secure database issue. We just have to make sure
we do this so it's rock solid and also facilitates the business / use cases
that need to be executed.
I'd love to compare notes with anyone else doing something along those
lines. @Vasu - it sounds like you're smack in the middle of this. Let me
know if you'd be open to connecting and comparing notes on this topic.
(anyone else as well!)
Thanks,
- Jon
On Sat, Jun 6, 2020 at 1:21 PM Michel Pelletier <pelletier.michel@gmail.com>
wrote:
>
> On Sat, Jun 6, 2020 at 3:14 AM Vasu Madhineni <vasumdba1515@gmail.com>
> wrote:
>
>> Hi Rob,
>>
>> Our environment is medical clinical data, so each clinic as a tenant.
>> Approximately 500+ tenants with 6TB data.
>>
>> Thank you in advance.
>>
>>
> There's a good article on the AWS blog on multi tenancy with postgres:
>
>
> https://aws.amazon.com/blogs/database/multi-tenant-data-isolation-with-postgresql-row-level-security...
>
> This is similar to Laurenz's second suggestion.
>
> -Michel
>
>
>> Regards,
>> Vasu Madhineni
>>
>> On Fri, Jun 5, 2020 at 6:09 PM Rob Sargent <robjsargent@gmail.com> wrote:
>>
>>>
>>>
>>> On Jun 5, 2020, at 2:54 AM, Vasu Madhineni <vasumdba1515@gmail.com>
>>> wrote:
>>>
>>>
>>> If the data size is more than 6TB, which approach better?
>>>
>>> On Fri, Jun 5, 2020 at 2:57 PM Laurenz Albe <laurenz.albe@cybertec.at>
>>> wrote:
>>>
>>>> On Thu, 2020-06-04 at 23:52 +0800, Vasu Madhineni wrote:
>>>> > We are planning a POC on multitenant architecture in Postgres, Could
>>>> you please
>>>> > help us with steps for multitenant using schema for each application
>>>> model.
>>>>
>>>> For few tenants, you can keep identical tables in several schemas and
>>>> set "search_path" to select a tenant.
>>>>
>>>> With many tenants, you are better off with one table that holds the
>>>> data for all clients. You can use Row Level Security to have each
>>>> tenant see only his or her data, and it might be a good idea to
>>>> use list partitioning on the tenant ID.
>>>>
>>>> Yours,
>>>> Laurenz Albe
>>>> --
>>>> Cybertec | https://www.cybertec-postgresql.com
>>>>
>>>> The question is How many separate data owners?
>>>
>>
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Multitenent architecture
2020-06-04 15:52 Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 06:57 ` Re: Multitenent architecture Laurenz Albe <laurenz.albe@cybertec.at>
2020-06-05 07:48 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 10:09 ` Re: Multitenent architecture Rob Sargent <robjsargent@gmail.com>
2020-06-06 03:56 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-06 17:21 ` Re: Multitenent architecture Michel Pelletier <pelletier.michel@gmail.com>
@ 2020-06-08 03:13 ` Vasu Madhineni <vasumdba1515@gmail.com>
1 sibling, 0 replies; 15+ messages in thread
From: Vasu Madhineni @ 2020-06-08 03:13 UTC (permalink / raw)
To: Michel Pelletier <pelletier.michel@gmail.com>; +Cc: pgsql-general
Hi All,
Thanks a lot for information, I will look into it and get back to you.
Regards,
Vasu Madhineni
On Sun, Jun 7, 2020 at 1:21 AM Michel Pelletier <pelletier.michel@gmail.com>
wrote:
>
> On Sat, Jun 6, 2020 at 3:14 AM Vasu Madhineni <vasumdba1515@gmail.com>
> wrote:
>
>> Hi Rob,
>>
>> Our environment is medical clinical data, so each clinic as a tenant.
>> Approximately 500+ tenants with 6TB data.
>>
>> Thank you in advance.
>>
>>
> There's a good article on the AWS blog on multi tenancy with postgres:
>
>
> https://aws.amazon.com/blogs/database/multi-tenant-data-isolation-with-postgresql-row-level-security...
>
> This is similar to Laurenz's second suggestion.
>
> -Michel
>
>
>> Regards,
>> Vasu Madhineni
>>
>> On Fri, Jun 5, 2020 at 6:09 PM Rob Sargent <robjsargent@gmail.com> wrote:
>>
>>>
>>>
>>> On Jun 5, 2020, at 2:54 AM, Vasu Madhineni <vasumdba1515@gmail.com>
>>> wrote:
>>>
>>>
>>> If the data size is more than 6TB, which approach better?
>>>
>>> On Fri, Jun 5, 2020 at 2:57 PM Laurenz Albe <laurenz.albe@cybertec.at>
>>> wrote:
>>>
>>>> On Thu, 2020-06-04 at 23:52 +0800, Vasu Madhineni wrote:
>>>> > We are planning a POC on multitenant architecture in Postgres, Could
>>>> you please
>>>> > help us with steps for multitenant using schema for each application
>>>> model.
>>>>
>>>> For few tenants, you can keep identical tables in several schemas and
>>>> set "search_path" to select a tenant.
>>>>
>>>> With many tenants, you are better off with one table that holds the
>>>> data for all clients. You can use Row Level Security to have each
>>>> tenant see only his or her data, and it might be a good idea to
>>>> use list partitioning on the tenant ID.
>>>>
>>>> Yours,
>>>> Laurenz Albe
>>>> --
>>>> Cybertec | https://www.cybertec-postgresql.com
>>>>
>>>> The question is How many separate data owners?
>>>
>>
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Multitenent architecture
2020-06-04 15:52 Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 06:57 ` Re: Multitenent architecture Laurenz Albe <laurenz.albe@cybertec.at>
2020-06-05 07:48 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 10:09 ` Re: Multitenent architecture Rob Sargent <robjsargent@gmail.com>
2020-06-06 03:56 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
@ 2020-06-08 06:50 ` Laurenz Albe <laurenz.albe@cybertec.at>
2020-07-21 07:35 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2 siblings, 1 reply; 15+ messages in thread
From: Laurenz Albe @ 2020-06-08 06:50 UTC (permalink / raw)
To: Vasu Madhineni <vasumdba1515@gmail.com>; Rob Sargent <robjsargent@gmail.com>; +Cc: pgsql-general
On Sat, 2020-06-06 at 11:56 +0800, Vasu Madhineni wrote:
> > > On Fri, Jun 5, 2020 at 2:57 PM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
> > > > On Thu, 2020-06-04 at 23:52 +0800, Vasu Madhineni wrote:
> > > > > We are planning a POC on multitenant architecture in Postgres, Could you please
> > > > > help us with steps for multitenant using schema for each application model.
> > > >
> > > > For few tenants, you can keep identical tables in several schemas and
> > > > set "search_path" to select a tenant.
> > > >
> > > > With many tenants, you are better off with one table that holds the
> > > > data for all clients. You can use Row Level Security to have each
> > > > tenant see only his or her data, and it might be a good idea to
> > > > use list partitioning on the tenant ID.
>
> Our environment is medical clinical data, so each clinic as a tenant.
> Approximately 500+ tenants with 6TB data.
The important number to base this decision on would be the number of
tables you'd expect in the database. It shouldn't be too many.
If the database grows large, you may be better off sharding the database
together with partitioning it across schemas.
Several smaller databases are easier to back up and make scaling easier.
Of course that requires your application to be part of the solution:
it needs to know which database to use for which tenant.
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Multitenent architecture
2020-06-04 15:52 Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 06:57 ` Re: Multitenent architecture Laurenz Albe <laurenz.albe@cybertec.at>
2020-06-05 07:48 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 10:09 ` Re: Multitenent architecture Rob Sargent <robjsargent@gmail.com>
2020-06-06 03:56 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-08 06:50 ` Re: Multitenent architecture Laurenz Albe <laurenz.albe@cybertec.at>
@ 2020-07-21 07:35 ` Vasu Madhineni <vasumdba1515@gmail.com>
2020-07-21 18:13 ` Re: Multitenent architecture Michel Pelletier <pelletier.michel@gmail.com>
0 siblings, 1 reply; 15+ messages in thread
From: Vasu Madhineni @ 2020-07-21 07:35 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Rob Sargent <robjsargent@gmail.com>; pgsql-general
Hi All,
Our project uses each database for tenant, But how can we restrict
tenant resources?
Ex: Tenent1 has to use 20% resource and Tenent2 has to use 10% resource,
how can we restrict users like this.
Thanks and Regards,
Vasu Madhineni
On Mon, Jun 8, 2020 at 2:50 PM Laurenz Albe <laurenz.albe@cybertec.at>
wrote:
> On Sat, 2020-06-06 at 11:56 +0800, Vasu Madhineni wrote:
> > > > On Fri, Jun 5, 2020 at 2:57 PM Laurenz Albe <
> laurenz.albe@cybertec.at> wrote:
> > > > > On Thu, 2020-06-04 at 23:52 +0800, Vasu Madhineni wrote:
> > > > > > We are planning a POC on multitenant architecture in Postgres,
> Could you please
> > > > > > help us with steps for multitenant using schema for each
> application model.
> > > > >
> > > > > For few tenants, you can keep identical tables in several schemas
> and
> > > > > set "search_path" to select a tenant.
> > > > >
> > > > > With many tenants, you are better off with one table that holds the
> > > > > data for all clients. You can use Row Level Security to have each
> > > > > tenant see only his or her data, and it might be a good idea to
> > > > > use list partitioning on the tenant ID.
> >
> > Our environment is medical clinical data, so each clinic as a tenant.
> > Approximately 500+ tenants with 6TB data.
>
> The important number to base this decision on would be the number of
> tables you'd expect in the database. It shouldn't be too many.
>
> If the database grows large, you may be better off sharding the database
> together with partitioning it across schemas.
> Several smaller databases are easier to back up and make scaling easier.
>
> Of course that requires your application to be part of the solution:
> it needs to know which database to use for which tenant.
>
> Yours,
> Laurenz Albe
> --
> Cybertec | https://www.cybertec-postgresql.com
>
>
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Multitenent architecture
2020-06-04 15:52 Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 06:57 ` Re: Multitenent architecture Laurenz Albe <laurenz.albe@cybertec.at>
2020-06-05 07:48 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 10:09 ` Re: Multitenent architecture Rob Sargent <robjsargent@gmail.com>
2020-06-06 03:56 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-08 06:50 ` Re: Multitenent architecture Laurenz Albe <laurenz.albe@cybertec.at>
2020-07-21 07:35 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
@ 2020-07-21 18:13 ` Michel Pelletier <pelletier.michel@gmail.com>
0 siblings, 0 replies; 15+ messages in thread
From: Michel Pelletier @ 2020-07-21 18:13 UTC (permalink / raw)
To: Vasu Madhineni <vasumdba1515@gmail.com>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; Rob Sargent <robjsargent@gmail.com>; pgsql-general
On Tue, Jul 21, 2020 at 7:47 AM Vasu Madhineni <vasumdba1515@gmail.com>
wrote:
> Hi All,
>
> Our project uses each database for tenant, But how can we restrict
> tenant resources?
> Ex: Tenent1 has to use 20% resource and Tenent2 has to use 10% resource,
> how can we restrict users like this.
>
See https://wiki.postgresql.org/wiki/Priorities
-Michel
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Multitenent architecture
2020-06-04 15:52 Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 06:57 ` Re: Multitenent architecture Laurenz Albe <laurenz.albe@cybertec.at>
2020-06-05 07:48 ` Re: Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
@ 2020-06-05 10:14 ` Ravi Krishna <srkrishna@outlook.com>
1 sibling, 0 replies; 15+ messages in thread
From: Ravi Krishna @ 2020-06-05 10:14 UTC (permalink / raw)
To: Vasu Madhineni <vasumdba1515@gmail.com>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-general
>
> If the data size is more than 6TB, which approach better?
Do you require cross tenants queries? If yes, then schemas are a better solution.
^ permalink raw reply [nested|flat] 15+ messages in thread
* Re: Multitenent architecture
2020-06-04 15:52 Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
@ 2020-06-10 07:22 ` Achilleas Mantzios <achill@matrix.gatewaynet.com>
2 siblings, 0 replies; 15+ messages in thread
From: Achilleas Mantzios @ 2020-06-10 07:22 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On 4/6/20 6:52 μ.μ., Vasu Madhineni wrote:
> Hi All,
>
> We are planning a POC on multitenant architecture in Postgres, Could you please help us with steps for multitenant using schema for each application model.
Hello,
you may benefit from this blog post :
https://severalnines.com/database-blog/multitenancy-options-postgresql
>
> Thank you so much all.
>
> Regards,
> Vasu
--
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt
^ permalink raw reply [nested|flat] 15+ messages in thread
end of thread, other threads:[~2020-07-21 18:13 UTC | newest]
Thread overview: 15+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04 15:52 Multitenent architecture Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 06:37 ` Paul Förster <paul.foerster@gmail.com>
2020-06-05 06:57 ` Laurenz Albe <laurenz.albe@cybertec.at>
2020-06-05 07:48 ` Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-05 10:09 ` Rob Sargent <robjsargent@gmail.com>
2020-06-06 03:56 ` Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-06 04:24 ` Rob Sargent <robjsargent@gmail.com>
2020-06-06 17:21 ` Michel Pelletier <pelletier.michel@gmail.com>
2020-06-06 18:28 ` Jonathan Strong <jonathanrstrong@gmail.com>
2020-06-08 03:13 ` Vasu Madhineni <vasumdba1515@gmail.com>
2020-06-08 06:50 ` Laurenz Albe <laurenz.albe@cybertec.at>
2020-07-21 07:35 ` Vasu Madhineni <vasumdba1515@gmail.com>
2020-07-21 18:13 ` Michel Pelletier <pelletier.michel@gmail.com>
2020-06-05 10:14 ` Ravi Krishna <srkrishna@outlook.com>
2020-06-10 07:22 ` Achilleas Mantzios <achill@matrix.gatewaynet.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox