-
Notifications
You must be signed in to change notification settings - Fork 178
Description
Problem
Currently, the codebase supports both normalized and denormalized data storage modes through the normalization flag in stream metadata, but lacks comprehensive integration tests that validate denormalization behavior across different drivers and scenarios. This gap creates several problems:
-
Insufficient End-to-End Validation: While the codebase has logic to handle denormalized data storage (storing raw JSON in
StringifiedDatacolumn whennormalization=false), there are no integration tests that verify this works correctly from source to destination. Without these tests, we cannot be certain that denormalized data is correctly:- Stored as JSON strings in the destination
- Preserved with all nested structures intact
- Readable and parseable after storage
- Handled correctly during CDC operations (insert, update, delete)
-
Driver-Specific Behavior Unknown: Different drivers (MySQL, Postgres, MongoDB) have different data structures:
- Relational drivers (MySQL, Postgres) default to
normalization=trueand store flattened columns - Non-relational drivers (MongoDB) default to
normalization=falseand store raw JSON - Without integration tests, we cannot verify that denormalization works correctly when explicitly set to
falsefor relational drivers or when set totruefor non-relational drivers
- Relational drivers (MySQL, Postgres) default to
etc.
Without proper integration tests, users cannot be confident that denormalized mode works as expected for their use cases.
Solution
Architecture
The integration tests should follow the existing test structure in utils/testutils/test_utils.go and extend the IntegrationTest type to support denormalization testing scenarios.
Expected Outcomes
- Comprehensive integration test coverage for denormalization functionality across MySQL, Postgres, and MongoDB
- Validation that denormalized data is correctly stored as JSON strings
- Verification that complex nested data structures are preserved in denormalized mode