على الرغم من أن Redis موجود في الذاكرة، إلا أنه يمكنه الاحتفاظ بالبيانات على القرص بحيث تبقى البيانات موجودة بعد إعادة التشغيل. يوفر آليتين — RDB (لقطات في نقطة زمنية معينة) و AOF (سجل إضافي للعمليات) — مع مقايضات مختلفة بين المتانة والأداء.
RDB — لقطات في نقطة زمنية معينة
RDB takes SNAPSHOTS of the dataset at intervals, saving a compact binary file.
✓ Compact single-file backups; fast restarts (load the snapshot)
✓ Good for backups and disaster recovery; less impact on performance
✗ You can LOSE data since the last snapshot (e.g. last few minutes) if Redis crashes
→ Configure save points: e.g. "save after 900s if ≥1 change, 300s if ≥10 changes"
