I am developing a Node.js server that will add children to 100 different parents every 60 seconds.
The parents are 100 different markets:
and the children are timestamps containing some data in them:
...millions of more timestamps
Timestamps will be more than millions in the database. I am thinking of Array on Ancestors to store an array of children(timestamps) in every parent(only 100), so I'm thinking the arrays will contain millions of objects. Is that safe?
I am using mLab and followed the tutorial on MongoDB Docs to create the database using:
db.collection('database').insert({ _id: "data", ancestors: [], parent: null })
db.collection('database').insert({ _id: "ADABTC", ancestors: ["data"], parent: "data" })
db.collection('database').insert({ _id: "entry", ancestors: ["ADABTC", "data"], parent: "ADABTC" })
but I ended up with something that I could not understand. I am very familiar with Firebase but got confused trying to switch from Firebase to MongoDB because of costs when storing mass data.
Which methods can I use in Node.js to achieve this data structure?