Mehdi Akiki

Writing archive

Everything published under Writing, newest first. Each entry is labelled as part of an investigation, an article or reference. Short engineering notes have their own archive.

  • Published on

    Reference · Interrupted execution

    Optimistic Locking With a Version Number

    Two requests read the same row, both change it, and the second save quietly erases the first. A version number turns that silent bug into a conflict you can catch. Here is how optimistic locking works.
  • Published on
    Most API errors are written for a human reading logs, not for the program that has to react. Here is what most APIs do, what the standard says, and the small set of rules that actually make errors useful.
  • Published on

    Reference · Derived state

    Last-Write-Wins Is a Data-Loss Strategy

    When two systems edit the same record, last-write-wins is the easy answer. It also throws away data on purpose. Here is when that is fine, and when it is a trap.
  • Published on
    When you really delete a row, other systems can never learn that it is gone. A tombstone is a delete you can see. Here is why it matters and how to use one.