architecture

  • The outbox pattern for a write and a message

    Saving an order and publishing an event are two systems, and there is no transaction across them. Whichever order they happen in, a failure between them leaves the…

  • The N+1 queries you did not write

    1,400 queries on a page showing 40 rows. Eager loading, the difference between with() and load(), and the accessor that no eager load can fix.

  • Moving catalogue search off MySQL and onto Elasticsearch

    LIKE cannot use an index and everyone knows it. The mapping, the analyzers that decide what matching means, the indexing pipeline, and the drift it introduces.

  • Versioning an API is versioning a promise

    Version numbers in a URL suggest that consumers can be moved forward on a schedule. They cannot — a mobile application on a customer’s phone is a client…

  • At-least-once means the consumer must be idempotent

    Every broker worth using guarantees at-least-once delivery, and the phrase is a warning rather than a feature: a message can and will arrive twice. Exactly-once is not available…

  • The strangler pattern needs a router in front of it

    Replacing a system incrementally requires something able to send some requests to the old implementation and some to the new. Without it, the migration is all-or-nothing however carefully…

  • An anti-corruption layer for the API you cannot change

    Integrating with a third party whose model does not match yours spreads their vocabulary through your codebase — their status codes, their date format, their idea of what…

  • Finding the 200 milliseconds nobody could account for

    The page took 340ms and the parts added up to 140. Measuring from the first byte nginx sees rather than from the framework boot, and what was hiding…

  • A shared database is coupling you cannot see

    Two services with their own repositories, deployments and teams still cannot change independently if they read the same tables. The dependency is real and invisible — nothing in…

  • A bounded context is a vocabulary boundary

    The word usually gets explained in terms of services and databases, which puts the mechanism before the reason. A bounded context is the region within which a word…