Using local cache and notifications
Distributed cache solves a series of critical issues when we develop distributed systems. In these systems, often made by many servers working in a pool, the state should be persisted somewhere out of process. In fact, in case of a scalable web application made by N identical stateless servers in parallel, no one can safely own the state of something either because it might fail or because the other servers cannot access the web application and they can't even know that something is stored into a peer's state.
So, distributed cache solves this big problem by keeping the state out of process, out of server, and sometimes out of datacenter. However, this comes at a price. First is the latency of networks due to the physical distance between the client (stateless application) and server (caching endpoint). Second, the network bandwidth is not infinite, and it is certainly slower than in-process memory operations. Therefore, we must reduce the number of cache...