From 113a38e6e35cbfe05ee716d3e00af16a4083fb45 Mon Sep 17 00:00:00 2001 From: Greg Tyler Date: Mon, 11 Sep 2023 15:34:14 +0100 Subject: [PATCH] Add ADR "Include schema in stored data" --- .../0002-include-schema-in-stored-data.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 docs/architecture/decisions/0002-include-schema-in-stored-data.md diff --git a/docs/architecture/decisions/0002-include-schema-in-stored-data.md b/docs/architecture/decisions/0002-include-schema-in-stored-data.md new file mode 100644 index 00000000..c223ebdb --- /dev/null +++ b/docs/architecture/decisions/0002-include-schema-in-stored-data.md @@ -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.