-
Epic
-
Resolution: Unresolved
-
Normal
-
None
-
None
-
None
-
Consolidate subscription and contracts data models
-
False
-
-
False
-
In Progress
-
subs-swatch
-
60% To Do, 10% In Progress, 30% Done
Design Document: https://docs.google.com/document/d/1T47CHzl2G5Tye5b7gBCz66q1Up-M-JbgVYmHiHzNdwU/edit?usp=sharing
At the moment, we’re duplicating the same data in the subscriptions and the contracts tables:
The design changes aim to consolidate this structure to avoid having large amounts of data duplicated into two different tables.
The target is to only have the subscriptions table as shown in:
Advantages of Consolidation
Architecture Simplification:
- Eliminates duplication: Currently there's redundant data between subscription_measurements and contract_metrics
- Unified data model: Single location for metrics and capacities reduces complexity
- Simplified maintenance: Fewer entities = fewer failure points
Performance Improvements:
- Fewer JOINs: Coverage queries won't need to join multiple tables
- More efficient caching: Single data model to cache
- Simplified synchronization: Currently there's complex logic to keep contracts and subscriptions in sync
Data Consistency:
- Single source of truth: Capacity data will be in one place
- Lower inconsistency risk: No desynchronization between contract_metrics and subscription_measurements
Implementation Plan
1.- Stop using the SubscriptionId and only use the SubscriptionNumber. This will be done as part of SWATCH-2416.
2.- Migrate contract_metrics data to subscription_measurements
3.- Remove ContractEntity and migrate vendor_product_code
- is blocked by
-
SWATCH-2416 Change primary key from subscription id, start date to subscription number and start data
-
- Backlog
-
- is triggered by
-
SWATCH-2379 Design changes to consolidate subscription and contract data models
-
- Closed
-