zitadel/internal/cache/connector
Tim Möhlmann 3b7b0c69e6
feat(cache): redis circuit breaker (#8890)
# Which Problems Are Solved

If a redis cache has connection issues or any other type of permament
error,
it tanks the responsiveness of ZITADEL.
We currently do not support things like Redis cluster or sentinel. So
adding a simple redis cache improves performance but introduces a single
point of failure.

# How the Problems Are Solved

Implement a [circuit
breaker](https://learn.microsoft.com/en-us/previous-versions/msp-n-p/dn589784(v=pandp.10)?redirectedfrom=MSDN)
as
[`redis.Limiter`](https://pkg.go.dev/github.com/redis/go-redis/v9#Limiter)
by wrapping sony's [gobreaker](https://github.com/sony/gobreaker)
package. This package is picked as it seems well maintained and we
already use their `sonyflake` package

# Additional Changes

- The unit tests constructed an unused `redis.Client` and didn't cleanup
the connector. This is now fixed.

# Additional Context

Closes #8864
2024-11-13 19:11:48 +01:00
..
gomap feat(cache): redis cache (#8822) 2024-11-04 10:44:51 +00:00
noop feat(cache): redis cache (#8822) 2024-11-04 10:44:51 +00:00
pg feat(cache): redis cache (#8822) 2024-11-04 10:44:51 +00:00
redis feat(cache): redis circuit breaker (#8890) 2024-11-13 19:11:48 +01:00
connector.go feat(cache): redis cache (#8822) 2024-11-04 10:44:51 +00:00