I did not last long have been working with nosql , I have one main table that stores a reference to the external table. for search I used elasticsearch and me needed join (join tables)To obtain the desired information, but nosql does not use join. I found child / Parent solution, but it have their problems. There are any alternatives or better to change the structure, use nested objects?
1 Answer
Nosql has some of disadvantages like NoJoins.To over come that we need to query two or three collections in mongodb.
1) To over come that we need perform join before you store.If you wanna calculate a stat from a set of data perform mapReduce and store in collections.
2) As said nested objects also more effective.If hard disk space id not an issue you can go with nested docs.But i mongodb you cant create a doc more size than 16mb.
Using Elasticsearch
3) In ES if you want data form more than one index then you can go with aliases. refer http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html
4) And last the parent child concept in elastic search ..It may be look like complex.But it helps a lot.
If your application is more write and less read means perform joins during reading.Like quering two or more collection to get a single information
If your application is more read and less write performs joins before storing documents.Go with nested objects is right choice you will write once read with one call.It will reduce CU usage a lot..
HOpe it helsp..!