A simulation model is an executable representation of a system whose behavior can be observed in a simulator. When business logic accesses mutable key–value state, the model must represent that state explicitly rather than treating the simulator as stateless. section 8.2.2
A stateful simulation model should make several design choices explicit:
- Keep simulator state in memory when the real system would use an external key–value store. section 8.2.2
- Use independently mutable values when concurrent updates should avoid replacing the entire map. section 8.2.2
Fine-grained simulated storage
A runtime can store a map from keys to independently mutable values: MVar (Map Key (MVar Value)). Updating one value then avoids rebuilding and replacing the whole map, unlike CoarseGrainedMap = MVar (Map Key Value).
