MongoDB Atlas Search schema for Product catalog

Our scenario:

  • solution dedicated to product catalog - products, categories, stocks
  • 50 countries → 50 different product catalogs (same structure - just want to differ per country)
  • each product catalog contains from 5k to 70k products
  • gonna be integrated with Java Spring boot app with reactive stack (WebFlux) - microservice

For each country we import categories, products and stocks. All of them from different API. We have daily updates.

Each API is executed multiple times, as many as number of supported languages in specific country. API can returns data only in specific language.
So, lets assume that one country supports en and de languages. Then we have to call API with ‘en’ lang and later with ‘de’ lang.

At the end we can have java classes which may look like:
Category:

  • countryCode: String
  • code: String
  • names: Map<String, String> (localized based on API) - key: lang_code value: translated text
  • descriptions: Map<String, String> (localized based on API) - key: lang_code value: translated text
  • parentCategories: List of Category - might be also a list of ids?
  • subCategories: List of Category - might be also a list of ids?

Stock:

  • countryCode: String
  • productCode: String
  • warehouseCode: String
  • value: int
  • status: Enum (OUT_OF_STOCK, LOW_STOCK, IN_STOCK)

Product:

  • code: String
  • countryCode: String
  • brand: String
  • stocks: List of Stock
  • categories: List of Categories - categories or maybe List with categories codes only?
  • names: Map<String, String> (localized based on API) - key: lang_code value: translated text
  • description: Map<String, String> (localized based on API) - key: lang_code value: translated text
  • group: String - indicates if customer can see this product → each customer is assigned to specific group.
    Those groups must match to make product visible
  • attributes: List of ProductAttribute - potentially 1k for each product, maybe better to use only reference?
  • active: boolean

ProductAttribute:

  • countryCode: String
  • group: String - indicates to which group of attributes given attribute belongs to
  • code: String
  • productCode: String - it is required here?
  • values: Map<String, String> (localized based on API) - key: lang_code value: translated text

First question: is it better to have dedicated collections per country or one collection with index on ‘id’ and ‘country code’?
By ‘dedicated collections’ i mean something like: products_de, products_uk and so on. Then country code attribute is no longer required i guess.

On the other hand we can have one collection: ‘products’, but then we have to use code and countryCode as unique combination. Same for other classes.

Uses cases i have to cover - Atlas search:

  • search by partial product code / name (+ autocomplete, suggestions) - in country specific language
  • product catalog navigation element (visible in page header navigation) - navigation with categories + exact number of products available for customer
    For example:
    • Catalog:
      • garden category (2546 products)
        • plants category (2000 products)
        • others (546 products)
      • kitchen category (8956 products)
  • Product listing page visible when user clicks ‘more products’ after search in ‘search bar’ - paginated page
  • Product listing page visible when user clicks specific category link - paginated page
  • Product listing page facets available on the left side of page. Possible facets:
    • brand
    • sub-category
    • stocks

I know that my question might be fuzzy at this point, but please help me to make a decision which strategy i should use, single collection or collections per country.
Also if you could generally evaluate this use-case, maybe you have some tips?