Performance: Database configuration
HIGH IMPACT
This affects the speed of data retrieval and storage, impacting page load times and responsiveness when the app interacts with the database.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'mydb',
'USER': 'myuser',
'PASSWORD': 'mypassword',
'HOST': 'localhost',
'PORT': '5432',
}
}DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}| Pattern | Query Latency | Connection Overhead | Concurrency Support | Verdict |
|---|---|---|---|---|
| SQLite in production | High (slow queries) | High (no pooling) | Low (locks on writes) | [X] Bad |
| PostgreSQL with pooling | Low (fast queries) | Low (reused connections) | High (supports concurrency) | [OK] Good |