Add support for storing state in Redis
This pull request introduces support for storing the persistent state of Flower in Redis, as an alternative to the existing file-based storage mechanism. This enhancement aims to improve the reliability, scalability, and performance of state management in Flower.
This removes the limitation that prevented running multiple instances of Flower concurrently by centralizing state management in Redis.
cc: @mher
This is a great idea. Makes it much easier to run flower in a containerized environment.
What needs to be done here to merge this in, @mher?
This removes the limitation that prevented running multiple instances of Flower concurrently by centralizing state management in Redis.
the other big benefit here is state is not lost when the container restarts (if you don't have a persistent volume attached to your container).
Created a PR for rediss support here
@Nusnus Bump
@auvipy @Nusnus Bump
@auvipy Unit tests have been added for Redis events state storage in https://github.com/mher/flower/pull/1397/commits/0192efc12135a527a8112d2a11271df2a3d4dbf9.
@auvipy @Nusnus
The flower/events.py:24:0: C0103: Variable name "PROMETHEUS_METRICS" doesn't conform to snake_case naming style (invalid-name) lint error is outside of the scope of this PR.
Saving the entire state with a single redis_client.set is not scalable.
Saving the entire state with a single
redis_client.setis not scalable.
@mher Agreed, but Flower isn't scalable as it is, due to a file based state. I don't think having this Redis alternative makes it any worse. The flower database gets corrupted more frequently than one would hope. Fixing it in Redis is much easier, and it also means the Flower container doesn't need to be restarted.
Do you have any other plans or thoughts on moving the state out of filesystem to make it truly scalable?
I do think that this implementation is a start in that direction. Please share any suggestions you might have to improve the current implementation.
Bump @Nusnus
?