โ Design Systems Database
Collection of top design systems sorted by components and foundational styles.
Handy resource for component research ๐ฏ
Check it out ๐
https://t.co/Qjfq6BJ6Iw
7 Cache Eviction Strategies You Should Know:
1. ๐๐๐๐ฌ๐ญ ๐๐๐๐๐ง๐ญ๐ฅ๐ฒ ๐๐ฌ๐๐ (๐๐๐)
- Removes the least recently accessed item first.
- Works well when older data is less likely to be used again.
- Example: Browser cache, in-memory caches like Redis.
2. ๐๐๐๐ฌ๐ญ ๐ ๐ซ๐๐ช๐ฎ๐๐ง๐ญ๐ฅ๐ฒ ๐๐ฌ๐๐ (๐๐ ๐)
- Evicts the least accessed items over time.
- Prioritizes keeping frequently used items in cache.
- Example: Machine learning inference caches, recommendation systems.
3. ๐ ๐ข๐ซ๐ฌ๐ญ ๐๐ง, ๐ ๐ข๐ซ๐ฌ๐ญ ๐๐ฎ๐ญ (๐ ๐๐ ๐)
- Evicts the oldest stored item first, regardless of usage.
- Simple to implement but may remove still-relevant data.
- Example: Simple queue-based caching systems.
4. ๐๐๐ง๐๐จ๐ฆ ๐๐๐ฉ๐ฅ๐๐๐๐ฆ๐๐ง๐ญ (๐๐)
- Randomly evicts an item when the cache is full.
- Low overhead, but less predictable performance.
- Example: Used in some network routers.
5. ๐๐จ๐ฌ๐ญ ๐๐๐๐๐ง๐ญ๐ฅ๐ฒ ๐๐ฌ๐๐ (๐๐๐)
- Opposite of LRU โ evicts the most recently accessed item first.
- Useful when recent data becomes obsolete quickly.
- Example: Video streaming buffers, certain financial applications.
6. ๐๐ข๐ฆ๐ ๐ญ๐จ ๐๐ข๐ฏ๐ (๐๐๐)
- Items are evicted after a set time limit (expiry time).
- Prevents stale data, useful in distributed systems.
- Example: DNS caching, API response caching.
7. ๐๐ฐ๐จ-๐๐ข๐๐ซ๐๐ ๐๐๐๐ก๐ข๐ง๐
- Uses a fast in-memory cache (e.g., Redis) & a slower persistent cache (e.g., disk-based).
- Optimizes speed & storage by balancing hot and cold data.
- Example: CDN caching, hybrid cloud storage solutions.
๐ก No single strategy is perfectโthe right choice depends on:
- Data access patterns (frequent reads? high writes?)
- System constraints (memory, CPU, disk space)
- Performance trade-offs (latency vs accuracy)
โป๏ธ Repost to help others in your network.
How can you build a reverse proxy in .NET?
A reverse proxy is an intermediary between clients and servers, routing client requests to the appropriate Microservice.
4 common use cases:
- Load balancing
- Monitoring
- Caching
- Security
One more use case for a reverse proxy ๐