João Azevedo
03/02/2023, 2:20 PMredis.host.example
), but I am unable to set the value for the redis database number:
• Does gooddata-cn
write keys to the next available database? The default database (index 0)? Multiple?
• If it uses one DB, then can I specify the host as such: e.g., redis.host.example/5
?
• Is this Redis service stateless? Or does it perform regular backups/snapshots? Do you recommend persistence?
Thank you for your time!Robert Moucha
03/02/2023, 4:31 PM0
is used. This is particularly important if your Redis is running in clustered configuration, there's only db 0.
And even the Redis author himself doesn't consider using multiple databases as a good idea [link] so I'd recommend to avoid it if possible.
To your other questions:
There are basically two deployment methods for Redis compoment.
1. Use built-in Redis deployed as a helm sub-chart, that is by default deployed as 3-node StatefulSet (1 master, 2 replicas) with persistence and sentinel. GoodData CN uses sentinel to connect to redis-ha StatefulSet and uses db 0. Failover is done automatically using sentinel protocol.
2. The other option is to deploy Redis-compatible service manually as a external service (e.g. cloud-based ElastiCache) and configure GoodData CN helm chart to connect to it. In this case you need to set deployRedisHA: false
and use service.redis
value object to configure connection parameters, as shown in docs. It's up to you what topology you choose, if you'll use redis cluster or just plain replication.
In case of redis-ha sub-chart deployment, the db is periodically stored to persistent volume, but we don't do anything else with that dumps. You may add extra tooling that would perform volume snapshots, send it to S3 or whatever you like. But in my opinion it is not worth of effort. The redis keeps only precomputed result caches so in case you'll lose all 3 replicas at once, no big disaster will happen, sooner or later, data will be recomputed and stored in redis.
I hope I answered to all your questions. If not, do not hesitate to ask again.Robert Moucha
03/02/2023, 4:33 PMmaxmemory_policy
set to allkeys-lru
João Azevedo
03/02/2023, 5:02 PMVitor Falcão Costa
03/02/2023, 5:11 PMStatefulSets
? Is it to guarantee that each pod will use the same volume in case of restarts or failures?
that is by default deployed as 3-node StatefulSet (1 master, 2 replicas)2. Does it requires the cluster to have >= 3 nodes? Or are we talking only about the number of replicas of the pods?
Robert Moucha
03/03/2023, 9:05 AM