Hello All
Am in the process of designing a parent and child collections for a requirement. Say for instance, i need to design the parent collection as customer profile master and child collection as customer profile history.
Master will be inserted or updated based on the input recieved from source system. There will be only one record for a customer at any point of time.
History collection will always be inserted based on the input received from source system. There will be only multiple records for a customer. We would have received insert(first time), insert(record for updating a part of the profile information in master).
How to handle the relationship between the two collections from the data loading perspective ?
If the data loading is going to happen in parallel, what should be keys used for establishing a relationhip?
- Natural keys (customer_id, source system name, etc)
- _id column in master be referenced in child in separate column like parent_customer_id = objectId(master collection _id).
But the second option creates a dependency while loading the data in the child collection.
Request you all to provide your suggestions/guidance in this regard.
Thanks in advance.
Swami