ADR: Replay API
Table of Contents
Status
-
Proposed -
Trialing -
Under review -
Approved -
Retired
Context
This ADR is centered around the implementation of the new replay API within OSDU's storage service. The purpose of this Replay API is to publish messages that indicate changes to records, which are subsequently received and processed by consumers. It's important to note that the handling of these messages follows an idempotent process.
Decision
The Replay API will address following-
a) Disaster recovery - All records in storage are brought back to RPO (Recovery Point Objective) state.
b) Responsibility of publishing record change messages for consumer services -
- Indexer Service - The Indexer service will be the consumer to the reindex event.
- Schema Service- Correction of indices after changes to structure of the storage records of a particular kind.
Design
The following options were considered for Design -
Options | Pro | Cons | Work Required |
---|---|---|---|
1. Using Airflow + Message Broker + StorageService + Workflow Service |
- Proven Workflow Engine - Lesser new implementations in storage services, so lesser work required by other CSPs. |
- Process becomes slower and inefficient. - Lot of HTTP calls from Airflow <-> AKS - Airflow will require access to internal Infrastructure to operate in the most efficient manner. - Some required features are not yet available in ADF Airflow - Parallelization may spawn up 1000s of tasks waiting to be scheduled. **Scalability can be issue.** - Concurrency and Safety guarantee is tricky – allowing no more than one reindex for a kind |
Airflow - DAG using TaskGroups, Dynamic Task Mapping, Concurrency handling. - Build pipelines to integrate new DAG. Storage Service - Implement new APIs to publish messages to message broker. Indexer Service Workflow Service - Have new APIs to support observability - Design for checkpointing |
2. Using StorageService + Message Broker |
- Simple, Lesser moving parts - Fast & Efficient |
- Parallelization may require state management. |
Storage Service - New APIs for exposing Replay functionality (ReplayAll, ReplayKind, GetReplayStatus) - New Modules for replay message processing Indexer Service - Delete ALL kinds API |
Design Approach for option 2:
Implementation Steps:
Attaching the swagger yaml describing the Replay API.