...
- Object Oriented
- Abstraction of underlying Database tables
- Simplifies tables
- Correctly linked to related objects
- Dynamic
- Primary key (Database Id)
- Automatically assigned by system
- Immutable
- Random UUID
- Used in relationships between objects
- Natural Id
- User /or Auto assigned identifier
- Human-readable reference number
- May be mutable
- Not used in relationshiprelationships
- https://usas.docs.ssdt.io/current/model/
- https://usps.docs.ssdt.io/current/model/
...
- If operation fails (due to crash):
- USxS transaction can be partial posted
- Files left in inconsistent state (out of balance)
- Example: Post Purchase Order:
- Write PO header record
- Loop for each PO Item:
- Write item record
- Update encumbrances on budget
- Update encumbrances on appropriation
- Update encumbrances on cash
...
- If any of above steps fail, files can be out of balance
Redesign Solution
- SQL Databases provide "Transactional Scope"
- All operations within scope guaranteed to, either:
- Succeed completely (commit)
- Fail completely (rollback)
- Any error causes rollback:
- Duplicate key
- Validation error
- Security violation
- System failure
Transactions, Events, Processing, Listeners & Rules
Security