liveBook · Manning

Partial failure

As explained in Microservices Patterns, Second Edition

A distributed-system failure in which an invoked service is unavailable or responds with excessive latency while other components continue operating.

Partial failure occurs when a remote service is unavailable or responds too slowly, or when a multi-step operation stops after only some state changes. In either case, other components may continue operating while the requested work remains incomplete. section 8.4 section 9.1.1

Choose safeguards according to where the failure occurs:

  • For synchronous calls, handle partial failures with resiliency patterns such as circuit breakers to help prevent failures from cascading. section 8.4
  • For commands with multiple state changes, use transaction boundaries to define whether the changes succeed or fail together. section 9.1.1

Creating an order

An order command can retrieve a product price, reserve customer credit, and insert an order. If it fails after only some changes, the system may be left inconsistent. section 9.1.1

BEGIN TRANSACTION

SELECT * FROM PRODUCTS WHERE PRODUCT_ID = ?

UPDATE CONSUMER
  SET AVAILABLE_CREDIT = AVAILABLE_CREDIT - ?
  WHERE CONSUMER_ID = ?
    AND AVAILABLE_CREDIT >= ?

INSERT INTO ORDERS (...) VALUES (...)
COMMIT TRANSACTION

This transaction listing groups the order-related database operations behind a single commit boundary. section 9.1.1

How Microservices Patterns, Second Edition covers it

How deep it goes
Defines remote-call failures and incomplete state updates, then points to resiliency and transaction handling without detailing implementation.
Examples
Uses order creation with product lookup, credit reservation, and order insertion to expose incomplete updates.
What you can do after
Apply resiliency patterns, including circuit breakers, to synchronous clients and group multi-step state changes within transaction boundaries.
How it connects
Connects to synchronous remote procedure invocation, circuit breakers, and transactions.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microservices Patterns, Second Edition. The section links point to the parts of the book it draws on.