Version
A version identifies a point in an entity history at which a particular state became current.
Entity state can be addressed as identity + version. In event-state duality, for a sequential entity, state at version V is the result of applying the event that produced version V.
Optimistic concurrency control is implemented with an expected-version or etag check: a command carries the version of entity state the observer believed was current, and the transition may commit only if that expectation still matches the entity's current version at the commitment boundary.
Versions support:
- Current-state addressing.
- Historical state references.
- Optimistic concurrency through expected-version or etag checks on commands.
- Ordering of entity state observations over time.
A version need not be a single scalar counter. In distributed or replicated histories, version may be realized by logical timestamps, causal contexts, vector-clock-like metadata, branch heads, commit identifiers, or other time, ordering, and version-history mechanisms.
If a command is rejected and no accepted state change occurs for the target entity, the entity version remains unchanged.
Related concepts: identity, state, entity, event, event-state duality, command, concurrency control, version histories, consistency models, time, ordering, fibrations and indexed structure, enrichment and order.