Uncategorized

  • replaceAll, and the regex with /g you no longer need

    String.replace with a string pattern replaces the first occurrence only, which is the most surprised anybody has been by a standard library method. Escaping user input to build…

  • The leftmost prefix rule, and three indexes that are one

    A composite index serves any query using a leftmost prefix of its columns, which means three separate indexes are frequently one index somebody did not notice. The gap…

  • Problem Details, and an error format that is not invented here

    Every API invents an error envelope, and RFC 7807 is a perfectly good one that client libraries already understand. type is the field a client should branch on…

  • Http::pool, and five requests in the time of one

    Five sequential API calls of 180 milliseconds each is nine hundred milliseconds of a request spent waiting, and they had no dependency on each other. Naming the requests…

  • A retry budget bounds total load, not per-caller load

    Three retries per caller sounds modest and means four times the load on a struggling dependency, which is the opposite of what a retry is for. A budget…

  • A covering index, and the table it never touches

    An index containing every column a query needs answers it without reading the table, which on a wide row is the difference between one page read and two.…

  • Uploading an artifact for a job that failed

    A failed job stops at the failing step, so the upload step that would have captured the screenshots never runs. if: failure() is the one that belongs on…

  • Jitter matters more than the backoff curve

    Exponential backoff spreads a single client’s retries over time and does nothing about a thousand clients retrying in lockstep after one outage. The recovering-service failure is the one…

  • SELECT FOR UPDATE SKIP LOCKED, and the queue in a table

    SKIP LOCKED lets several workers claim different rows from one table without blocking each other, which is what makes a database usable as a queue. This is genuinely…

  • Two runtimes, one health check format

    A load balancer, an orchestrator and a monitoring system each want a health endpoint, and two services answering differently is two integrations. Excluding third-party dependencies is the rule…