liveBook · Manning

Write skew

As explained in Microservices Patterns, Second Edition

A concurrency anomaly in which concurrent operations read overlapping data and update disjoint data in a way that violates an invariant.

Write skew occurs when concurrent sagas read overlapping data, then update different data in ways that violate a business invariant. Local transaction correctness does not provide global isolation across services. section 9.3.1

Order creation and cancellation

A cancel-order saga can temporarily increase available credit, allowing a concurrent create-order saga to succeed even though the customer lacks sufficient credit. section 9.3.1

Figure 9.8 Concurrent execution of these two sagas enables the Create Order Saga to succeed even though the Customer has insufficient available credit. This occurs because the Cancel Order Saga temporarily increases the available credit.
anomaly example scenario 2

The figure traces how concurrent order sagas can produce an invalid credit outcome. section 9.3.1

How Microservices Patterns, Second Edition covers it

How deep it goes
Defines the anomaly and situates it among saga interleavings, without detailing a prevention strategy.
Examples
Uses concurrent create-order and cancel-order sagas that affect customer credit.
What you can do after
Understand how concurrent sagas can violate business invariants despite locally correct transactions.
How it connects
Connects write skew to sagas, microservices, local transactions, and business invariants.

Also explained in

Compare how 2 books explain write skew →

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.