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

المفاتيح الساخنة

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

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

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

في هذا الدرس

detect and mitigate a key that takes a disproportionate share of traffic.

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

  • A hot key: one product during a flash sale. A Redis node (or one instance) serving it becomes the bottleneck.
  • Detect: per-key access counts, redis-cli --hotkeys (needs an LFU policy; verify), or metrics from the client.
  • Mitigate: local L1 cache with short TTL in each instance, replicate the key under several names (product:7#1..#4) and read at random, or serve through CDN.
  • Combine with stampede protection: a hot key expiring is the worst case.
تفاصيل المخطط المبدئي

عرض عملي

read path: Caffeine (2 s TTL) → Redis → database, so 20 instances send at most 10 requests per 20 s to Redis for that key.

اختبر فهمك

How does a short-lived local cache help with a hot key?

أظهر الإجابة

Most reads never reach Redis.

التطبيق

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

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

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

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