3 ms·
I'm curious, how do you handle being in a partial state? It seems like it could be operationally tricky to have some users migrated, some pending, and some in a
by netghost 1y ago
I'm curious, how do you handle being in a partial state?
It seems like it could be operationally tricky to have some users migrated, some pending, and some in an error state.
On the other hand, I could imagine doing lazy migrations as user or tenants sign in as a nice way to smooth out the increased effort in migrating if you can engineer for it.
- njs12345 1y agoWhen not per tenant you still have this problem, and typically resolve by releasing database migrations separately to the code that uses changes (ensuring backwards compatibility). I guess per-tenant you would handle similarly but build some tooling to monitor the state of migrations. It might even be easier in some ways, as you might be more able to take table locks when migrating per-tenant.
- magicalhippo 1y agoWe've got a desktop B2B application which we also run with per-tenant DB. This makes the setup equal between our hosted service and on-prem. When updating, schema changes goes first and when successful the new version is allowed to be executed by users. We have small launcher app that the users run which starts the actual application to handle this. Our DB changes are always backwards compatible in the sense that the old version should operate correctly on an updated DB. Incompatible changes like renaming a column we handle by rolling out the new column first, then wait till the version still using the old column is retired before removing the column from the schema, or similar strategies. This way partial updates are safe, as the old app will just continue to use the partially updated DB as normal. We're migrating to a web app, and hope to have something similar. Plan is we'll update the tenant DB and once done we'll change the app routing so that new user sessions for that tenant goes to new app instances running the updated version. That said, we've not got 1 million users... yet.