Fork me on GitHub
#sql
<
2021-07-24
>
dotemacs07:07:27

Hello, I’m looking for all the potential options to leverage PostgreSql and its schemas, to implement a multitenancy service, where each different client would get their own schema (PostgreSql speak), think “their own database”. The only resource that I found about this, in Clojure, is this presentation from 2015 https://www.youtube.com/watch?v=rgtkDpcXjXU But do you have any experience using this or do you know of any library that is using this approach? Thanks

indy08:07:55

Have a tenant table and have foreign key references to the tenant table from other tables? That’s the standard way of doing it afaik.

indy08:07:55

A tenant is just another relation

indy08:07:33

Oh, a different schema for each client? That’s an interesting requirement. In that case why not just have a different database for each client. There can be multiple databases in a single database cluster.

dotemacs08:07:32

If I’m writing SQL only, I can do whatever. But I wanted to see if there is already a Clojure library that leverages this approach. Or any helpful nudges. Because that talk was given 6 years ago.