-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ADR "Include schema in stored data"
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
docs/architecture/decisions/0002-include-schema-in-stored-data.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# 2. Include schema in stored data | ||
|
||
Date: 2023-09-11 | ||
|
||
## Status | ||
|
||
Proposed | ||
|
||
## Context | ||
|
||
The data in this repository must be long lasting: an LPA registered in 2023 will still need to be valid for many years from now. For this to be possible, we will either need to migrate data over time or be able to handle it in its original form. Either way, it is essential that each object in the store is also clear about the shape that it takes. | ||
|
||
## Decision | ||
|
||
- In each object stored in the service, we will include a unique identifier which defines its schema | ||
- In JSONPath syntax, the identifier will be stored in `/_metadata/schema` | ||
- The identifier will be a URI indicating a JSONSchema document defining the full definition of the schema | ||
|
||
## Consequences | ||
|
||
This will give every data point in the store a clear schema, and leave us with no ambiguous data. This means that we can safely migrate any data which, importantly, means that we can always revisit this decision. |