bernardopires / django-tenant-schemas

Tenant support for Django using PostgreSQL schemas.
https://django-tenant-schemas.readthedocs.org/en/latest/
MIT License
1.45k stars 424 forks source link

How to run tenant migrations in parallel #630

Closed boddumanohar closed 4 years ago

boddumanohar commented 4 years ago

Hi,

Our application has a lot of tenants to perform database migratons on. Currently we do the migrations in serial. But that takes a lot of time.

Is there a suggested way to run migrations in parallel?

we have a few approaches:

  1. run the migrations in celery tasks.

are there any other suggested approaches that could make the migrations run in parallel for a large set of tenants?

Thanks, Manohar.

MIKNOTAURO commented 1 year ago

Did you solve this? We're facing the same problem.... we use celery to handle migrations (and it works), but we think we can improve the performance with asyncio. have you ever tried something like this?