Caching is not just about using a distributed cache.
It happens at every layer of your application - right from the front end to the database.
The only thing that changes is its overall usage.
✅ Front End App
Browsers cache stuff all the time. HTTP responses, asset files, HTML pages, and so on.
Developers can set the caching directives in response headers to control the behavior.
✅ Content Delivery Networks
CDNs can cache static content like images, stylesheets, and JS files.
Their advantage is caching stuff closer to the users, reducing latency in the process.
✅ Load Balancers
Some load balancers can also cache frequently accessed data.
Responses can be served without calling the backend server. This improves the response times and also reduces the load on the server or database.
✅ Service Instance Cache
Service instances can employ their caching solutions to boost performance.
This can be in the form of in-memory caches that are checked before fetching from the database.
✅ Distributed Cache
A more robust caching solution can use distributed caches like Redis. They help with faster reads and writes than going to a traditional relational database.
✅ Full-text Search Tools
Searching through tons of text information is a time-consuming task.
Tools like ElasticSearch help index the data for faster text search, effectively acting as a cache.
✅ Databases
You might think that databases always fetch from the disk.
But databases also use special caching mechanisms. For example, a Bufferpool is like a cache within the database that holds data pages to support faster reads.
Also, Materialized Views store results of pre-computed results of expensive queries for faster access
Lastly, many new-age databases have their own built-in cache solutions.
👉 So - what types of caching solutions have you used?