News for hackers. Stuff that matters.
Re:Multi-Tenant Architectures by pvorb on Sunday August 30, 2020 @05:19PM (#24326013)
My strategy is using a separate, but equivalent schema for every tenant and setting the tenant context with every request before running queries.
Re:Multi-Tenant Architectures by ccleve on Sunday August 30, 2020 @06:48PM (#24326654)
This works and solves a lot of problems. The downside is that schema changes are cumbersome because you have to make them in many places. If you want to roll out a new feature in a shared app which depends on a schema change, it's hard to do without downtime or complicated feature flags.
Re:Multi-Tenant Architectures by hinkley on Sunday August 30, 2020 @07:04PM (#24326764)
It seems like some continuous deployment strategies could work here, as long as you limit the number of schema changes in flight to a handful.

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.

Re:Multi-Tenant Architectures by infogulch on Sunday August 30, 2020 @05:42PM (#24326159)
Ideally setting the tenant context happens early during request authorization, is a required to get access to a database connection, and is configured outside the scope of any request business logic.
Re:Multi-Tenant Architectures by pvorb on Monday August 31, 2020 @02:29AM (#24328979)
Yeah, I'm using Java, so in practice this means I extended my JDBC DataSource. On every call to getConnection() it sets the schema.