Performance and design issue

java
n1ql
query
connections

#1

Hi,

I have a doubt about subdocuments:

I have the following document:

Document A:

{
    "id" : "1",
    "name" : "a",
    "words" : [
         {
         "id" : "es_ES-info",
          "value": "Informacion 
         },
         {
         "id" : "en_US-info",
          "value": "Information
         },
         {
         "id" : "fr_FR-info",
          "value": "Information
         },
         .... //25 locales are supported
    ]
},
{
    "id" : "2",
    "name" : "b",
    "words" : [
         {
         "id" : "es_ES-contact",
          "value": "Contacto
         },
         {
         "id" : "en_US-contact",
          "value": "Contact
         },
         {
         "id" : "fr_FR-contact",
          "value": "Contact
         },
         .... //25 locales are supported
    ]
}

¿Should I create 25 subdocuments for each document or create a different document with the differente value and then join it with nql? Each subdocument is different between all subdocuments, thus, there will be no duplicate subdocuments.

I think subdocuments is a good aproach but maybe could be very low when the data will be loaded by n1ql.
I’ll cache data using locale as key but I have doubt about the performance of the query at first time.