eclipse-tractusx / sig-release

https://eclipse-tractusx.github.io/sig-release
Apache License 2.0
9 stars 10 forks source link

⭐🚀[Concept] Identification of new twins created since the last sync of dtr #980

Open mkanal opened 3 weeks ago

mkanal commented 3 weeks ago

Overview

The goal is to develop a concept for Trace-X that ensures only newly added or to be syncted digital twins (assets) are processed, reducing daily processing volume and conserving system resources. This involves tracking the state of each twin, defining when they require reprocessing, and managing the transaction flow to ensure system resilience during scaling.

Explain the topic in 2 sentences

The Trace-X system currently lacks a mechanism to filter and process only those twins that are either newly added since the last sync or need updating due to their TTL expiration. By introducing a "Twin Process Handler" that operates based on the state of each twin, we can streamline operations and optimize resources. This handler will classify twins into various statuses (NEW, IN_PROGRESS, DONE, RESYNC, ERROR, FAIL) and define conditions for each. For instance, a twin marked as DONE will move to RESYNC if its TTL expires, triggering necessary processing. A retry logic will manage errors, and transaction integrity will support scaling and rollback for system consistency.

What's the benefit?

This approach reduces unnecessary processing, optimizing resource usage by focusing on new or stale twins, which increases overall efficiency.

What are the Risks/Dependencies ?

Detailed explanation

Current implementation

Currently, Trace-X processes twins received from DTR (Digital Twin Registry) daily without a targeted approach to filter out only new or outdated assets. This results in higher resource use and processing redundancy.

Proposed improvement

Implement the "Twin Process Handler" to:

Identify and process only new twins or those requiring updates based on TTL or error states. Introduce a robust state model to track each twin's status and prevent redundant processing. Ensure transactional consistency across multiple instances to support scaling and maintain system integrity. Incorporate TTL for each twin, streamlining when resyncs occur based on system-defined time or condition thresholds.

Open questions

Feature Team

Contributor

Committer

User Stories

As a customer I want

     Trace-X to identify those Assets/Twins received in DTR sync which were added since last sync 

     AND 

     Trace-X identify those Assets/Twins which have to be updated after a given time 

so that only new added twins or twins to be updated will be processed which reduced the number of Twins to be processed on a daily basis is significantly, and system resources are preserved.

Acceptance Criteria

Test Cases

Test Case 1

Steps

  1. Do something
  2. Click something
  3. Add something

Expected Result

  1. Expectation
  2. Expectation
  3. Expectation

Architectural Relevance

The following items are ensured (answer: yes) after this issue is implemented:

Justification: (Fill this out, if at least one of the checkboxes above cannot be ticked. Contact the Architecture Management Committee to get an approval for the justification)

Additional information

stephanbcbauer commented 1 week ago

Some hints from Release Management (@ther3sa) and Tractus-X Project Lead (@stephanbcbauer)