Show HN: Underrated Postgres: Build Multi-Tenancy with Row-Level Security(simplyblock.io)
simplyblock.io
Show HN: Underrated Postgres: Build Multi-Tenancy with Row-Level Security
https://www.simplyblock.io/blog/underated-postgres-multi-tenancy-with-row-level-security/
2 comments
From Postgres docs https://www.postgresql.org/docs/current/ddl-rowsecurity.html
I built multi-tenant services and never used RLS because it's complicated.
I built multi-tenant services and never used RLS because it's complicated.
It is complicated to initially wrap your head around, I agree. That's why I thought a demo application is the best way to show that it doesn't have to be super complicated once understood.
Like many things in PG, they aren't always easy to get right away I remember my first time with it years and years ago.
Like many things in PG, they aren't always easy to get right away I remember my first time with it years and years ago.
If you prefer code over the blog post, I've put the full application example on GitHub. Would love to hear your thoughts.
https://github.com/simplyblock/example-rls-invoicing