An append-only datastore with API to store all published versions of a document.
- As a citizen, I need to see change history of a document so I can see how a policy or official document evolves over time (TRUST)
- As someone whose job relies on historical versions (e.g a tax accountant, lawyer), I need to be able to see older versions of documents from specific points in time, so I can refer to them
- MongoDB datastore with a single collection:
{
"change_note": "Updated due to x",
"updated_at": Date(),
"base_path": "/base-path-to-document",
"document": {}
}
- Simple API:
GET /versions/base-path-to-document
returns all versions sorted chronologicallyPOST /versions/base-path-to-document
automatically adds a new version. Needs the following schema:{change_note: 'something changed', updated_at: Date(), document: {}}
- Should we support major/minor versions here?
- Could we implicitly support minor versions by making
change_note
optional?
- Could we implicitly support minor versions by making
- Should we support
1.x
style version numbers (related to above question about minor/major versions)
Have you considered whether we need to deal with slug/url changes? Although I agree that it should generally discouraged, I think if we design the underlying services around the fact, we will make those rare cases where slug changes are needed very difficult to handle.