Repaso
EspaƱol
System DesignCoreSD-32

Why does a cache make reads faster?

Options

  1. It compresses the database to make it smaller
  2. Hot data sits in fast storage, skipping slower work (Correct option)
  3. It deletes old rows from the main database
  4. It encrypts the data before it is read back

Answer

It keeps copies of frequently used data in fast storage (usually memory), so you skip slower work like a database query

Why

Reading from memory takes microseconds; a database query or an external API call can take milliseconds or more.

A cache stores results you already computed or fetched, so the next request gets them instantly.

The hard part is freshness: cached data can be outdated, so entries get an expiry time (TTL) or are deleted when the data changes.

Remember

Cache = fast copy of data you will need again.

Key terms

Practice this question in Repaso