What is the advantage and disadvantage of using redis as a sidecar in kubernetes?Is it possible to have persistence cache when redis container is added in each app pod? Will that affect the availability and scalability of cache?
I'm hard-pressed to think of any advantages to running Redis as a sidecar. I would always run it as a separate deployment (or stateful set if persistence is enabled) with a separate service.
If Redis is in its own pod then:
Given Redis's overall capabilities (principally in-memory storage, limited data-type support), simply storing this cache data in singleton objects in your application would be more or less equivalent to running Redis as a sidecar (one copy of the cache data per pod, data is lost when the pod is deleted).