The calculation phase computes the next version of system data without changing the current state. A mutation separates this stateless work from the stateful commit phase, which advances the system-state reference afterward. section 4.0 section 4.8
The calculation phase is characterized by:
- Using immutable functions to create a new data version rather than modifying received data. section 4.8
- Remaining stateless and specific to the mutation, while common commit code manages the state reference. section 4.0
- Computing in isolation under optimistic concurrency control; reconciliation or abortion belongs to the commit phase. section 5.1
Adding a library member
Library.addMember reads the current user-management data, creates a new version containing the member, places it into a new library version, and returns that version. The current library remains unchanged until the commit phase advances the system-state reference. section 4.5
Table 4.1 The two phases of a mutation (view table figure)
Compare calculation and commit by responsibility, statefulness, and implementation specificity. section 4.0
