What may degrade, and what must fail fast
Six services sit between a buyer clicking "buy" and a vendor eventually getting paid: auth , gateway , catalog , inventory , order , and now settlement . Any one of them can be slow, restarting, or fully down at any moment — that's the normal condition of a distributed system, not an incident you fix once and move past. The question worth writing down isn't "how do we prevent that." You can't,…
The article discusses the importance of understanding how different services in a distributed system can degrade or fail, and how to handle these situations in a way that minimizes business impact. The author argues that there is no one-size-fits-all approach, and that the decision to degrade or fail fast should be based on the potential business cost of a wrong guess.
For example, services like catalog or inventory can degrade gracefully, serving cached data or an empty result, as the worst-case scenario involves cosmetic issues that self-correct once the service is restored. On the other hand, services like inventory or order creation must fail fast, as the worst-case scenario involves overselling or double-spending, which cannot be corrected once it happens.
The article concludes by emphasizing the need for a conditional-update invariant, where the business cost of a wrong guess is reversible, and provides guidance on how to apply this principle to real-world code.
Brief written by urgent.news from Dev.to's own syndicated text. Machine-written — may contain errors; check the original before relying on it.