One way to reduce server-client communications is to cache the non-changing but mutable data into a server. There are various architectures to do it.
However, the very first thing to do is defining the caching invalidation policy.
Caching functions as a temporary storage unit that holds the non-changing data after the intensive data processing. This way, if the client issues the same request again and there are no data alteration from the server side, the system can just reply with the cached version. Of course, if there are data alteration, the cached version gets invalidated and new processing is done and new output are cached again.
This provides a massive speed and performance boost after repeating non-altering data request.
The trick is determine:
Now remember that we need to invalidate the cache when the actual data are altered. These are triggers and it is upto your design to perform the invalidation
The easiest caching architecture is client side caching. In this mode, client keeps a local cache to perform a quick pool instead of requesting everything from the server side. The architecture is as follows:
There some advantages using this caching architecture design:
The disadvantages fusing the caching architecture design:
This is the back-end caching architecture design. Usually, the caching server is behind the back-end server and in front of the database server.
There some advantages using this caching architecture design:
The disadvantages fusing the caching architecture design:
This is the back-end design where the caching server is in-front of back-end server. If distributed correctly across geographical locations, it forms a network known as Content Distribution Network (CDN). The architecture design is as follows:
There some advantages using this caching architecture design:
The disadvantages fusing the caching architecture design:
With the design above, today's internet is operating with this ideal architecture. Normally, it is not ideal to implement this architecture one shot during development stage. In fact, the development should be one at a time to ensure your caching management is firm and stable without compromising user experience.
There some advantages using this caching architecture design:
The disadvantages fusing the caching architecture design:
That's all about caching design and architecture.