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

تحديد المعدّل الموزّع

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

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

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

في هذا الدرس

make limits correct across several instances.

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

  • An in-memory limiter behind a load balancer gives each instance its own counter: the real limit is multiplied by the instance count.
  • Use a shared store (commonly Redis with an atomic script) or enforce at a single edge such as the gateway.
  • Atomicity matters: read-modify-write races let extra requests through.
  • Accept approximation: local buckets that sync periodically trade accuracy for speed.
  • Decide failure behavior when the store is down: fail open (allow) or closed (reject), per endpoint risk.
تفاصيل المخطط المبدئي

عرض عملي

a diagram: three gateway instances sharing one Redis counter per customer; request flow with allow or 429.

اختبر فهمك

Why is a per-instance in-memory limit wrong for a limit of 100/min with 3 instances?

أظهر الإجابة

Each instance allows 100, so up to 300 in total.

التطبيق

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

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

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

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