architecture

  • Cursor pagination survives an insert; offset does not

    Offset pagination on a list ordered by recency shows an item twice when a new row arrives between page one and page two, and skips one when a…

  • Repository interfaces belong to the domain, not the ORM

    A repository interface that returns Eloquent models and accepts query builders has not abstracted anything — it has renamed the ORM. The named method rather than a generic…

  • Window functions replace a habit

    8.0 went GA in April and the correlated subquery can retire. The plans before and after, the recursive CTE that replaces a loop, and the upgrade nobody expects.

  • PSR-15 middleware, and the interface it standardised

    Every framework had middleware and none of them agreed on the signature, so a piece of middleware was written once per framework despite doing the same thing. The…

  • What the regulation actually asks of a schema

    The deadline is in May and the work is not a cookie banner. An inventory first, because everything else depends on knowing which tables hold what.

  • The outbox pattern, in the smallest version that works

    Writing a row and publishing an event are two systems, and there is no way to make them atomic — so either the row exists and no event…

  • Consent is a record with a timestamp, not a boolean

    A marketing_opt_in column stores the current answer and nothing else, and the question that gets asked is always “when, and to what exactly did they agree”. Append-only is…

  • webpack 4 needs almost no configuration

    One line replaced about eighty. The defaults are almost always right, and the cost is that they are invisible when they are not.

  • An error code is a contract, an error message is not

    A client matching on the text of an error breaks when somebody improves the wording, translates it, or fixes a typo — and every one of those will…

  • Laravel 5.6 and logging you can configure

    Logging moved into a config file, and stacks are why it matters — a different format per destination, decided without touching a service provider.