Fork me on GitHub

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 But do you have any experience using this or do you know of any library that is using this approach? Thanks


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.


A tenant is just another relation


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.


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.