I’m having dilemma about designing documents. Let’s take a product document for example. The current design will be consisting multiple documents to get a product details (PRODUCT, SKU, VENDOR, CATEGORY)
Currently, I’m assigning foreign keys of sku, vendor, and category(3 level hierarchy of categories) to product because the fields are dynamic and I want to avoid updating multiple documents at once.
To get product details (this is my query fragment):
SELECT vendor_name, sku_price, category_1, category_2, category_3
Q1: Is my query terrible?
Q2: Is it better to put vendor name, categories… etc values in product document instead of foreign key and just update them once the primary document is updated?
I’m using Couchbase Server v5.1