Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Graceful Redis cache adapter fallback #9529

Open
pocketcolin opened this issue Jan 10, 2025 · 2 comments
Open

feat: Graceful Redis cache adapter fallback #9529

pocketcolin opened this issue Jan 10, 2025 · 2 comments
Labels
type:feature New feature or improvement of existing feature

Comments

@pocketcolin
Copy link

New Feature / Enhancement Checklist

Current Limitation

If you are using the Redis for the Cache Adapter and your Redis instance goes down, it will crash the Parse server.

Feature / Enhancement Description

A graceful fallback for temporary Redis outages. One possible solution could be to have a configurable Redis request timeout (maybe defaults to 5 seconds) where if Redis doesn't respond fast enough, a new request is made to the database for the same information. Note that one of the biggest complicates for having a Redis cache fallback is dealing with the potentially stale Redis data when it comes back online. I don't know how we'd want to deal with that and it might be a deal breaker, but posting this anyway because @mtrezza asked me to!

Example Use Case

  1. Running Parse Server with a Redis Cache
  2. Redis host goes down
  3. Your Parse Server continues running (albeit in a degraded state) until either your host brings your Redis cache back online or you turn off Redis temporarily until issues can be resolved.

Alternatives / Workarounds

You can disable the Cache Adapter manually when you expect Redis downtime.

3rd Party References

https://www.michaco.net/blog/WhatIfRedisStopsWorkingHowDoIkeepMyAppRunning

Copy link

Thanks for opening this issue!

  • 🎉 We are excited about your ideas for improvement!

@mtrezza mtrezza added the type:feature New feature or improvement of existing feature label Jan 10, 2025
@mtrezza
Copy link
Member

mtrezza commented Jan 10, 2025

Sounds interesting, the Redis data may be outdated in any case, whether there's a fallback or not, so I believe that's a separate challenge. The fallback itself can keep an app at least operational, at the cost of querying directly from the DB, rather than bringing the server down due to a temporary connection issue to the Redis server. A possible solution may be to flush the Redis server once it comes back online, so that it's essentially self-healing by rebuilding the cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

No branches or pull requests

2 participants