Dr Milan Milanoviฤ‡ Profile picture
Dec 25 โ€ข 2 tweets โ€ข 2 min read โ€ข Read on X
๐—ช๐—ต๐—ฎ๐˜ ๐—ถ๐˜€ ๐˜๐—ต๐—ฒ ๐˜€๐—ถ๐—ป๐—ด๐—น๐—ฒ ๐—บ๐—ผ๐˜€๐˜ ๐—ต๐—ฒ๐—น๐—ฝ๐—ณ๐˜‚๐—น ๐˜€๐˜๐—ฟ๐—ฎ๐˜๐—ฒ๐—ด๐˜† ๐˜๐—ผ ๐—ถ๐—บ๐—ฝ๐—ฟ๐—ผ๐˜ƒ๐—ฒ ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ฎ๐—ฝ๐—ฝ'๐˜€ ๐—ฝ๐—ฒ๐—ฟ๐—ณ๐—ผ๐—ฟ๐—บ๐—ฎ๐—ป๐—ฐ๐—ฒ?

It is to ๐—ฐ๐—ฎ๐—ฐ๐—ต๐—ฒ (๐—ฎ๐—น๐—บ๐—ผ๐˜€๐˜) ๐—ฒ๐˜ƒ๐—ฒ๐—ฟ๐˜†๐˜๐—ต๐—ถ๐—ป๐—ด! Caching stores copies of frequently accessed data in a readily accessible location, reducing access time and offloading primary data sources.

Advantages of caching are faster data retrieval, reduced load on primary data stores, and improved user experience.

Don't cache only database queries, as reading for cache is much faster than an API call.

How do you ๐—ฑ๐—ฒ๐—ฐ๐—ถ๐—ฑ๐—ฒ to cache something? The better question is, why not cache something?

Adding a cache comes with costs, so for each candidate, we need to ๐—ฒ๐˜ƒ๐—ฎ๐—น๐˜‚๐—ฎ๐˜๐—ฒ the following:

๐Ÿ”น Is it faster to hit cache?
๐Ÿ”น Is it worth to store?
๐Ÿ”น How often do we need to validate?
๐Ÿ”น How many hits per cache entry will we get?
๐Ÿ”น Is it local or shared cache?

Yet, cached data is stale, so there can be situations in which it is inappropriate.

To determine how successful your cache is, you can keep an eye on metrics like cache misses.

There are ๐—ฐ๐—ฎ๐—ฐ๐—ต๐—ถ๐—ป๐—ด ๐˜€๐˜๐—ฟ๐—ฎ๐˜๐—ฒ๐—ด๐—ถ๐—ฒ๐˜€:

๐Ÿญ. ๐—–๐—ฎ๐—ฐ๐—ต๐—ฒ-๐—”๐˜€๐—ถ๐—ฑ๐—ฒ: The application manually manages data storage and retrieval from the cache. Data is fetched from the primary storage on a cache miss and then added to the cache.

๐Ÿฎ. ๐—ฅ๐—ฒ๐—ฎ๐—ฑ-๐—ง๐—ต๐—ฟ๐—ผ๐˜‚๐—ด๐—ต: When a cache miss occurs, the cache automatically loads data from the primary storage. It simplifies data retrieval by handling cache misses internally.

๐Ÿฏ. ๐—ช๐—ฟ๐—ถ๐˜๐—ฒ-๐—”๐—ฟ๐—ผ๐˜‚๐—ป๐—ฑ: Data is written directly to the primary storage, bypassing the cache. This strategy is effective when writes are frequent, and reads are less common.

๐Ÿฐ. ๐—ช๐—ฟ๐—ถ๐˜๐—ฒ-๐—•๐—ฎ๐—ฐ๐—ธ: Data is first written to the cache and later synchronized with the primary storage. This reduces the number of write operations but risks data loss if the stock fails before syncing.

๐Ÿฑ. ๐—ช๐—ฟ๐—ถ๐˜๐—ฒ-๐—ง๐—ต๐—ฟ๐—ผ๐˜‚๐—ด๐—ต: Data is simultaneously written to both the cache and the primary storage, ensuring consistency but potentially increasing write latency. Ideal for scenarios where data integrity is crucial.

Do you use caching?

#softwaredesignImage
To expand your knowledge and personal growth, subscribe to my free weekly newsletter with 20,000+ people: .newsletter.techworld-with-milan.com

โ€ข โ€ข โ€ข

Missing some Tweet in this thread? You can try to force a refresh
ใ€€

Keep Current with Dr Milan Milanoviฤ‡

Dr Milan Milanoviฤ‡ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @milan_milanovic

