Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make product options and option groups channel-aware #3318

Open
asonnleitner opened this issue Jan 15, 2025 · 0 comments
Open

Make product options and option groups channel-aware #3318

asonnleitner opened this issue Jan 15, 2025 · 0 comments

Comments

@asonnleitner
Copy link
Contributor

Is your feature request related to a problem? Please describe.
In the current Vendure implementation, product options and option groups are not channel-aware. Our production data analysis shows severe data duplication:

  • From 1.3M product options, 1.17M (88.7%) are duplicates
  • From 263K option groups, 263.9K (99.9%) are duplicates
  • From 10.2M option translations, 10.1M (98.3%) are duplicates
  • From 2.6M option group translations, 2.63M (99.9%) are duplicates

This leads to:

  1. Massive database bloat
  2. Performance degradation due to duplicate data
  3. Maintenance overhead when updating options across channels
  4. Consistency issues when managing the same options in different channels

Describe the solution you'd like
Make ProductOptionGroup, ProductOptionGroupTranslation, ProductOption, and ProductOptionTranslation entities channel-aware by:

  1. Adding Many-to-Many relationships with Channel entity
  2. Updating GraphQL schema to support channel operations
  3. Providing migration path for existing data
  4. Updating admin UI to support channel-specific option management

This would allow users to manage options per channel without creating duplicates.

Additional context
SQL query used for analysis:

SELECT
    (SELECT COUNT(*) FROM product_option) AS product_option,
    (SELECT COUNT(*) FROM product_option_translation) AS product_option_translation,
    (SELECT COUNT(*) FROM product_option_group) AS product_option_group,
    (SELECT COUNT(*) FROM product_option_group_translation) AS product_option_group_translation,
    (SELECT COUNT(*) - COUNT(DISTINCT code) FROM product_option) AS duplicate_codes_in_product_option,
    (SELECT COUNT(*) - COUNT(DISTINCT code) FROM product_option_group) AS duplicate_codes_in_product_option_group,
    (SELECT COUNT(*) - COUNT(DISTINCT name) FROM product_option_translation) AS duplicate_names_in_product_option_translation,
    (SELECT COUNT(*) - COUNT(DISTINCT name) FROM product_option_group_translation) AS duplicate_names_in_product_option_group_translation;

Results showing the scale of duplication:

{
    "product_option": 1325768,
    "product_option_translation": 10268769,
    "product_option_group": 263903,
    "product_option_group_translation": 2638193,
    "duplicate_codes_in_product_option": 1176201,
    "duplicate_codes_in_product_option_group": 263901,
    "duplicate_names_in_product_option_translation": 10099216,
    "duplicate_names_in_product_option_group_translation": 2638161
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant