Django supports the use of multiple databases in one Django project. The objective of this spike is to investigate whether using multiple databases for different Wikilink tables will improve performance and how much work would it take to implement/migrate our project. Essentially, this is a cost/benefit analysis.
We have some prior art in a proof of concept project that uses a separate db for facts tables, eg.
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "data/django.sqlite3",
},
"facts": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "data/facts.sqlite3",
"OPTIONS": {
"init_command": "PRAGMA journal_mode=wal;",
},
},
}In the example, both dbs use the same engine, but this is not a requirement.
Questions:
- Do we have different tables that would benefit from different DB engines?
- Could we improve reliability by splitting the workload across separately resourced DBs?
- If so, what would be the steps to implement such a change without data loss?
- What would the level of effort be for such an implementation?
- Do you recommend such a change? Feel free to add context not covered by the answers to the preceding questions.
Note:
The questions here closely relate to questions in T370969; feel free to use that to inform this or vice versa
Resources: