Re:How to Build a SaaS Application Block by Block
by 33degrees on Tuesday November 27, 2018 @10:49PM
(#18549162)
You can use postgres' row level security to do this: https://www.postgresql.org/docs/9.5/ddl-rowsecurity.html
[ Parent
| on HN ]
Re:How to Build a SaaS Application Block by Block
by keybits on Wednesday November 28, 2018 @10:11AM
(#18552106)
Here's an up-to-date example using Rails and Postgres row level security: https://github.com/kuroda/multi_tenancy
Re:How to Build a SaaS Application Block by Block
by config_yml on Wednesday November 28, 2018 @09:20AM
(#18551594)
I've used RLS and it works great for this. Make sure you have your tenant_id on all tables, which makes it easy to partition later. I think you can even do per-tenant backups/archives like this with pgdump, by using a specific user.