Sample Header Ad - 728x90

Is it correct to use 2 instances of Redis server one with persistence while the second with no persistence?

0 votes
1 answer
339 views
I'm starting a new project. In this project I'll use Redis to store some data which must be persistent. For these data I'll use Append Only File (AOF) persistence. In the project there are 2 applications that must communicate with each other. To allow this communication I'm thinking to use Redis as a *"shared memory"*. With the term *"shared memory"* I mean that the use of Redis is: - to store some keys (called keyA1, keyA2) that will be updated by application A - to store other keys updated by application B (called keyB1, keyB2) - application A reads the keys updated by Application B (keyB1, keyB2) - Application B reads the keys updated by Application A (keyA1, keyA2) This group of keys (keyA1, keyA2, keyB1, keyB2) must not be saved on persistent memory. My idea is *to use Redis to avoid the creation of a TCP communication protocol between Application A and Application B* (but I have the doubt that this is use of Redis could not be correct). Each of these 2 applications sends messages to the other and receives messages from the other by *writing and reading keys of the Redis database*. [This post](https://stackoverflow.com/questions/75291286/is-it-possible-to-enable-persistance-for-some-part-of-the-redis-data) tells that is not possible activate persistence for only a subset of database keys so I'm thinking to use 2 instances of Redis. Is it correct to use 2 instances of Redis server (one on the default port 6379 and the other on the port 6380) and setup the first with AOF persistence while the second with no persistence? Is there a better approach? Thanks
Asked by User051209 (101 rep)
May 10, 2023, 07:43 AM
Last activity: Jul 8, 2024, 07:14 AM