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

    Article · Through the layers

    Where a Rust String Literal Actually Lives

    When you write let s: &str = "hello world", there are really two things in one line, living in two different places. Here is what each one is, where it lives, and why that explains lifetimes.
  • Published on

    Reference · Interrupted execution

    Give Every Agent Tool Call a Deadline

    When an agent calls a tool, it stops and waits. If the tool is slow, the whole turn is slow, and the user waits with it. The fix is small: put a deadline on every tool call.
  • Published on

    Article · Derived state

    How to Keep Two Systems in Sync

    When you sync two systems with webhooks, the copy slowly becomes wrong: some events are lost, some are duplicated, some arrive in the wrong order. Reconciliation is the way to make the two systems agree again. Here is how to design an API for it.
  • 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.