Refresh Redis Cache

1,191 views
Skip to first unread message

CardsFan999

unread,
Jul 26, 2018, 9:55:08 AM7/26/18
to Redis DB
Hello,
I am using Redis Cache in a Spring Boot application that lives in the cloud. I am able to pull data from Oracle and put into Redis at startup and all is good. With that working, I am not wanting to to know how to update this cache with fresh data from Oracle. I think if I do a flushall and then insert all the data, that I will impact the application. So I am wondering if there is a design pattern for replacing the cache in a high performance applicaton? Thought about doing a partition switch, but that may have other problems that I have not thought about.

If anyone has any input, or ideas, please let me know.

Appreciate

Dave Nielsen

unread,
Jul 31, 2018, 3:44:26 AM7/31/18
to Redis DB
Perhaps you can build a new cache on a 2nd Redis server, then switch the Redis calls to that server when complete.Is that what you mean by a partition switch?

Dave 

Tuco

unread,
Aug 1, 2018, 2:45:21 AM8/1/18
to Redis DB
Please read about 'Write-Through Cache', 'Write-Around Cache' and 'Write-Back Cache'.
These are techniques/design patterns on how to update your cache(redis in our case) when the main DB(oracle in our case) is updated.
Depending on how much you can modify your application, you can implement any of these.

Like you could have to write a wrapper over all the database updates, where you not only update the database, you would also update the corresponding redis cache. This is just one way.
Reply all
Reply to author
Forward
0 new messages