Nov 23
๐—ง๐—ต๐—ฒ ๐— ๐—ผ๐˜€๐˜ ๐—œ๐—บ๐—ฝ๐—ผ๐—ฟ๐˜๐—ฎ๐—ป๐˜ย ๐—–# ๐—™๐—ฒ๐—ฎ๐˜๐˜‚๐—ฟ๐—ฒ๐˜€ ๐—™๐—ฟ๐—ผ๐—บ ๐—ฉ๐—ฒ๐—ฟ๐˜€๐—ถ๐—ผ๐—ป ๐Ÿฒ ๐˜๐—ผ ๐Ÿญ๐Ÿฎ

C# language has been developing for more than 20 years now. Yet, every year, we see new versions of the language with new, exciting features. Some of their features aren't just updates but tools that can drastically enhance your coding efficiency and software design.

Here is an overview of the main C# features from C# 6 to 12, released last week. You can check a short explanation and ๐—ฎ ๐—ฐ๐—ผ๐—ฑ๐—ฒ ๐˜€๐—ป๐—ถ๐—ฝ๐—ฝ๐—ฒ๐˜ ๐—ณ๐—ผ๐—ฟ ๐—ฒ๐˜ƒ๐—ฒ๐—ฟ๐˜† ๐—ณ๐—ฒ๐—ฎ๐˜๐˜‚๐—ฟ๐—ฒ (more than 40 most important features!).

๐Ÿงต

#charp #dotnet
Image
C# language history Image
C# Timeline Image
Read 59 tweets
Nov 18
๐—ฆ๐—ค๐—Ÿ ๐—•๐—ฎ๐˜€๐—ถ๐—ฐ๐˜€ ๐—–๐—ต๐—ฒ๐—ฎ๐˜ ๐—ฆ๐—ต๐—ฒ๐—ฒ๐˜

A great SQL Cheat Sheet byย LearnSQL .com.

๐Ÿงต

#softwareengineering #sql #data Image
Image
Image
Read 9 tweets
Jul 10
๐—ฆ๐—ผ๐—ณ๐˜๐˜„๐—ฎ๐—ฟ๐—ฒ ๐——๐—ฒ๐˜ƒ๐—ฒ๐—น๐—ผ๐—ฝ๐—บ๐—ฒ๐—ป๐˜ ๐—”๐—ป๐˜๐—ถ-๐—ฃ๐—ฎ๐˜๐˜๐—ฒ๐—ฟ๐—ป๐˜€

We are all familiar with GoF Design Patterns which represent a general reusable solution to some occurring problems in software design. They are templates for how to solve a problem that can be used many times,โ€ฆ https://t.co/BlBIOrYiQrtwitter.com/i/web/status/1โ€ฆ
If you want to learn more about software development, subscribe to my newsletter: newsletter.techworld-with-milan.com
Read 4 tweets
Jun 29
๐—›๐—ผ๐˜„ ๐—ง๐—ผ ๐——๐—ผ ๐—” ๐—š๐—ฟ๐—ฒ๐—ฎ๐˜ ๐—ฆ๐—ผ๐—ณ๐˜๐˜„๐—ฎ๐—ฟ๐—ฒ ๐——๐—ฒ๐˜€๐—ถ๐—ด๐—ป

In his latest talk at Clojure Conj 2023., Rick Hickey, a creator of Clojure, talked about some great techniques to create a great software design in practice.

Here are the most important ones:

๐Ÿญ. ๐—”๐—ฑ๐—ฑ ๐—ฎโ€ฆ https://t.co/4q7K1hjz3Ktwitter.com/i/web/status/1โ€ฆ
Decision matrix
Story
Read 6 tweets
Mar 18
๐—›๐—ผ๐˜„ ๐˜๐—ผ ๐—™๐—ถ๐—ป๐—ถ๐˜€๐—ต ๐— ๐—ผ๐—ฟ๐—ฒ ๐—ช๐—ผ๐—ฟ๐—ธ ๐—ง๐—ต๐—ฎ๐—ป ๐Ÿต๐Ÿฌ% ๐—ผ๐—ณ ๐—ฃ๐—ฒ๐—ผ๐—ฝ๐—น๐—ฒ

We all struggle with the things we should do next and what to prioritize. Here comes the ๐—š๐—ฒ๐˜๐˜๐—ถ๐—ป๐—ด ๐—ง๐—ต๐—ถ๐—ป๐—ด๐˜€ ๐——๐—ผ๐—ป๐—ฒ (๐—š๐—ง๐——) ๐—ณ๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜„๐—ผ๐—ฟ๐—ธ to help.

๐Ÿงต

Image: @ehamberg.

#productivity
It was developed by David Allen in the 1990s and the main idea behind GTD is that by getting all of your tasks and commitments out of your head and into a trusted system, you can reduce stress, increase productivity, and free up mental space to focus on more important things.
So, how it works is to have the following ๐—น๐—ถ๐˜€๐˜๐˜€:

๐Ÿญ. ๐—œ๐—ป. Here we put all ideas we have as they occur. Write down every task, or idea that comes to mind, no matter how small or insignificant. When you are adding items here, you should ask yourself if this is actionable.
Read 14 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(