Caching
30 items tagged with "caching"
Patterns14
Lazy Initialization
Defers the creation or computation of an object until the first time it is actually needed, avoiding upfront cost for resources that may never be used.
Multiton
Generalizes Singleton to manage a fixed, keyed set of named instances, ensuring exactly one instance exists per key through a registry.
Proxy
Provides a surrogate or placeholder for another object to control access to it, enabling lazy loading, access control, caching, or remote access.
Distributed Lock
Coordinates exclusive access to a shared resource across multiple processes or nodes that do not share memory.
Consistent Hashing
Distributes keys across nodes so that adding or removing a node remaps only a small fraction of keys.
Cache-Aside
Load data into a cache on demand from a data store to improve read performance and reduce load on the backing store.
Materialized View
Precompute and store read-optimized views of data so expensive queries become fast lookups against ready-made results.
Content Enricher
Augments a message with additional data from an external source when the original lacks information the receiver requires.
Read-Through Cache
A caching strategy where the cache itself loads missing data from the backing store on a miss, so application code reads only from the cache.
Write-Through Cache
A caching strategy where every write goes to the cache and the backing store synchronously, keeping the two consistent at the cost of write latency.
Write-Behind Cache
A caching strategy where writes update the cache immediately and are flushed to the backing store asynchronously, maximizing write throughput at the cost of durability.
Refresh-Ahead Cache
A caching strategy that proactively reloads hot entries before they expire, so reads of popular keys never pay miss latency.
Materialized View
A precomputed, stored result set that trades storage and refresh cost for fast reads of expensive queries, aggregations, or denormalized projections.
Request Coalescing
Merges multiple concurrent identical requests into a single backend call and shares the result, preventing duplicate work and cache-stampede overload.
Anti-Patterns3
Unbounded Cache
A cache with no size limit, eviction, or expiry that grows until it consumes all memory and turns a performance optimization into an out-of-memory failure.
Cache Stampede (Dogpile Effect)
When a hot cache entry expires, many concurrent requests all miss and recompute it at once, hammering the backing store and amplifying load instead of absorbing it.
Over-Caching
Adding caches everywhere to chase speed, multiplying staleness, invalidation bugs, and operational complexity for marginal gains that profiling never justified.
Tutorials3
Implementing Redis Caching in Node.js
Add Redis caching to your Node.js application for improved performance
Setting Up a Monorepo with Turborepo
Create and manage a monorepo using Turborepo for efficient builds
How to implement the cache-aside pattern with Redis
Add a Redis read-through cache with TTLs and safe invalidation to reduce database load, including stampede protection.
Comparisons2
Benchmarks2
In-Memory Store Benchmark (memtier/redis-benchmark)
Benchmarks for in-memory data stores like Redis and Memcached, measuring operations per second and sub-millisecond latency under varied key/value and pipeline settings.
CDN Latency Benchmark
Measures content delivery network performance from many geographic vantage points, including edge latency, cache hit ratio, and origin offload.
FAQs2
When should I use Redis?
Redis is an in-memory key-value data store known for very low latency, making it ideal as a cache in front of a slower primary database. Beyond cachin...
What is a CDN?
A content delivery network (CDN) is a geographically distributed set of edge servers that cache and serve content close to users, reducing latency and...
Glossaries2
Content Delivery Network (CDN)
A content delivery network is a geographically distributed set of servers that cache and serve content from locations near users, reducing latency and offloading origin servers.
Materialized View
A materialized view is a database object that stores the precomputed result of a query physically on disk, so reads return instantly without re-executing the underlying query, at the cost of keeping the result refreshed.