मूलभूत cache-aside पलीकडे, अनेक कॅशिंग स्ट्रॅटेजी आहेत — cache-aside, write-through, write-behind, read-through — प्रत्येकाचे वेगवेगळे सुसंगतता आणि कार्यक्षमता ट्रेड-ऑफ्स आहेत. त्यांना समजून घेणे (आणि eviction policies) प्रभावी कॅशिंग डिজाइन करण्यास मदत करते.
Cache-aside (lazy loading — सर्वात सामान्य)
App checks cache → miss → load from DB → populate cache → return.
✓ Only requested data is cached (efficient); resilient (works if cache is down)
✗ First request is a miss (slower); cache can be stale until TTL/invalidation
→ The default, most common strategy.
Write-through आणि write-behind
WRITE-THROUGH → write to cache AND DB together (synchronously) on every write
✓ Cache always fresh/consistent ✗ Writes are slower (two writes); caches unread data
WRITE-BEHIND (write-back) → write to cache immediately, write to DB ASYNC later
✓ Fast writes ✗ Risk of data loss if cache fails before the DB write; more complex
