What do you want to achieve?
While bringing up redis instances data should be populated from the external Database. So after the redis server is up and ready what ever the data on the database should be available on the redis as well.
Any solutions for it?
Redis Cluster details: Deployment type: Sentiel Redis Redis version : 5.0.3 Platform: Kubernetes (1.20.0) Storage : PVC
Comment From: sundb
What are the scenarios you use? This is rarely used, but incremental synchronisation can be used. 1. Writing data to redis using mysql triggers. 2. Sync to redis using a third-party service (e.g. canal).
Comment From: kalpanathanneeru
The requirement is more like bootstrapping redis, i.e. while starting redis server, it should come up with a given set of data, which is available in an a external database.
Comment From: sundb
It is possible to do this with the RedisModule, but it is strongly advised not to do so, as having redis actively fetch data from outside will clog up redis and render the service unavailable..
Comment From: kalpanathanneeru
Thank you for clarifying this. However, this is for a specific requirement. Could you please help with the procedure/steps to achieve this bootstrapping.
Comment From: sundb
- Learn how to implement a redis module.
- Use mysql c library to fetch data when redis module is loading.
- Writing data to memory using the RedisModule_HashSet related interface.
- At this point it's almost ready to use, and you can use it with the normal redis command。