The Real Fullstack

Last Write Wins (Somebody Else's)

You fixed the title on your laptop. Why does your phone put the old one back?

مهندس أول9 دقيقةمحاكي الخط الزمنيمختبر تصحيح الأخطاء
cassandradynamodbkafkamobile

لم يُترجم هذا التحدي إلى العربية بعد. أنت تقرأ النسخة الإنجليزية.

المهمة:Predict which edit survives, find why wall-clock ordering loses data, and make conflicting edits detectable instead of silently resolved.السياق · أهداف التعلّم ▾

Fernpost Notes syncs offline edits. The server resolves conflicts with “last write wins” using the timestamp sent by the device. Phone clocks drift, offline edits arrive late, and users report changes disappearing.

المهمة: Predict which edit survives, find why wall-clock ordering loses data, and make conflicting edits detectable instead of silently resolved.

أهداف التعلّم

  • Understand why wall clocks cannot order events across devices.
  • Detect concurrent edits with versions and conditional writes.
  • Merge or surface conflicts instead of discarding one side.
المحاكاةمحاكاة
phone (offline edit)laptopsync APInotes store
تشغيل المحاكاة
-- each note carries a version; clients send the version they editedUPDATE notes SET title = :title, body = :body, version = version + 1 WHERE id = :id AND version = :baseVersion;-- 0 rows → someone changed it since: return 409 with the current note,-- and let the client merge field by field (or ask the user)

تبسيط

Two symptoms with deterministic fixes. CRDTs are another option for collaborative text. نموذج تعليمي — الأرقام توضّح سلوكًا وليست قياسات أداء.

المفاهيم

مفيد قبل هذا التحدي

تحديات ذات صلة

المراجع