I have 2 layer spring boot application as below and wish to implement distributed 2nd level cache with redis as to improve the performance .
[Spring boot Architecture][1]
Here we are using kubernates and hence there could be multiple instances of "Atomic Service A" and hence the requirement of distributed cache.
Though there could be few requests coming less frequently to modify the data in DB and same needs to be reflected in cache.
Wondering if there is any standard solution with redis to fetch data as like from traditional RDBMS .
Here the hypothetical solution would be like on startup "Student Atomic Service A" shall load Student data from DB on Redis cache and then any subsequent delete/update shall first do the same in Db and then update in Redis also I should get the records from Redis the way we query RDBMS.
e.g select * from student where id <10
It would be great if anybody can point any hint of sample implementation here.
I have gone through various sites but they only talk about key value thing but wish to find a DB Query like solution where the queried result shall get returned from cache.
I have tried POC with RedisTemplate but do not find a api like the way we query to a DB can be made e.g. select * from student where id<=5
Do not see any API which shall allow me to do operations like RDBMS with redis cache API