logoNEURAL COOK
SearchAll PostsTagsNotesAuthor
instagramtwitterfacebookyoutubelinkedinmailgithubrss
Copyright © 2026 All rights reserved.
•
VIKI
Built with Vikramaditya Singh
Built with
VIKI - A posts created with Next.js and Tailwind.css
About
API Gateway
Batching
Cache
CAP
Consistent Hashing
Counting At Scale
CQRS
CRDT
Database Scaling
Database Selection Strategy
Event Sourcing
Handling Failure
Vertical vs Horizontal Scaling
Id Generation
Indexes
Kafka
Kubernetes
Large Files
Load Balancing
Proxy
Real Time Push
Redis
Scaling Reads
Stateless vs Stateful Systems
Scaling Writes
System Design

Cache

# Cache-aside

# Hot Key

Cache invalidation is a consistency protocol

  • use versioned cache entries or conditional writes so that an older in-flight write can not overwrite a newer value.

# Production improvements

# Single-flight/request coalescing

one in-flight refresh per key, with a bounded number of waiters.

# TTL jitter

spread expiration times to prevent synchronized expiry.

# Stale-while-revalidate

serve stale data only where the freshness policy permits it.

# Negative caching

cache selected “not found” results briefly, while avoiding poisoning or stale authorization outcomes.

# Refresh-ahead

proactively refresh hot keys whose expiry would cause an expensive miss.

# Bounded fallback

Prevent every request from independently hitting the source during a cache failure.

# HTTP Cache

For shared HTTP caches, define Cache-Control, validators such as ETag, and variation behavior correctly. A GET request is not automatically safe to cache, and cache directives must align with the response's authorization semantics.

PreviousBatchingNextCAP
CONTENTS
Cache-asideHot KeyProduction improvementsSingle-flight/request coalescingTTL jitterStale-while-revalidateNegative cachingRefresh-aheadBounded fallbackHTTP Cache