Postgresql - one database for all or one database for each client

I am working on a web-based business application where each client will need to have their own data (I think a model like basecamphq.com). For scalability and ease of updates, I would prefer to have one database where each client receives a filtered version of the data. The problem is how to ensure that they remain isolated from their data. An attempt to enforce the code in the code seems to be a disaster, awaiting its appearance. I know that Oracle has a way to add a where clause to each query based on the login id, but does Postgresql have something like this?

If not, is there any other design template that I could use (for example, creating a view of each table for each filter that filters)?

In the worst case, what are the performance / memory overhead due to having 1000 to 100M databases and having one 1Tb database? I will need to provide backup / restore functionality based on each client, which is simple in one database, but rather complicated if they share the database with other clients.

+3
source share
2 answers

You may need to add Veil to your PostgreSQL installation.

+2
source

, , , .

. , .

0

Source: https://habr.com/ru/post/1744878/


All Articles