toluaina / pgsync

Postgres to Elasticsearch/OpenSearch sync
https://pgsync.com
MIT License
1.17k stars 180 forks source link

Support for multi-tenant db that leverages the PostgreSQL Schema feature? #143

Open namoshizun opened 3 years ago

namoshizun commented 3 years ago

Hii, Thanks for creating this super useful tool :D! I am building a multi-tenanted SaaS application using Django. To achieve data isolation, each registered user's data is stored under his/her own PG Schema. Now I would like to synchronize the SaaS database with Elasticsearch to provide advanced & efficient search capacity.

Pgsync is thus far the most promising and easy-to-get-started tool I can find to implement the data synchronization. However, it looks like PGsync only supports statically typed schema in the Schema JSON? i.e., it won't automatically looks for all schemas start with "foo" if I give foo* as schema?

toluaina commented 3 years ago

Postgres schemas are statically defined and this was deliberate. I can add this to the TODO.

namoshizun commented 3 years ago

Thanks @toluaina. I reckon this would be a fantastic feature, especially for multI-tenanted SaaS applications relying on the database schema to achieve data isolation, which is a common practice :D Much look forward to it!