I'm making a CRUD application that uses PostgreSQL as the primary store and uses Redis as a cache. For this part of the application, the API pulls all its data from the Redis cache.
This has worked fine for reading from Redis, but now I want the changes that are committed to the database during a create/update/delete to be immediately reflected in the Redis cache. I'm unsure about how to do this, or if this is even the best way to do it.
Could someone please provide an example of how to achieve this?