Journaling Cache
Cache is a concept in browsers/applications in which data that is frequently used is fetched from cache memory (RAM) instead of being fetched from a DB, avoiding the actual code flow and leading to faster results.
Here comes a classic backend interview question:
Why don’t we store everything in the cache?
To simply put it, browser/application memory is not as advanced as the human brain.
- RAM is expensive.
- Cache misses.
- Data updates are required.
Now, let us assume we have abundant memory like the human brain and money is not a problem for us.
Cache Misses
Similar to our subconscious thought process, cache tends to miss a few things. It can’t store very high levels of detail that require carefully ensuring every aspect leads to a perfect outcome.
Get Ankit Pathak’s stories in your inbox
Join Medium for free to get updates from this writer.
Data Needs Updates
In our world, things change at a great speed. What feels relevant today might be irrelevant the next minute. We need to run update queries to keep the latest data in our DB. Keeping cache synchronized is one of the hardest distributed-system problems.
Clearing Cache
My senior had a discussion with me more like a personalized feedback that led me to a realization:
“I overthink a lot before code implementation. It makes me slow.”
Unlike a browser/application, I didn’t have a specific button to clear my cache. Then I tried journaling this thought whenever I tried to implement code. Lucky enough, writing down every aspect helped me clear my brain fog.
Ever since childhood, I developed a practice for accurate output: while copying notes, I rechecked every letter instead of writing a complete line. Obviously, going letter by letter instead of line by line reduces speed exponentially. This habit carried over into almost everything I did. I took detours, but never reflected on this habit of mine for the past 20 years.
Fixing the Bug: Better Speed
Writing it down helped me fine-tune the code flow of my entire thought process for more efficient results. This code fix will take a bit of time, but a major personal update will be deployed soon.
Conclusion
Not every action requires a thought. At a micro level, it just needs execution and feedback. Every problem needs a unique approach to achieve efficient and accurate output.
POV: Journal Caching is altogether a different concept too not just title of this article.






