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

التصميم للاتساق النهائي

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

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

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

في هذا الدرس

make lag a designed behavior, not a surprise.

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

  • Show honest intermediate states: "order pending", "payment processing".
  • Return 202 Accepted with a status URL for work that finishes later.
  • Read-your-writes tricks: read from the primary after a write, return the created resource in the response, or pass a version the reader waits for.
  • Make updates idempotent and commutative where possible so order does not matter.
  • Expect conflicts to be rare but define a rule (last write wins, merge, or ask the user).
تفاصيل المخطط المبدئي

عرض عملي

text
POST /orders          -> 202 Accepted, Location: /orders/42
GET  /orders/42       -> {"status":"PENDING"}  ...later...  {"status":"CONFIRMED"}

اختبر فهمك

Why return PENDING rather than waiting inside the POST?

أظهر الإجابة

Downstream steps are asynchronous; waiting hides lag and ties up resources.

التطبيق

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

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

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

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