Make API resilient to a Redis outage #3385
Labels
💻 aspect: code
Concerns the software code in the repository
🧰 goal: internal improvement
Improvement that benefits maintainers, not users
🟧 priority: high
Stalls work on the project or its dependents
🧱 stack: api
Related to the Django API
Description
Presently, our API relies heavily on Redis and expects it to be highly available. This can be seen by performing the following:
just a
(start the API)docker stop openenverse-cache-1
This high dependence on Redis makes it difficult for us to make changes to the cache, e.g. version upgrades like #3382.
We will need to build some resiliency into the API in every instance where one of the caches is used:
openverse/api/conf/settings/databases.py
Lines 47 to 59 in 3864283
In cases where we can continue without the cache (even at the detriment to performance), we should continue execution. If cache is absolutely required for a certain operation, we might issue an HTTP 424 for the request (though perhaps a 500 would make more sense?).
Additional context
This is part of the larger effort around upgrading Redis, see #3382
The text was updated successfully, but these errors were encountered: