الاستمرارية والذاكرة والإخلاء
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
know what survives a restart and what happens when memory is full.
الموضوعات المخطط لها
- RDB: periodic snapshots; fast restart, may lose the last minutes.
- AOF: log of writes, with
fsyncpolicies (every second, always); less loss, bigger files. - No persistence is valid for a pure cache. Replication does not replace backups, and failover can lose recent writes.
- Set
maxmemoryand an eviction policy (allkeys-lru,allkeys-lfu,volatile-*, ornoeviction). noevictionmakes writes fail when full; a cache usually wants anallkeys-*policy.
تفاصيل المخطط المبدئي
عرض عملي
config lines maxmemory 512mb, maxmemory-policy allkeys-lfu, appendonly yes, appendfsync everysec.
اختبر فهمك
If Redis is the only copy of an order and the node dies, what is lost?
أظهر الإجابة
Anything not yet persisted or replicated: possibly the order. Never use it as the only copy.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.