Skip to content
tezvyn:

Caching

59 bites tagged Caching — interview questions with model answers, and 60-second explainers.

Databases & Architecture2 min read

Caching: Write-Through for Safety, Write-Back for Speed

Write-through caching writes to the database immediately for data safety, while write-back delays writes for speed. Use write-through for critical data and write-back for high-volume updates.

Databases & Architecture2 min read

Buffer Manager: The Database's Memory Gatekeeper

The buffer manager acts as a database's private RAM cache, deciding which data pages to keep in memory versus fetching from slow disk. It's central to query performance, as it tries to serve all data requests from this fast cache.

Databases & Architecture2 min read

In-Memory Data Grid: A Shared RAM Pool for Your Cluster

An In-Memory Data Grid (IMDG) pools the RAM of multiple computers into one massive, shared data space. It's for high-speed processing on datasets too large for one machine. The footgun is mistaking it for a simple cache; it also provides parallel computation.

Databases & Architecture2 min read

Cache Eviction: Deciding What to Forget

A cache eviction policy is the rule for discarding data when fast-access memory is full. This is crucial for databases and CDNs. The common mistake is assuming one policy, like LRU, fits all workloads, which can cripple performance on certain access patterns.

Databases & Architecture2 min read

Cache-Aside Pattern: Your App Owns the Cache

The Cache-Aside pattern makes your application the gatekeeper for the cache. On a read, your code checks the cache first; on a miss, it fetches from the database and writes to the cache. This speeds up read-heavy apps. The key footgun is stale data.

Databases & Architecture2 min read

Consistent Hashing: Resizing Distributed Systems Gracefully

Consistent hashing prevents mass data reshuffling when servers are added or removed. It maps keys to servers on a logical ring, so only a fraction of keys need remapping during a resize. This is crucial for distributed caches to avoid stampedes.

Databases & Architecture2 min read

Key-Value Store: The Simplest Database Model

A key-value store is a giant dictionary. You give it a unique key, like "user:123", and it returns the associated data. It's the foundation for caching and session management. The footgun is trying to query by value—it's built for key lookups only.

Databases & Architecture2 min read

Materialized Views: Pre-computing Slow Queries

A materialized view trades data freshness for query speed by storing the result of a slow query as a physical table. It's ideal for dashboards that run heavy aggregations, making them load instantly. The footgun is stale data: users see old results.

Cloud Platforms2 min read

Managed In-Memory Data Store: Speed Without the Sysadmin

A managed in-memory store is a high-speed valet for your data, sitting between your app and database to serve requests at microsecond latency. Use it for database acceleration or session stores. The footgun is treating it as a permanent database.

Cloud Platforms2 min read

Content Delivery Network (CDN): Serving Content from the Edge

A CDN is like a global chain of convenience stores for your website's assets. It caches copies closer to users for faster delivery, speeding up images, CSS, and video. The footgun: accidentally caching private user data and serving it to everyone.

Android & Kotlin2 min read

OkHttp Caching: Beyond Simple Hits and Misses

OkHttp's cache acts like a browser's, saving network trips by storing responses on disk. It handles not just full hits and misses, but also validates stale data with the server. Use it for repeatable requests.

Get Caching bites daily.

Five a day, five minutes, offline. With quizzes so it sticks.

Open testing — you’ll join as an early tester.