From f1874c7637ed69ad8e96e9c7c9be323f7921a25e Mon Sep 17 00:00:00 2001 From: Pronob Mozumder Date: Wed, 20 Mar 2024 18:27:14 +0600 Subject: [PATCH] Update 103-database-caching.md Added a simplified explanation of database caching using analogies for easier understanding. --- .../content/112-caching/103-database-caching.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/data/roadmaps/system-design/content/112-caching/103-database-caching.md b/src/data/roadmaps/system-design/content/112-caching/103-database-caching.md index 33a4ccea8..b82a0504b 100644 --- a/src/data/roadmaps/system-design/content/112-caching/103-database-caching.md +++ b/src/data/roadmaps/system-design/content/112-caching/103-database-caching.md @@ -1,3 +1,15 @@ # Database Caching -Your database usually includes some level of caching in a default configuration, optimized for a generic use case. Tweaking these settings for specific usage patterns can further boost performance. +Your database usually includes some level of caching in a default configuration, optimized for a generic use case. Tweaking these settings for specific usage patterns can further boost performance. it's like having a quick-access memory for frequently used data in applications. Here's a simplified explanation: + +1. **Quick Access**: Imagine you're looking up information in a big library (the database). Instead of going to the library every time you need the same book (data), you keep a copy of it on your desk (cache). + +2. **Faster Retrieval**: When you need that book again, you first check your desk (cache). If it's there, great! You get it right away without going to the library (database) again. + +3. **Saving Time**: If the book isn't on your desk (cache miss), you go to the library (database) to get it. But you make sure to put a copy on your desk for next time, so you won't have to go to the library again if you need it soon. + +4. **Different Types**: There are different ways to do this caching. You can cache the results of searches (like bookmarking), whole pieces of information (like keeping a paper copy), or even entire web pages (like saving a snapshot). + +5. **Benefits**: By keeping frequently used data close by, you save time and reduce the strain on the library (database). It's like having your most-used books right at your fingertips, making your work faster and more efficient. + +However, it's important to keep the cached data up to date. Otherwise, you might end up with outdated information, like using an old edition of a book instead of the latest one. So, managing this cache properly is key to keeping things running smoothly.