Hey, man awsome content! do you mind telling where to learn about postgres multitenancy? a client recently asked me to have his data separate from the main database i use for everyone and im confused on how to do this.
Hey, thanks for sharing your feedback! Does the client just want to ensure his data is not visible to other clients, or has the client explicitly asked to segregate his data into separate database tables? Overall, consider these options: 1. Shared tables for clients. All customer data is stored in the same tables, but there is a special column such as "tenant_id" that lets you filter out one client's data from another's. You need to set up row-level security to ensure that when an application requests data belonging to tenant_id=5, the data of other tenants won't be visible. 2.Schema per client. Each client has his own set of tables stored in a client-specific schema (CREATE SCHEMA client1, CREATE SCHEMA client2, etc.). The application needs to specify the schema while querying or updating data of a specific client - "select balance from client5.account" or "select balance from client100.account". Distributed Postgres is useful for multi-tenant use cases if you expect to have many tenants and will need to scale. It's also useful if you need to pin each tenant's/client's data to a specific location (zone, region, database server).
Hey, man awsome content! do you mind telling where to learn about postgres multitenancy? a client recently asked me to have his data separate from the main database i use for everyone and im confused on how to do this.
Hey, thanks for sharing your feedback!
Does the client just want to ensure his data is not visible to other clients, or has the client explicitly asked to segregate his data into separate database tables?
Overall, consider these options:
1. Shared tables for clients. All customer data is stored in the same tables, but there is a special column such as "tenant_id" that lets you filter out one client's data from another's. You need to set up row-level security to ensure that when an application requests data belonging to tenant_id=5, the data of other tenants won't be visible.
2.Schema per client. Each client has his own set of tables stored in a client-specific schema (CREATE SCHEMA client1, CREATE SCHEMA client2, etc.). The application needs to specify the schema while querying or updating data of a specific client - "select balance from client5.account" or "select balance from client100.account".
Distributed Postgres is useful for multi-tenant use cases if you expect to have many tenants and will need to scale. It's also useful if you need to pin each tenant's/client's data to a specific location (zone, region, database server).
Denis is a legend!!!!! 😂. Slow and understandable!
Thanks! Let’s learn it slow and gradually:)
Awesome content, loved the videos! Thanks so much
Thanks for watching and sharing feedback! That matters a lot to me.
Promo'SM
Why are your pupils so HUGE!?
So that I can hypnotize you