Aliens Wiki
Cinematic Knowledge Experience
0%
Aliens Wiki
Now Playing
Aliens Wiki · HIEN
⌨️ Keyboard Shortcuts
Next slide Previous slide SpacePlay / Pause MNarration on/off FFullscreen ?Show/hide this
Press any key to close
Wiki Article · Cinematic

Cache Eviction

Yeh article cache eviction ka complete guide hai — woh process jisme cache full hone pe purani ya…

Overview
🌟

Cache Eviction — Quick Facts

📌

Property: Detail

🎯

Topic: Cache Eviction

Also Known As: Cache replacement, cache expiry,…

🔑

Category: Performance / Caching / Scalability

Topic 1
📥 📥 🧠 🔬 💡 🎯

Infobox

📚 | Property | Detail | |---|---| | Topic | Cache Eviction | | Also Known As | Cache…
Topic 2

What Is Cache Eviction?

💡

LRU: Jo kitaab sabse lambe time se…

🔑

LFU: Jo kitaab sabse kam baar…

FIFO: Jo kitaab sabse pehle rakhi…

🎯

Random: Koi bhi random hatao

Topic 3
📥 ⚙️ 🔬 💡

Why Eviction Is Needed

💡

Cache badhta jayega → memory…

🔑

Redis: maxmemory set nahi kiya →…

Browser: quota exceed → browser…

🎯

CPU: cache fixed size hai →…

Topic 4
📥 ⚙️ 🔬 💡

Eviction Policies Overview

| Policy | Full Name | How It Decides | Complexity | Best For | |---|---|---|---|---| |…
Topic 5
📥 ⚙️ 🔬 💡

LRU — Least Recently Used

🔑 Concept LRU sabse popular eviction policy hai: jo item sabse lambe time se access nahi…
Topic 6

LFU — Least Frequently Used

Concept LFU = jo item sabse kam baar access hua → woh hatao. Frequency-based decision.…
Topic 7
📥 ⚙️ 🔬 💡

FIFO — First In First Out

🌟 Concept FIFO = jo item sabse pehle cache me aaya → woh pehle evict. How It Works 1. Items…
Topic 8
📥 ⚙️ 🔬 💡

TTL — Time-to-Live Based

💡

Lazy: Key access pe TTL check →…

🔑

Active: Har 100ms me random 20…

Topic 9
📚

Random Eviction

📚 Concept Random = koi bhi random item evict karo. No access tracking, no ordering. When…
Topic 10
📥 ⚙️ 🔬 💡

ARC — Adaptive Replacement Cache

💡 Concept ARC = self-tuning algorithm jo LRU + LFU ka balance automatically adjust karta…
Topic 11
🔒

Clock / Second-Chance

🎯 Concept Clock algorithm = LRU ka approximate — OS virtual memory page replacement me use…
Topic 12

Other Policies (LRU-K, SLRU, 2Q, TLRU)

| Policy | Description | Best For | |---|---|---| | LRU-K | Eviction based on K-th last…
Topic 13

Policy Comparison

🔑 | Policy | Hit Rate | Scan Resist | Complexity | Memory Overhead | Implementation |…
Topic 14
📊 🔬

Eviction in Redis

💡

Random sample of keys (default: 5)…

🔑

In me se sabse purana (LRU clock…

maxmemory-samples increase karne…

🎯

Redis 4.0+ me LFU bhi available…

Topic 15
🔒

Eviction in Memcached

🌟 Slab-Based LRU | Feature | Detail | |---|---| | Slab classes | Items size ke basis pe…
Topic 16
📥 ⚙️ 🔬 💡

Eviction in CDN

🚀 | Factor | How CDN Evicts | |---|---| | TTL | Origin server Cache-Control/Expires headers…
Topic 17

Eviction in CPU Cache

📚 Set-Associative Cache | Term | Description | |---|---| | Set | Cache lines ka group…
Topic 18

Eviction in OS (Page Replacement)

💡 Virtual Memory Context OS RAM pages ke liye eviction decide karta hai — RAM full hone pe…
Topic 19
🔒

When to Use Which Policy

🎯 | Workload Type | Recommended Policy | Reason | |---|---|---| | General web app cache |…
Topic 20

LRU Eviction Flow — Mermaid Diagram

`mermaid flowchart TD REQ["cache.get(key) or cache.put(key, val)"] CHECK{"Key exists\nin…
Topic 21
📥 ⚙️ 🔬 💡

Common Mistakes

🔑 1. No maxmemory Set (Redis/Memcached) ` Problem: Cache server pe maxmemory nahi set kiya.…
Topic 22
📊 🔬

Best Practices

1. Choose Policy Based on Workload Default LRU best for most cases. Frequency-heavy (CDN,…
Topic 23

Interview Perspective

🌟 Q1: LRU eviction policy kya hai aur O(1) me kaise implement hoti hai? A: LRU (Least…
Topic 24

Glossary

🚀 | Term | Definition | |---|---| | Eviction | Cache full hone pe item hatana | | Eviction…
Comparison

Policy Comparison

⚖️

LRU: Good

⚖️

LFU: Good (frequency workloads)

⚖️

FIFO: Fair

Diagram
📥 ⚙️ 🔬 💡

Visual Flow

📊 Diagram visualization — details in narration
Related Topics

See Also

📖

Cache — General caching concepts

🔗

Cache coherence — Multi-cache…

💡

Cache API — Browser Cache API

📚

Redis — In-memory cache + data…

🔑

Memcached — High-throughput caching

🌐

CDN — Content delivery caching

Quick Quiz
🧠 QUIZ TIME

Quiz — Question 1

Cache Eviction ka sabse sahi definition kya hai?

Quick Quiz
🧠 QUIZ TIME

Quiz — Question 2

Cache Eviction ka 'Topic' kya hai?

Complete! 🎉
COMPLETE

Cache Eviction Complete!

Aliens Wiki · HIEN · Cinematic Knowledge

Cache Eviction Complete

➡️

Cache — General caching…

1/32
0:00
REC 00:00ESC=Cancel
Aliens School
3
Recording shuru hone wali hai...
Recording Complete
Video process ho rahi hai...
Live Class
Slide 1 / 7
Timer
00:00
📝 Speaker Notes
⏭️ Up Next
🗂️ All Slides