Open egmar opened 3 years ago
This is something we've thought about architecturally, but it involves significant changes to how we deploy the database (with added complexity), and adds some restrictions on how that can work.
It's probably not something we'll look at in the very short term.
ISSUE TYPE
SUMMARY
It's a common practice to have read-only replicas for databases. This brings benefits in splitting the write operations from read operations, as well giving option for a clever routing of various database operations, e.g. long running analytical queries would be done against read-only replica.
Read-only replicas are generally available as an option in most cloud providers, for example on AWS https://aws.amazon.com/rds/features/read-replicas/
On Django framework level this is possible by using database routers https://docs.djangoproject.com/en/3.1/topics/db/multi-db/#database-routers and most naive implementation could look like:
with following in app configuration
Overall, using read-only replicas could bring benefits for UI/API-related queries (browsing inventory, job templates, old job logs) and analytics. It could help improve performance in certain use cases, in addition to the work in: https://github.com/ansible/awx/issues/9039