We currently have a big Django web application: all data is centrally managed by the webapp, via models backed by Postgres.
We want to offer access to the data in a more decentralized way, and the solution that we are aiming for is to provide small uServies dealing with the different application domains. That is, from this architecture:
- Django + single DB
We want to move to the following architecture:
- Django (without data)
- uService 1 + DB1
- uService 2 + DB2
- ...
Thus we will have a smooth transition path: the webapp will keep working as before, but we will now have the option of offering access to the data in a fine-grained manner, with different requirements (for scalability, ...) for each of our application domains.
The refactoring must be done in the following way:
- The Django webapp must remain unchaged (except for the models). In particular, views and templates must remain unchanged.
- Each uService will deal with a problem subdomain, and will be completely autonomous, offering access to the data via REST. The technology for each uService is not defined: it could be DRF, or Flask, or Scala, or Java, it does not really matter; this is actually one of the selling points of the new architecture: each problem can be addressed with the right tool for the job.
- Access via the django webapp will ultimately GET/POST/DELETE/PUT from the uServices.
How can django be used in this way? Ideally we would still have models in the webapp, but instead of being backed by the database, they should access the REST endpoints to get / modify the data.
Are there any example applications using this kind of architecture in the Django world?