Member-only story

The 5 Caching Patterns You Should Know

Konstantin Borimechkov
5 min readFeb 2, 2024

--

If you’ve been in the industry for some time or you’re now trying to get in, I bet that the term caching is familiar to you!

That’s because caching is utilized by many, if not all, companies to improve the application’s performance! How? 👇

How Caching Improves Performance? ⏩

Well, we have the normal storage of information - in a database, whether that’s MySQL, PostgreSQL, MongoDB or other DB provider. The ‘issue’ here is that when you save data to the DB, you are storing data to the disk.

With caching (Redis, Memcached, NGINX), you are storing the data in memory. Well.. that’s a whole lot faster to retrieve.

Look at the illustration below to gain a better understanding 👇 (The lesser the cycles, the faster the app)

Not much, just 1000X the difference in cycles 😅

So, caching is stored in memory for low latency. But memory is limited, so we need to utilize difference caching techniques or patterns in order to be smart with when do we need the data from DB or cache! 🧠

The Most Famous Caching Patterns

--

--

Konstantin Borimechkov
Konstantin Borimechkov

Written by Konstantin Borimechkov

Writing Code For a Living 🚀 | Software Engineer @ Tide | Writing Blogs About Python & CS

No responses yet