People do all sorts of optimizations over their primary storage layer. AWS has built a whole product around a Redis based caching mechanism (to get sub-millisecond response times) https://aws.amazon.com/elasticache/redis/
Their diagram below really outlines the prevalent architecture very well:
- Client layer with UI’s, apps etc.
- Storage layer with multiple databases / file-systems
- Caching layer in between
Writing and managing a caching layer is not easy. Reminds me of the famous CS phrase:
There are only two hard things in Computer Science: cache invalidation and naming things.
– Phil Karlton