News for hackers. Stuff that matters.
Re:Ask HN: The state of Firebase alternatives in 2020? by kiwicopple on Wednesday October 21, 2020 @03:51AM (#24845655)
I may have misunderstood the question so feel free to push back if this doesn't make sense -

We use Postgres Row Level (RLS) security, so you can do some very advanced rules. For example, one of our team built a social network with PG and RLS: https://github.com/steve-chavez/socnet/blob/f1abaadaaedb7c8e...

RLS is flexible enough to cover multi-tenant scenarios, though it's up to you how you structure your schema to make it work.

Re:Ask HN: The state of Firebase alternatives in 2020? by tjchear on Wednesday October 21, 2020 @07:02PM (#24853218)
Are there plans to introduce an API similar to this then? https://cloud.google.com/identity-platform/docs/multi-tenanc...
Re:Ask HN: The state of Firebase alternatives in 2020? by kiwicopple on Wednesday October 21, 2020 @10:21PM (#24854311)
Interesting, I will have to investigate how this propagates through to their underlying database. I'm guessing this just changes where the data is being written inside a Firebase project?

There are several strategies for multi-tenancy in postgres. You can create a completely new database, a schema, or a have the tenancy as rules/logic in the same schema. I'd prefer the latter right now since RLS enables it so easily and it's more flexible - you can create the policies for your own tenancy structure.