Basic cache-aside-க்கு அப்பால், பல caching strategies உள்ளன — cache-aside, write-through, write-behind, read-through — ஒவ்வொன்றும் வெவ்வேறு consistency மற்றும் performance trade-offs உடன் இருக்கிறது. அவற்றைப் புரிந்துகொள்ளுதல் (மற்றும் eviction policies) effective caching-ஐ வடிவமைக்க உதவுகிறது.
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
