Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ADR "Include schema in stored data" #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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. We will also continue to add data over many years. During this time it is likely that we will change the shape of the data.

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 document in the store is also clear about its shape.

## Decision

- Each document stored in the service will include a unique identifier which defines its schema
- The identifier will be a URI indicating a JSONSchema document defining the full schema definition
- The identifier will be stored in a `$schema` property on the root of the document

## 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.