# Architecture principles whose scope is persistence

> 6 records

This index as JSON: https://banes-lab.com/json/api/facets/architecture/scope/persistence

## Entries

- [Data Contract](https://banes-lab.com/records/architecture/data-contract.md): A rule or precondition that data exchanged between parties has declared fields, types, nullability and meaning.
- [Event Sourcing](https://banes-lab.com/records/architecture/event-sourcing.md): A design pattern that stores state as the sequence of events that produced it and rebuilds current state by replaying them.
- [Outbox Pattern](https://banes-lab.com/records/architecture/outbox-pattern.md): A design pattern that writes an outgoing message in the same local transaction as the state change, and a relay publishes it afterwards.
- [Unit of Work Pattern](https://banes-lab.com/records/architecture/unit-of-work-pattern.md): A design pattern that collects the changes of one use case and commits them together in a single transaction.
- [Optimistic Locking](https://banes-lab.com/records/architecture/optimistic-locking.md): A design pattern that checks a record's version when it is written and rejects the write if another writer changed it first, comparing only the writer's own span where a surface is fenced per writer.
- [Pessimistic Locking](https://banes-lab.com/records/architecture/pessimistic-locking.md): A design pattern that locks a record before reading it for update, so other writers wait until the transaction ends.
