CMD Integration Pattern for Search and Ingest Services
- A . API-Based and Event-Based Integration Pattern for Search Service
- 1. API-Based Architecture
- 2. Event-Based Architecture
- B. API-Based Integration Pattern for Ingestion Service
- Step 1: Integrate Rule Set API for Field Validation (Client-Side)
- Step 2: Integrate Validate API for Field Validation (Server-Side)
- Step 3: Integrate Match/Duplicate API for Duplicate Detection
- Step 4: Integrate Ingest API for Customer Record Creation/Update
- CMD API Flow Diagram Customer Data Flow Diagram
- OAS and Srargate Proxy
A . API-Based and Event-Based Integration Pattern for Search Service
1. API-Based Architecture
The API-based approach facilitates direct interaction between the Consumer Application and the search services through a centralized traffic management system.
Workflow:
- Consumer Application:
- Authenticates via the Search APIGEE Endpoint.
- Requests for data by making an API call.
- The consuming application raises a Stargate request to gain access to the required APIs.
- Traffic Manager:
- Acts as a load balancer, routing requests to the appropriate Search Service instance based on region.
- Regional Search Services:
- Located in West Europe (WE) and North Europe (NE).
- Each service connects to its respective Elasticsearch backend for retrieving search results.
2. Event-Based Architecture
The event-based approach relies on a publish-subscribe model, which decouples the producer (SMDS CMD) and the consumer application.
Workflow:
- SMDS CMD:
- Publishes events to a CMD Topic hosted on a Kafka platform.
- The topic is configured with log compaction, ensuring that only the latest updates for a given key are retained.
- Consumer Application:
- Subscribes to the CMD Topic to receive event updates.
- Processes the events and persists the relevant data into consuming application’s Database (DB).
- Consuming Application:
- Queries the database through the search API built on the data persisted through kafka topic.
- Retrieves and displays the results for the end user.
B. API-Based Integration Pattern for Ingestion Service
Outlines the step-by-step process for integrating various APIs to manage data validation, duplication detection, and customer record creation in the Consuming Application.
Step 1: Integrate Rule Set API for Field Validation (Client-Side)
The Rule Set API ensures field-level validation on the client side by enforcing predefined rules.
Workflow:
- The Consuming Application calls the Rule Set API endpoint via APIGEE.
- The Ingest API (/ruleset) processes the request in the West Europe region.
- The ruleset data is stored in the West Europe DB and mapped based on country selection.
Key Benefits:
- Early detection of field-level errors.
- Reduced invalid data submissions to the backend.
Step 2: Integrate Validate API for Field Validation (Server-Side)
The Validate API performs comprehensive field validation on the server side, ensuring data integrity.
Workflow:
- The Consuming Application interacts with the Validate API endpoint via APIGEE.
- The Ingest API (/validate) validates the request at the backend in the West Europe region.
- Data integrity is maintained by updating the West Europe DB with validated information.
Key Benefits:
- Server-side enforcement of validation rules.
- Enhanced data consistency.
Step 3: Integrate Match/Duplicate API for Duplicate Detection
The Match/Duplicate API identifies potential duplicate records in the system.
Workflow:
- The Consuming Application invokes the Match/Duplicate API via APIGEE.
- Requests are routed through the Traffic Manager, which directs them to the appropriate Search Match Service instance in the West/North Europe region.
- The Search Match Service interacts with Elasticsearch to find and flag duplicate records.
Key Benefits:
- Efficient detection and handling of duplicate records.
- Ensures data uniqueness and accuracy.
Step 4: Integrate Ingest API for Customer Record Creation/Update
The Ingest API handles the creation or update of customer records in the system.
Workflow:
- The Consuming Application sends requests to the Ingest API (/ingest) via APIGEE.
- The API writes the processed data to the West Europe DB.
- The updated information is published to a CMD Topic for further consumption by downstream systems.
Key Benefits:
- Streamlined customer record management.
- Real-time data updates for downstream consumers via Kafka topics.
CMD API Flow Diagram
https://maersk-tools.atlassian.net/wiki/spaces/GDASMDS/pages/181703645597