Database Caching

In Simple Terms

Zaid Alissa Almaliki
2 min readOct 19, 2022

First let me introduce a simple example, to understand what caching is, before we jump into database caching.

Consider a website for a newspaper. Every time you visit the website or reload the page, some of it changes (think about the headlines). Other factors remain essentially stable for several days or even weeks. Consider the newspaper’s logo. Given that, it makes sense to utilise a local copy of the logo that is already on your computer rather than requesting the logo each time you connect. This avoids generating extra internet traffic.

The vast majority of the time, this method works rather well.Websites can indicate which material needs to be updated and which can be cached. However, occasionally you could experience some difficulties.For instance, if a newspaper updated its logo and tagged the old version as something you could securely store, you may see the old version instead of the new one. The answer is to clean the cache (i.e., delete all locally saved material) and request a fresh copy from the website.

How Cache Works?

In Technical Terms

It is crucial to boost database speed to meet SLA requirements while developing distributed databases that demand lightning-fast performance.By lowering database overhead and cost-optimizing, an efficient caching technique may help you increase the performance and dependability of your application. The roundtrip to the database can be avoided by keeping frequently accessed data in an in-memory cache. You must run a query involving numerous tables in order to retrieve the data from the database, which might be a costly task. Instead of repeatedly calling the database, you can store the data in the cache and return it the next time with a latency of less than one millisecond.

Thanks for reading. If you loved this article, feel free to hit that follow button so we can stay in touch.

This article is possible because of these references. some external links in this post are affiliate.

Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems

System Design Interview — An insider’s guide

Ngnix load balancer

--

--

Zaid Alissa Almaliki
Zaid Alissa Almaliki

Written by Zaid Alissa Almaliki

Data Engineer, LinkedIn and Twitter Top Voice. Contributing to leading platforms like Towards Data Science.

No responses yet