ADR: API to retrieve past events of storage records
New API in Storage service to rehydrate past creation and last modified events for a given kind within the given time range.
-
Proposed -
Trialing -
Under review -
Approved -
Retired
Context & Scope
The OSDU Storage service does not provide a way to retrieve past events of the records been created/modified. Many OSDU applications would be interested in retrieving the past events of the records that happened before the application subscribed to the notification service. This new API proposed in the ADR will provide the concerned applications with a way to backtrack the events.
The proposal is to provide an API on storage service to support retrieving past events of records of a kind that happened in the given time range, where the events will be returned in a paginated format and ascending chronological order based on the timestamp.
The new API will retrieve the first and the last events of the record, filter the events by the start date and end date provided by the user, and then return the filtered events.
Tradeoff Analysis
The new API does not represent a breaking change of any other API, and consequently neither for the consuming applications. Only concerned-consuming applications would benefit from this new feature, while it remains entirely transparent for others.
Decision
Provide an API to query past events of records of the given kind and return the events in paginated ascending chronological order.
{
“id”: <RECORD_ID>
“kind”: <KIND>
“op”: <CREATE|UPDATE|DELETE, etc>
"version": <VERSION>
"timestamp": <TIMESTAMP>
}
Consequences
- A new API on the Storage service would be available.
- Documentation of the Storage service should be modified with details for the new API.