What kind of NoSql data modelling is best suitable for the following requirement?
This can be visualised (NoSQL-Document) as a Collection of Records where each Record contains nested Documents.The nested document entities at different levels are either flat or tree structure based. A Record is structurally a single entity, i.e., a deletion of a record deletes all of the record and its module data.
The nested documents type model does not provide the flexibility in querying the sub-document items but keeps the structure of the record straightforward. On the other hand, if the Modules are represented as different Collections then it may improve querying but the reference and join operations have to be handled back end.
The typical use cases of the system are, the model entities can grow up to 100,000 items per module, more-frequent query and less-frequent update of the entities and heavy cross reference of entities (for example, an entity deep inside the tree structure in module B referring to an entity in module A).
If the Modules are implemented as separate documents then maintaining the relationship between the corresponding record and the module entities would become cumbersome. This will become a more serious problem if the number of records increases then the respective module collection will grow significantly more without bounds, whereas embedding the module inside the record will grow only up to 100,000 items.
One proposal for the above issue. Create separate documents with Record+Module information then this can be treated logically grouped as a single entity. For example, Record1 as one document, ModuleA of the Record1 as Record1_ModuleA document and so on. This way the documents with the record id+module name combination can be grouped to form one entity.
Does any NoSQL Db support grouping of related documents? In this case, the record document can be grouped with its modules as separate documents and the group can be logically identified as a single entity of record.
Right now, I'm thinking in terms of Document Databases. Could this be efficiently handled with any other data modeling techniques?