Use ORM model in database based cache backend
|Reported by:||akaariai||Owned by:||nobody|
|Component:||Core (Cache system)||Version:||master|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The database based cache backend used raw SQL for both querying and table creation. This resulted in a lot of non-DRYness, and SQL which was hard to get correct for 3rd party backends (#18330).
Using ORM in cache backend could result in some slowdown due to qs cloning, and because the ORM in general is a little bit slower than raw SQL, but I can't see that as a blocker. Anybody using db as a cache backend is already using something that isn't as fast as memcached for example. I haven't done any measurements here, but I believe the slowdown is minor.
See pull request https://github.com/django/django/pull/97 for a patch implementing this.
Change History (11)
comment:1 Changed 4 years ago by akaariai
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:3 follow-up: ↓ 4 Changed 4 years ago by akaariai
- Triage Stage changed from Unreviewed to Accepted
comment:9 Changed 4 years ago by akaariai
- Triage Stage changed from Accepted to Design decision needed