It's also amenable to distributed processing if you use something like Citus.
I'm really looking for an alternative to Citus, though. Citus itself is a bit tricky to use, and the SaaS version of it is owned by Microsoft, which means Azure-only. Also, Microsoft makes the SaaS version insanely expensive. If they had Citus-like features on Amazon Aurora I'd be there in a heartbeat.
The move from AWS to Azure came with a reduction of IOPS per instance. We have not had the same level of performance since migrating to Azure.
I am considering running our own Citus instances.
https://influitive.io/our-multi-tenancy-journey-with-postgre...
Some things were mistakes but others look like pretty fundamental flaws. Performance is a problem, database changes are a problem, and you aren't able to query across tenants.
I have recently been using row level security with a transaction middleware where I set the tenant ID.
Nice article regarding it - https://aws.amazon.com/blogs/database/multi-tenant-data-isol...
So, it works.
We're wanting to move off that architecture to something more future proof, but it's not our biggest pain point at this point in time.
Can you use SET LOCAL ROLE <user> on each transaction ?
It adds a layer of security so it might prevent some bugs leading to exploits. But in itself is not enough to rely on to separate tenants.
I think for this use case security is focused on accidentally returning the wrong tenant's data (fully or partially)
Yes, but typically not across tenants. Maybe the flaw is only exploitable to admins of each tenant and they shouldn’t see other tenants data.
It looks like you could also use SET SESSION AUTHORISATION for this but I haven't used it so I don't know how this works with data access/pooling
Customer A is running the new schema, so gets one cluster. Customer Z will get migrated in the next hour, and then none of the old system is running.