architecture

  • The DEL that blocked the server, and UNLINK

    A 400ms pause on every request, once an hour, caused by a cache cleanup nobody thought of as expensive. Redis is single-threaded, and freeing memory is work.

  • GTID makes a failover survivable

    With binary log file-and-position replication, promoting a replica means finding the equivalent coordinate on every other replica by hand, at the moment nobody wants to be doing arithmetic.…

  • Read replicas, and the queries that must not use them

    Reads moved to a replica and checkout started showing empty carts. Read-after-write, sticky connections, and measuring the lag rather than assuming it.

  • Log levels mean nothing without a written convention

    Every project has eight levels available and uses three, inconsistently, so error means “something a developer should look at” in one service and “a customer typed the wrong…

  • Shared libraries between services recouple them

    A package holding the shared domain model removes duplication and reintroduces exactly the coupling the split was for: a change to it requires every consumer to upgrade, which…

  • Elasticsearch 6 allows one mapping type per index

    An index could hold several types — product and review in one index — and they shared a Lucene field space underneath, so two types with a field…

  • Multi-stage builds cut the image in half

    17.05 made the two-Dockerfile trick unnecessary. Named stages, what to copy forward, and why the build cache still rewards the order of instructions.

  • Read models can be stale and must say so

    A projection updated asynchronously is behind by some amount, usually milliseconds and occasionally minutes. Hiding that from the caller makes every consumer assume it is current, and one…

  • Domain events belong to the aggregate that raised them

    Publishing an event from a service layer means the aggregate can change state without the event being raised, because the two are in different places and only convention…

  • Bulkheads keep one slow dependency from taking the pool

    The name comes from ship compartments: a breach floods one section rather than the hull. Applied to a request path, it means each dependency gets a share of…