system-design

  • Designing an API two mobile clients can live with

    Two apps, two release cycles, and neither can be forced to update. What is additive, what is not, and the decisions that have to be made before the…

  • Centralised logging that answers a question

    Four servers, eleven log files, and an incident reconstructed from three of them. Shipping first and parsing second, structured events, and the correlation id that makes it useful.

  • A timeout is not a concurrency limit

    Setting a five-second timeout on a slow dependency feels like protection and is not: with twelve PHP-FPM workers and a dependency taking five seconds, twelve concurrent requests occupy…

  • An event-driven seam between two services

    The synchronous call between two services was the reason both were down. Publishing an event decouples their availability — and makes eventual consistency a business decision.

  • A service that owns no data is a function

    A service extracted for organisational reasons but reading and writing another service’s tables has all the costs of a network hop and none of the independence. It cannot…

  • Schema changes that do not need a maintenance window

    An ALTER on a 40 million row table held a metadata lock behind every query. Expand, migrate, contract turns one blocking release into three safe ones.

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

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

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

  • Choreography and orchestration are both fine and different

    Choreography has each service react to events and know nothing about the whole; orchestration has one component call the others in order. The first is presented as the…