architecture

  • 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…

  • A first serious attempt at Docker for local development

    Two days lost to PHP extension mismatches. A container per service, what the shared-folder performance problem costs on a VM, and whether it was worth it.

  • Utils classes are where responsibilities go to hide

    A class named Utils, Helpers or Common has no definition, so nothing can be excluded from it. It grows monotonically, it is imported everywhere, and it ends up…

  • Filtering a WooCommerce catalogue without the meta tables

    Five filters over 30,000 variations, and a request that never returns. Replacing EAV meta joins with a denormalised index table kept in sync by product hooks.

  • Dependency injection works fine without a container

    Dependency injection is passing collaborators in rather than constructing them inside. A container is a tool for assembling those graphs automatically. The two get conflated so thoroughly that…

  • Restructuring an application for Laravel 5

    4.2 to 5.0 is not an upgrade, it is a relocation. Moving an application through it in an order that keeps it booting at every step.

  • A service layer is where the fat controller was going anyway

    Business logic in a controller is reachable from exactly one place: an HTTP request. The first time the same operation is needed from a console command, a queue…

  • A Redis cache layer that does not go stale

    The cache made it fast and made it wrong. Key design, invalidation on write rather than on a timer, and why KEYS is the command that takes the…