liveBook · Manning

Version file

As explained in Microservices Patterns, Second Edition

A version file is a record of operations on a database record that allows those operations to be reordered during concurrent processing.

A version file records operations performed on a database record so concurrent updates can be reordered. It is an application-level countermeasure for the missing isolation of multi-database architectures that do not use distributed transactions. section 9.3.2

Use a version file when concurrently executing sagas can produce anomalies such as lost updates, dirty reads, or fuzzy reads. It belongs alongside other saga countermeasures rather than replacing transaction isolation universally. section 9.3.2 section 9.4

Select the concurrency countermeasure according to the anomaly and business risk:

  • Use a semantic lock when an application-level flag must signal that a record is being changed. section 9.3.2
  • Use commutative updates when operations can safely execute in any order. section 9.4
  • Use a pessimistic view to reorder saga steps and minimize business risk, or reread values to detect changes before overwriting. section 9.3.2

How Microservices Patterns, Second Edition covers it

How deep it goes
Defines the pattern and its concurrency purpose but does not detail a concrete storage format or reordering algorithm.
What it assumes
Assumes familiarity with sagas, concurrent processing, database records, and the absence of transaction isolation.
What you can do after
Evaluate version files as one application-level option for mitigating concurrency anomalies in saga-based microservice architectures.
How it connects
Connects version files with sagas, transaction isolation, distributed transactions, and lost updates.

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.