Consistency means that a committed transaction leaves the system in a valid state, preserving defined invariants and constraints. The application logic and constraints executed within the transaction are responsible for preserving them; they must hold at the commit boundary. section 9.1.1
In a saga, local transactions commit separately and the saga lacks ACID isolation. Preserving consistency across its steps therefore requires application-level design techniques. API composition has a related limitation: queries across services lack transactional data consistency and can return mismatched results while updates are in progress. section 9.2 section 12.2.4
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
A transaction groups product lookup, credit validation and deduction, and order insertion before commit. section 9.1.1
Figure 12.7 Querying the providers while other system commands are updating the data can result in the provider services returning inconsistent results. In this scenario, the Order is canceled in the Order Service but the Ticket is not yet cancelled in the Kitchen Service.
A query across services can observe an order canceled in one service while its kitchen ticket remains uncanceled in another. section 12.2.4



























