[Have restructured the question]
We have a lot of DB readers and few writers where writers may perform longer operations. This is a real-time system so the read has to be performed as efficiently as possible. Actually there is a hard limit otherwise the call is considered as failed. THe one solution that is discussed is to have a Redis cache which is updated whenever the database is altered and all the reads are served from it instead of the database. Since the joins and other related stuff has already been performed therefore from the Redis, we only need to find and return the data. My questions are rather theoretical that
- Since Redis is a separate service, using it in the system as Cache serves the purpose or the static structures would be better. The amount of data we are talking about is probably in 1-1.5 GB.
- The structures we need in Redis to be able to have the dataset in which individual elements could be found easily and can be returned as sorted. Is it a correct decision to store the data in Redis just to be performant which incurring more development?