Data Storage

We use the event sourcing pattern for storage. Changes in state are only made through inserts of new records. Updates, deletes, and replace operations are not used. This way, there is a full record of all changes in state.
The event sourcing pattern typically involves only inserting the changes in state rather entering the entire record. However, creating a projection for the current state through MongoDB requires quite a significant amount of work for each collection. For this reason, we re-insert the entire record for state changes (including the updated fields) instead of only inserting the state changes. This may be revised in the future when there are more resources to dedicate to this.
Also, services cannot write directly to the database to improve the security around state changes. Instead, you must the database-service. Contact Kombatbra for authentication details in the development environment.