We are using Django to develop our product. Our product contains 5 Django projects. Each project uses 50 shared class Models and models are in the developing process.
There are two possible ways to handle all these related projects with models in the development and production process:
One possible solution is to use models in one project with all migration files and use them in other projects with managed=False in the Django class model. But the problem with this structure is:
- Each change in original models must apply to other projects
- This approach makes the production process repeatedly and hard to manage properly
- New features in each project are connected to model changes
- By adding new required fields to an existing model, other projects that create new instances from the updated model would face rational problems. Even if they don't use these new fields
The other possible solution is gathering all projects as one project with the below diagram:
Now this configuration's problem is:
- Complicated deploying production
- Complicated to route the project
- All deployed services should redeploy with every change in one model
- All of the projects are in one place
My question is:
Whether the suggested solutions are correct or then What is the best and optimum architecture to handle all of
the projects which work correctly deploy on separate VM machines?
PS: All projects may use the new changes in models as their new features.
PS2: Each project and databases will be deployed on separate Host.