انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهMID-039-L04

استراتيجيات الإبطال

  • الدرس 4 من 5
  • Mid-level
في هذا الدرس 4 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

choose how entries stop being stale.

الموضوعات المخطط لها

  • TTL only: simple, but data is wrong for up to the TTL; unacceptable for prices.
  • Explicit invalidation on write: delete the key in the same service that writes.
  • Event-driven: the owner publishes ProductUpdated; every cache subscriber evicts or refreshes. Works across services.
  • Best practice: events plus a TTL as a safety net for lost events.
  • Deleting is safer than updating the cache: the next read loads the freshest data.
تفاصيل المخطط المبدئي

عرض عملي

StrategyStalenessCost
TTL onlyup to TTLnone
Delete on writetinycoupling
Event + TTLsecondsbroker

اختبر فهمك

Why keep a TTL when you have events?

أظهر الإجابة

Events can be lost; the TTL bounds the damage.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.